Esempio n. 1
0
        public HourPlan Clone()
        {
            var res = new HourPlan();

            res.GroupToTeacher = new Dictionary <GroupElement, TeacherElement>(GroupToTeacher);
            res.TeacherToGroup = new Dictionary <TeacherElement, GroupElement>(TeacherToGroup);
            res.Data           = new Dictionary <GroupElement, ArrayList>(Data);

            return(res);
        }
Esempio n. 2
0
        public bool Init(List <SchoolLesson> lessons)
        {
            for (int i = 0; i < HoursPerDay; i++)
            {
                for (int j = 0; j < DaysPerWeek; j++)
                {
                    HourPlans[j, i] = new HourPlan();
                }
            }  // Initialization

            foreach (var les in lessons)
            {
                if (!AddToAnyDayAndHour(les))
                {
                    return(false);
                }
            } // Random Lessons Insertion

            return(true);
        }