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; }
void OnSelectedTimeTableChanged(TimeTable selectedTimeTable) { var empty = selectedTimeTable == null; tabByLecturers.Enabled = tabByGroups.Enabled = miSaveTimeTable.Enabled = !empty; byGroupsTimeTableView.TimeTable = byLecturersTimeTableView.TimeTable = selectedTimeTable; }
void AddTimeTable(TimeTable timeTable) { var item = new ListViewItem(timeTable.Name) { Tag = timeTable }; timeTablesList.Items.Add(item); item.Selected = true; }