Example #1
0
        public static DbScheduleCell Convert(ScheduleCell schedule)
        {
            if (schedule == null)
            {
                return(null);
            }

            return(new DbScheduleCell()
            {
                ClassroomId = schedule.ClassroomId,
                PeriodTimeslotId = schedule.PeriodTimeslotId,
                TeachingUnitId = schedule.TeachingUnitId,
            });
        }
Example #2
0
            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();
 }