예제 #1
0
파일: GA.cs 프로젝트: gollonfield/ScheduX
        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);
        }
예제 #2
0
파일: GA.cs 프로젝트: gollonfield/ScheduX
        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);
        }