public static DbScheduleCell Convert(ScheduleCell schedule) { if (schedule == null) { return(null); } return(new DbScheduleCell() { ClassroomId = schedule.ClassroomId, PeriodTimeslotId = schedule.PeriodTimeslotId, TeachingUnitId = schedule.TeachingUnitId, }); }
public static void SetEvaluate <G>(GeneticAlgorithm <G> alg, TeachingUnit teachingUnit, Schedule schedule) where G : TimeslotChromosome, IEquatable <G> { alg.Evaluate = chromosome => { var slot = teachingUnit.FreeTimeslots[chromosome.Code]; var cell = new ScheduleCell(slot.classroom, slot.periodTimeslot, teachingUnit); schedule.ScheduleCells.Add(cell); chromosome.Value = EvaluationCalculation.Calculate(schedule); schedule.ScheduleCells.Remove(cell); }; }
public Task <ScheduleCell> AddAsync(ScheduleCell item) { throw new NotImplementedException(); }