Skip to content

Instantly share code, notes, and snippets.

class Program
{
static void Main(string[] args)
{
using (var dataContext = new DataContext())
{
Population population = new Population(1000, new TimeTableChromosome(dataContext),
new TimeTableChromosome.FitnessFunction(), new EliteSelection());
using System;
using System.Collections.Generic;
using System.Linq;
using Accord.Genetic;
using Microsoft.EntityFrameworkCore;
namespace TimeTable.Builder
{
class TimeTableChromosome:ChromosomeBase
{
struct TimeSlotChromosome
{
public TimeSpan StartAt { get; set; }
public TimeSpan EndAt => StartAt.Add(TimeSpan.FromHours(3));
public string CourseId { get; set; }
public string PlaceId { get; set; }
public string TeacherId { get; set; }
public List<string> Students { get; set; }
public int Day { get; set; }
}
using Microsoft.EntityFrameworkCore;
using TimeTable.Core.Models;
namespace TimeTableServer.Context
{
public class DataContext : DbContext
{
public DbSet<StudentCourse> StudentCourse { get; set; }
public DbSet<Student> Students { get; set; }
using System;
using System.Collections.Generic;
namespace TimeTable.Core.Models
{
public class Entity
{
public string Id { get; set; }
}
public partial class CircularProgressbarView: ContentView
{
private ProgressDrawer _ProgressDrawer;
public static readonly BindableProperty ProgressProperty = BindableProperty.Create(
"Progress", typeof(double), typeof(CircularProgressbarView),propertyChanged:OnProgressChanged);
public double Progress
{
get { return (double) GetValue(ProgressProperty); }
public class Circle
{
private readonly Func<SKImageInfo, SKPoint> _centerfunc;
public Circle(float redius, Func<SKImageInfo,SKPoint> centerfunc)
{
_centerfunc = centerfunc;
Redius = redius;
}
public SKPoint Center { get; set; }
namespace Data
{
public class Point
{
public double x { get; set; }
public double y { get; set; }
}
public static class Drawings
{
public abstract class FileSystemBase
{
protected Dictionary<string, File> _cachedFiles;
protected FileSystemBase()
{
_cachedFiles = new Dictionary<string, File>();
}
public abstract File CreateFile(string filename);
public interface IFileSystem
{
File CreateFile(string filename);
void DeleteFile(string filename);
File GetFile(string filename);
public File GetOrCreateFile(string filename)
{
var file = GetFile(filename);