Changeset 81
- Timestamp:
- 03/19/08 13:32:00 (17 years ago)
- Location:
- trunk/sources/HeuristicLab.ES
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.ES/ES.cs
r79 r81 104 104 vi.AddVariable(new Variable("TargetSuccessProbability", new DoubleData(0.2))); 105 105 vi.AddVariable(new Variable("SuccessProbability", new DoubleData(0.2))); 106 vi.AddVariable(new Variable("UseSuccessRule", new BoolData(true))); 106 107 op.OperatorGraph.AddOperator(vi); 107 108 sp.AddSubOperator(vi); … … 249 250 op.OperatorGraph.InitialOperator = sp1; 250 251 252 ConditionalBranch cb = new ConditionalBranch(); 253 cb.GetVariableInfo("Condition").ActualName = "UseSuccessRule"; 254 op.OperatorGraph.AddOperator(cb); 255 sp1.AddSubOperator(cb); 256 257 SequentialProcessor sp2 = new SequentialProcessor(); 258 op.OperatorGraph.AddOperator(sp2); 259 cb.AddSubOperator(sp2); 260 251 261 OffspringAnalyzer oa = new OffspringAnalyzer(); 252 262 oa.Name = "Offspring Analyzer"; … … 254 264 oa.GetVariable("ComparisonFactor").Value = new DoubleData(0.0); 255 265 op.OperatorGraph.AddOperator(oa); 256 sp 1.AddSubOperator(oa);266 sp2.AddSubOperator(oa); 257 267 258 268 UniformSequentialSubScopesProcessor ussp = new UniformSequentialSubScopesProcessor(); 259 269 op.OperatorGraph.AddOperator(ussp); 260 270 oa.AddSubOperator(ussp); 261 262 SequentialProcessor sp2 = new SequentialProcessor(); 263 op.OperatorGraph.AddOperator(sp2); 264 ussp.AddSubOperator(sp2); 271 cb.AddSubOperator(ussp); 272 273 SequentialProcessor sp3 = new SequentialProcessor(); 274 op.OperatorGraph.AddOperator(sp3); 275 ussp.AddSubOperator(sp3); 265 276 266 277 OperatorExtractor oe1 = new OperatorExtractor(); … … 268 279 oe1.GetVariableInfo("Operator").ActualName = "Mutator"; 269 280 op.OperatorGraph.AddOperator(oe1); 270 sp 2.AddSubOperator(oe1);281 sp3.AddSubOperator(oe1); 271 282 272 283 OperatorExtractor oe2 = new OperatorExtractor(); … … 274 285 oe2.GetVariableInfo("Operator").ActualName = "Evaluator"; 275 286 op.OperatorGraph.AddOperator(oe2); 276 sp 2.AddSubOperator(oe2);287 sp3.AddSubOperator(oe2); 277 288 278 289 Counter c = new Counter(); 279 290 c.GetVariableInfo("Value").ActualName = "EvaluatedSolutions"; 280 291 op.OperatorGraph.AddOperator(c); 281 sp 2.AddSubOperator(c);292 sp3.AddSubOperator(c); 282 293 283 294 SuccessRuleMutationStrengthAdjuster srmsa = new SuccessRuleMutationStrengthAdjuster(); 284 295 srmsa.Name = "SuccessRuleMutationStrengthAdjuster"; 285 296 op.OperatorGraph.AddOperator(srmsa); 286 sp 1.AddSubOperator(srmsa);297 sp2.AddSubOperator(srmsa); 287 298 288 299 return op; … … 392 403 get { return myMaximumGenerations.Data; } 393 404 set { myMaximumGenerations.Data = value; } 405 } 406 private BoolData myUseSuccessRule; 407 public bool UseSuccessRule { 408 get { return myUseSuccessRule.Data; } 409 set { myUseSuccessRule.Data = value; } 394 410 } 395 411 private CombinedOperator myES; … … 481 497 myTargetSuccessProbability = vi.GetVariable("TargetSuccessProbability").GetValue<DoubleData>(); 482 498 mySuccessProbability = vi.GetVariable("SuccessProbability").GetValue<DoubleData>(); 499 myUseSuccessRule = vi.GetVariable("UseSuccessRule").GetValue<BoolData>(); 483 500 // Population Initialization 484 501 CombinedOperator co3 = (CombinedOperator)sp1.SubOperators[1]; -
trunk/sources/HeuristicLab.ES/ESEditor.Designer.cs
r78 r81 86 86 this.resetButton = new System.Windows.Forms.Button(); 87 87 this.cloneEngineButton = new System.Windows.Forms.Button(); 88 this.useSuccessRuleCheckBox = new System.Windows.Forms.CheckBox(); 88 89 this.tabControl.SuspendLayout(); 89 90 this.parametersTabPage.SuspendLayout(); … … 117 118 // parametersTabPage 118 119 // 120 this.parametersTabPage.Controls.Add(this.useSuccessRuleCheckBox); 119 121 this.parametersTabPage.Controls.Add(this.targetSuccessRateTextBox); 120 122 this.parametersTabPage.Controls.Add(this.targetSuccessRateLabel); … … 525 527 this.cloneEngineButton.UseVisualStyleBackColor = true; 526 528 this.cloneEngineButton.Click += new System.EventHandler(this.cloneEngineButton_Click); 529 // 530 // useSuccessRuleMutationStrengthAdjustmentCheckBox 531 // 532 this.useSuccessRuleCheckBox.Anchor = System.Windows.Forms.AnchorStyles.None; 533 this.useSuccessRuleCheckBox.AutoSize = true; 534 this.useSuccessRuleCheckBox.Checked = true; 535 this.useSuccessRuleCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; 536 this.useSuccessRuleCheckBox.Location = new System.Drawing.Point(411, 184); 537 this.useSuccessRuleCheckBox.Name = "useSuccessRuleMutationStrengthAdjustmentCheckBox"; 538 this.useSuccessRuleCheckBox.Size = new System.Drawing.Size(51, 17); 539 this.useSuccessRuleCheckBox.TabIndex = 40; 540 this.useSuccessRuleCheckBox.Text = "Use?"; 541 this.useSuccessRuleCheckBox.UseVisualStyleBackColor = true; 542 this.useSuccessRuleCheckBox.CheckedChanged += new System.EventHandler(this.useSuccessRuleCheckBox_CheckedChanged); 527 543 // 528 544 // ESEditor … … 587 603 private System.Windows.Forms.TextBox targetSuccessRateTextBox; 588 604 private System.Windows.Forms.Label targetSuccessRateLabel; 605 private System.Windows.Forms.CheckBox useSuccessRuleCheckBox; 589 606 } 590 607 } -
trunk/sources/HeuristicLab.ES/ESEditor.cs
r78 r81 90 90 initialMutationStrengthTextBox.DataBindings.Add("Text", ES, "ShakingFactor"); 91 91 targetSuccessRateTextBox.DataBindings.Add("Text", ES, "SuccessProbability"); 92 useSuccessRuleCheckBox.DataBindings.Add("Checked", ES, "UseSuccessRule"); 92 93 } 93 94 … … 177 178 private void Engine_Finished(object sender, EventArgs e) { 178 179 scopeView.Refresh(); 180 if (executeButton.InvokeRequired) { 181 executeButton.Invoke(new MethodInvoker(EnableExecute)); 182 } else { 183 executeButton.Enabled = true; 184 abortButton.Enabled = false; 185 } 186 } 187 private void EnableExecute() { 179 188 executeButton.Enabled = true; 180 189 abortButton.Enabled = false; 181 190 } 182 191 #endregion 192 193 #region CheckBox Events 194 private void useSuccessRuleCheckBox_CheckedChanged(object sender, EventArgs e) { 195 targetSuccessRateTextBox.Enabled = useSuccessRuleCheckBox.Checked; 196 } 197 #endregion 183 198 } 184 199 }
Note: See TracChangeset
for help on using the changeset viewer.