Free cookie consent management tool by TermsFeed Policy Generator

Changeset 81


Ignore:
Timestamp:
03/19/08 13:32:00 (17 years ago)
Author:
abeham
Message:

fixed #61 regarding ES

Location:
trunk/sources/HeuristicLab.ES
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.ES/ES.cs

    r79 r81  
    104104      vi.AddVariable(new Variable("TargetSuccessProbability", new DoubleData(0.2)));
    105105      vi.AddVariable(new Variable("SuccessProbability", new DoubleData(0.2)));
     106      vi.AddVariable(new Variable("UseSuccessRule", new BoolData(true)));
    106107      op.OperatorGraph.AddOperator(vi);
    107108      sp.AddSubOperator(vi);
     
    249250      op.OperatorGraph.InitialOperator = sp1;
    250251
     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
    251261      OffspringAnalyzer oa = new OffspringAnalyzer();
    252262      oa.Name = "Offspring Analyzer";
     
    254264      oa.GetVariable("ComparisonFactor").Value = new DoubleData(0.0);
    255265      op.OperatorGraph.AddOperator(oa);
    256       sp1.AddSubOperator(oa);
     266      sp2.AddSubOperator(oa);
    257267
    258268      UniformSequentialSubScopesProcessor ussp = new UniformSequentialSubScopesProcessor();
    259269      op.OperatorGraph.AddOperator(ussp);
    260270      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);
    265276
    266277      OperatorExtractor oe1 = new OperatorExtractor();
     
    268279      oe1.GetVariableInfo("Operator").ActualName = "Mutator";
    269280      op.OperatorGraph.AddOperator(oe1);
    270       sp2.AddSubOperator(oe1);
     281      sp3.AddSubOperator(oe1);
    271282
    272283      OperatorExtractor oe2 = new OperatorExtractor();
     
    274285      oe2.GetVariableInfo("Operator").ActualName = "Evaluator";
    275286      op.OperatorGraph.AddOperator(oe2);
    276       sp2.AddSubOperator(oe2);
     287      sp3.AddSubOperator(oe2);
    277288
    278289      Counter c = new Counter();
    279290      c.GetVariableInfo("Value").ActualName = "EvaluatedSolutions";
    280291      op.OperatorGraph.AddOperator(c);
    281       sp2.AddSubOperator(c);
     292      sp3.AddSubOperator(c);
    282293
    283294      SuccessRuleMutationStrengthAdjuster srmsa = new SuccessRuleMutationStrengthAdjuster();
    284295      srmsa.Name = "SuccessRuleMutationStrengthAdjuster";
    285296      op.OperatorGraph.AddOperator(srmsa);
    286       sp1.AddSubOperator(srmsa);
     297      sp2.AddSubOperator(srmsa);
    287298
    288299      return op;
     
    392403      get { return myMaximumGenerations.Data; }
    393404      set { myMaximumGenerations.Data = value; }
     405    }
     406    private BoolData myUseSuccessRule;
     407    public bool UseSuccessRule {
     408      get { return myUseSuccessRule.Data; }
     409      set { myUseSuccessRule.Data = value; }
    394410    }
    395411    private CombinedOperator myES;
     
    481497      myTargetSuccessProbability = vi.GetVariable("TargetSuccessProbability").GetValue<DoubleData>();
    482498      mySuccessProbability = vi.GetVariable("SuccessProbability").GetValue<DoubleData>();
     499      myUseSuccessRule = vi.GetVariable("UseSuccessRule").GetValue<BoolData>();
    483500      // Population Initialization
    484501      CombinedOperator co3 = (CombinedOperator)sp1.SubOperators[1];
  • trunk/sources/HeuristicLab.ES/ESEditor.Designer.cs

    r78 r81  
    8686      this.resetButton = new System.Windows.Forms.Button();
    8787      this.cloneEngineButton = new System.Windows.Forms.Button();
     88      this.useSuccessRuleCheckBox = new System.Windows.Forms.CheckBox();
    8889      this.tabControl.SuspendLayout();
    8990      this.parametersTabPage.SuspendLayout();
     
    117118      // parametersTabPage
    118119      //
     120      this.parametersTabPage.Controls.Add(this.useSuccessRuleCheckBox);
    119121      this.parametersTabPage.Controls.Add(this.targetSuccessRateTextBox);
    120122      this.parametersTabPage.Controls.Add(this.targetSuccessRateLabel);
     
    525527      this.cloneEngineButton.UseVisualStyleBackColor = true;
    526528      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);
    527543      //
    528544      // ESEditor
     
    587603    private System.Windows.Forms.TextBox targetSuccessRateTextBox;
    588604    private System.Windows.Forms.Label targetSuccessRateLabel;
     605    private System.Windows.Forms.CheckBox useSuccessRuleCheckBox;
    589606  }
    590607}
  • trunk/sources/HeuristicLab.ES/ESEditor.cs

    r78 r81  
    9090      initialMutationStrengthTextBox.DataBindings.Add("Text", ES, "ShakingFactor");
    9191      targetSuccessRateTextBox.DataBindings.Add("Text", ES, "SuccessProbability");
     92      useSuccessRuleCheckBox.DataBindings.Add("Checked", ES, "UseSuccessRule");
    9293    }
    9394
     
    177178    private void Engine_Finished(object sender, EventArgs e) {
    178179      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() {
    179188      executeButton.Enabled = true;
    180189      abortButton.Enabled = false;
    181190    }
    182191    #endregion
     192
     193    #region CheckBox Events
     194    private void useSuccessRuleCheckBox_CheckedChanged(object sender, EventArgs e) {
     195      targetSuccessRateTextBox.Enabled = useSuccessRuleCheckBox.Checked;
     196    }
     197    #endregion
    183198  }
    184199}
Note: See TracChangeset for help on using the changeset viewer.