private void FindSolutions() { if (Timetable_ == null) return; if (Timetable_.IsFull()) { MessageBox.Show("There are no remaining streams to solve for!", "Find Solutions", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } Solver_.Timetable = Timetable_; FormProgress formProgress = new FormProgress(); if (formProgress.ShowDialog(Solver_) != DialogResult.OK) return; FormSolution formSolution = new FormSolution(); if (formSolution.ShowDialog(Solver_) != DialogResult.OK) return; MadeChanges(true); }
private void FeelingLucky() { if (Timetable_ == null) return; if (Timetable_.IsFull()) Timetable_.RevertToBaseStreams(); Solver_.Timetable = Timetable_; FormProgress formProgress = new FormProgress(); if (formProgress.ShowDialog(Solver_) != DialogResult.OK) return; int index = Random_.Next(Math.Min(100, Solver_.Solutions.Count)); Timetable_.LoadSolution(Solver_.Solutions[index]); MadeChanges(true); }
private void btnCriteria_Click(object sender, EventArgs e) { FormCriteria formCriteria = new FormCriteria(); // if the criteria dialog was shown and nothing changed, all good if (formCriteria.ShowDialog(Solver_) != DialogResult.OK) return; Solver_.Timetable.RecomputeSolutions = true; FormProgress formProgress = new FormProgress(); formProgress.ShowDialog(Solver_); Reset(); }