private void numOfSteps_Changed() { if (checkForSeedAndRuleSets()) { int num, i = 0; int[] numOfCalls = new int[Program.settings.numOfRuleSets]; List <string> numbers = StringCollectionConverter.convert(this.numOfRandSteps.Text.Trim()); Boolean successfulEntry = true; this.numOfRandSteps.Text = "#steps"; foreach (string a in numbers) { if (i == Program.settings.numOfRuleSets) { if (DialogResult.Yes == MessageBox.Show("There are no rulesets to assign to " + a + ". Would you like to continue with current limits?", "More arguments than rulesets.", MessageBoxButtons.YesNo, MessageBoxIcon.Error)) { successfulEntry = true; break; } else { successfulEntry = false; break; } } if ((int.TryParse(a, out num)) && (num > 0) && (num <= Program.settings.maxRulesToApply)) { numOfCalls[i++] = num; } else if (DialogResult.Yes == MessageBox.Show("Unable to change \"" + a + "\" for Rule-Set #" + i + " into number greater than zero and less than or equal to " + Program.settings.maxRulesToApply + ". Do you approve of setting to the value of " + Program.settings.maxRulesToApply + "? (If no, this call will be cancelled.)", "Value not defined.", MessageBoxButtons.YesNo, MessageBoxIcon.Information)) { numOfCalls[i++] = Program.settings.maxRulesToApply; } else { successfulEntry = false; break; } } if (successfulEntry) { Boolean display = (DialogResult.Yes == MessageBox.Show("Would you like to see the graph " + "after each rule application?", "Display Interim Graphs", MessageBoxButtons.YesNo, MessageBoxIcon.Information)); Generation.randomChoose GenerationApproach = new Generation.randomChoose(Program.seed, Program.rulesets, numOfCalls, display, Program.settings.recompileRules, Program.settings.execDir, Program.settings.compiledparamRules); addAndShowSearchController(new searchProcessController(GenerationApproach), true); searchControls[searchControls.Count - 1].SendToBack(); } } }
private void recognizeRandomChooseApToolStripMenuItem_Click(object sender, EventArgs e) { if (checkForSeedAndRuleSets()) { Boolean display = (DialogResult.Yes == MessageBox.Show("Would you like to see the graph " + "after each rule application?", "Display Interim Graphs", MessageBoxButtons.YesNo, MessageBoxIcon.Information)); Generation.randomChoose GenerationApproach = new Generation.randomChoose(Program.seed, Program.rulesets, Program.settings.maxRulesToApply, display, Program.settings.recompileRules, Program.settings.execDir, Program.settings.compiledparamRules); addAndShowSearchController(new searchProcessController(GenerationApproach), true); searchControls[searchControls.Count - 1].SendToBack(); } }
private void numOfSteps_Changed() { if (checkForSeedAndRuleSets()) { int num, i = 0; int[] numOfCalls = new int[Program.settings.numOfRuleSets]; List<string> numbers = StringCollectionConverter.convert(this.numOfRandSteps.Text.Trim()); Boolean successfulEntry = true; this.numOfRandSteps.Text = "#steps"; foreach (string a in numbers) { if (i == Program.settings.numOfRuleSets) { if (DialogResult.Yes == MessageBox.Show("There are no rulesets to assign to " + a + ". Would you like to continue with current limits?", "More arguments than rulesets.", MessageBoxButtons.YesNo, MessageBoxIcon.Error)) { successfulEntry = true; break; } else { successfulEntry = false; break; } } if ((int.TryParse(a, out num)) && (num > 0) && (num <= Program.settings.maxRulesToApply)) numOfCalls[i++] = num; else if (DialogResult.Yes == MessageBox.Show("Unable to change \"" + a + "\" for Rule-Set #" + i + " into number greater than zero and less than or equal to " + Program.settings.maxRulesToApply + ". Do you approve of setting to the value of " + Program.settings.maxRulesToApply + "? (If no, this call will be cancelled.)", "Value not defined.", MessageBoxButtons.YesNo, MessageBoxIcon.Information)) numOfCalls[i++] = Program.settings.maxRulesToApply; else { successfulEntry = false; break; } } if (successfulEntry) { Boolean display = (DialogResult.Yes == MessageBox.Show("Would you like to see the graph " + "after each rule application?", "Display Interim Graphs", MessageBoxButtons.YesNo, MessageBoxIcon.Information)); Generation.randomChoose GenerationApproach = new Generation.randomChoose(Program.seed, Program.rulesets, numOfCalls, display, Program.settings.recompileRules, Program.settings.execDir, Program.settings.compiledparamRules); addAndShowSearchController(new searchProcessController(GenerationApproach), true); searchControls[searchControls.Count - 1].SendToBack(); } } }