コード例 #1
0
        public static TimeTable Schedule(TimeTableData problemData)
        {
            problemData.PrepareHelpers();
            var sw = System.Diagnostics.Stopwatch.StartNew();
            Solution firstWeekSolution = Schedule(problemData, 1);
            sw.Stop();
            Console.WriteLine(sw.ElapsedMilliseconds + " ms");

            var firstWeekAssignments = firstWeekSolution.ScheduledWeeklyAssignments;

            DEFAULT_MAX_STEPS = 600;

            sw.Start();
            // try to partially apply the first week solution to the second one
            Solution secondWeekSolution = Schedule(problemData, 2, firstWeekAssignments);
            sw.Stop();
            Console.WriteLine(sw.ElapsedMilliseconds + " ms");

            var secondWeekAssignments = secondWeekSolution.ScheduledWeeklyAssignments;

            var result = new TimeTable(problemData);

            foreach (var assignment in firstWeekAssignments)
                result.AddAssignment(assignment);

            foreach (var assignment in secondWeekAssignments)
                result.AddAssignment(assignment);

            return result;
        }
コード例 #2
0
 void OnSelectedTimeTableChanged(TimeTable selectedTimeTable)
 {
     var empty = selectedTimeTable == null;
     tabByLecturers.Enabled = tabByGroups.Enabled = miSaveTimeTable.Enabled = !empty;
     byGroupsTimeTableView.TimeTable = byLecturersTimeTableView.TimeTable = selectedTimeTable;
 }
コード例 #3
0
 void AddTimeTable(TimeTable timeTable)
 {
     var item = new ListViewItem(timeTable.Name) { Tag = timeTable };
     timeTablesList.Items.Add(item);
     item.Selected = true;
 }