Free cookie consent management tool by TermsFeed Policy Generator

Changeset 78


Ignore:
Timestamp:
03/19/08 12:23:17 (16 years ago)
Author:
abeham
Message:

Fixed tickets #63, #66 regarding ES

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

Legend:

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

    r71 r78  
    159159      op.OperatorGraph.InitialOperator = sp;
    160160
    161       LeftSelector ls = new LeftSelector();
    162       ls.Name = "Child Selector";
    163       ls.GetVariableInfo("Selected").ActualName = "ESlambda";
    164       ls.GetVariable("CopySelected").Value = new BoolData(true);
    165       op.OperatorGraph.AddOperator(ls);
    166       sp.AddSubOperator(ls);
     161      RandomSelector rs = new RandomSelector();
     162      rs.Name = "Child Selector";
     163      rs.GetVariableInfo("Selected").ActualName = "ESlambda";
     164      rs.GetVariable("CopySelected").Value = new BoolData(true);
     165      op.OperatorGraph.AddOperator(rs);
     166      sp.AddSubOperator(rs);
    167167
    168168      SequentialSubScopesProcessor ssp = new SequentialSubScopesProcessor();
     
    334334    public int Mu {
    335335      get { return myMu.Data; }
    336       set { myMu.Data = value; }
     336      set {
     337        myMu.Data = value;
     338        if (!PlusNotation && value >= Lambda) myLambda.Data = value + 1;
     339        OnChanged();
     340      }
    337341    }
    338342    private IntData myLambda;
    339343    public int Lambda {
    340344      get { return myLambda.Data; }
    341       set { myLambda.Data = value; }
     345      set {
     346        if (value > 0) {
     347          if (PlusNotation) myLambda.Data = value;
     348          else {
     349            if (value > 1 && value < Mu) {
     350              myLambda.Data = value;
     351              myMu.Data = value - 1;
     352            } else if (value == 1) {
     353              myMu.Data = 1;
     354              myLambda.Data = 2;
     355            } else if (value > Mu) {
     356              myLambda.Data = value;
     357            }
     358          }
     359          OnChanged();
     360        }
     361      }
    342362    }
    343363    private BoolData myPlusNotation;
    344364    public bool PlusNotation {
    345365      get { return myPlusNotation.Data; }
    346       set { myPlusNotation.Data = value; }
     366      set {
     367        if (!value && myPlusNotation.Data) { // from plus to point
     368          if (Lambda <= Mu) {
     369            myLambda.Data = Mu + 1;
     370          }
     371        }
     372        myPlusNotation.Data = value;
     373        OnChanged();
     374      }
    347375    }
    348376    private DoubleData myShakingFactor;
  • trunk/sources/HeuristicLab.ES/ESEditor.Designer.cs

    r71 r78  
    4949      this.tabControl = new System.Windows.Forms.TabControl();
    5050      this.parametersTabPage = new System.Windows.Forms.TabPage();
     51      this.targetSuccessRateTextBox = new System.Windows.Forms.TextBox();
     52      this.targetSuccessRateLabel = new System.Windows.Forms.Label();
     53      this.plusNotationButton = new System.Windows.Forms.Button();
     54      this.plusNotationLabel = new System.Windows.Forms.Label();
    5155      this.setEvaluationButton = new System.Windows.Forms.Button();
    5256      this.setMutationButton = new System.Windows.Forms.Button();
     
    6872      this.problemInitializationLabel = new System.Windows.Forms.Label();
    6973      this.initialMutationStrengthLabel = new System.Windows.Forms.Label();
    70       this.lambdaTextBox = new System.Windows.Forms.TextBox();
    7174      this.mutationRateLabel = new System.Windows.Forms.Label();
    7275      this.maximumGenerationsTextBox = new System.Windows.Forms.TextBox();
     
    7780      this.randomSeedLabel = new System.Windows.Forms.Label();
    7881      this.populationSizeLabel = new System.Windows.Forms.Label();
     82      this.lambdaTextBox = new System.Windows.Forms.TextBox();
    7983      this.scopesTabPage = new System.Windows.Forms.TabPage();
    8084      this.scopeView = new HeuristicLab.Core.ScopeView();
     
    8286      this.resetButton = new System.Windows.Forms.Button();
    8387      this.cloneEngineButton = new System.Windows.Forms.Button();
    84       this.plusNotationLabel = new System.Windows.Forms.Label();
    85       this.plusNotationButton = new System.Windows.Forms.Button();
    86       this.targetSuccessRateLabel = new System.Windows.Forms.Label();
    87       this.targetSuccessRateTextBox = new System.Windows.Forms.TextBox();
    8888      this.tabControl.SuspendLayout();
    8989      this.parametersTabPage.SuspendLayout();
     
    157157      this.parametersTabPage.UseVisualStyleBackColor = true;
    158158      //
     159      // targetSuccessRateTextBox
     160      //
     161      this.targetSuccessRateTextBox.Anchor = System.Windows.Forms.AnchorStyles.None;
     162      this.targetSuccessRateTextBox.Location = new System.Drawing.Point(218, 182);
     163      this.targetSuccessRateTextBox.Name = "targetSuccessRateTextBox";
     164      this.targetSuccessRateTextBox.Size = new System.Drawing.Size(186, 20);
     165      this.targetSuccessRateTextBox.TabIndex = 39;
     166      //
     167      // targetSuccessRateLabel
     168      //
     169      this.targetSuccessRateLabel.Anchor = System.Windows.Forms.AnchorStyles.None;
     170      this.targetSuccessRateLabel.AutoSize = true;
     171      this.targetSuccessRateLabel.Location = new System.Drawing.Point(65, 185);
     172      this.targetSuccessRateLabel.Name = "targetSuccessRateLabel";
     173      this.targetSuccessRateLabel.Size = new System.Drawing.Size(111, 13);
     174      this.targetSuccessRateLabel.TabIndex = 38;
     175      this.targetSuccessRateLabel.Text = "Target Success Rate:";
     176      //
     177      // plusNotationButton
     178      //
     179      this.plusNotationButton.Anchor = System.Windows.Forms.AnchorStyles.None;
     180      this.plusNotationButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     181      this.plusNotationButton.Location = new System.Drawing.Point(218, 208);
     182      this.plusNotationButton.Name = "plusNotationButton";
     183      this.plusNotationButton.Size = new System.Drawing.Size(78, 24);
     184      this.plusNotationButton.TabIndex = 37;
     185      this.plusNotationButton.Text = "Plus";
     186      this.plusNotationButton.UseVisualStyleBackColor = true;
     187      this.plusNotationButton.Click += new System.EventHandler(this.plusNotationButton_Click);
     188      //
     189      // plusNotationLabel
     190      //
     191      this.plusNotationLabel.Anchor = System.Windows.Forms.AnchorStyles.None;
     192      this.plusNotationLabel.AutoSize = true;
     193      this.plusNotationLabel.Location = new System.Drawing.Point(65, 214);
     194      this.plusNotationLabel.Name = "plusNotationLabel";
     195      this.plusNotationLabel.Size = new System.Drawing.Size(102, 13);
     196      this.plusNotationLabel.TabIndex = 36;
     197      this.plusNotationLabel.Text = "Plus/Point Notation:";
     198      //
    159199      // setEvaluationButton
    160200      //
     
    349389      this.initialMutationStrengthLabel.Text = "Initial Mutation Strength:";
    350390      //
    351       // lambdaTextBox
    352       //
    353       this.lambdaTextBox.Anchor = System.Windows.Forms.AnchorStyles.None;
    354       this.lambdaTextBox.Location = new System.Drawing.Point(218, 104);
    355       this.lambdaTextBox.Name = "lambdaTextBox";
    356       this.lambdaTextBox.Size = new System.Drawing.Size(186, 20);
    357       this.lambdaTextBox.TabIndex = 9;
    358       //
    359391      // mutationRateLabel
    360392      //
     
    430462      this.populationSizeLabel.TabIndex = 4;
    431463      this.populationSizeLabel.Text = "Mu:";
     464      //
     465      // lambdaTextBox
     466      //
     467      this.lambdaTextBox.Anchor = System.Windows.Forms.AnchorStyles.None;
     468      this.lambdaTextBox.Location = new System.Drawing.Point(218, 104);
     469      this.lambdaTextBox.Name = "lambdaTextBox";
     470      this.lambdaTextBox.Size = new System.Drawing.Size(186, 20);
     471      this.lambdaTextBox.TabIndex = 9;
    432472      //
    433473      // scopesTabPage
     
    485525      this.cloneEngineButton.UseVisualStyleBackColor = true;
    486526      this.cloneEngineButton.Click += new System.EventHandler(this.cloneEngineButton_Click);
    487       //
    488       // plusNotationLabel
    489       //
    490       this.plusNotationLabel.Anchor = System.Windows.Forms.AnchorStyles.None;
    491       this.plusNotationLabel.AutoSize = true;
    492       this.plusNotationLabel.Location = new System.Drawing.Point(65, 214);
    493       this.plusNotationLabel.Name = "plusNotationLabel";
    494       this.plusNotationLabel.Size = new System.Drawing.Size(102, 13);
    495       this.plusNotationLabel.TabIndex = 36;
    496       this.plusNotationLabel.Text = "Plus/Point Notation:";
    497       //
    498       // plusNotationButton
    499       //
    500       this.plusNotationButton.Anchor = System.Windows.Forms.AnchorStyles.None;
    501       this.plusNotationButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
    502       this.plusNotationButton.Location = new System.Drawing.Point(218, 208);
    503       this.plusNotationButton.Name = "plusNotationButton";
    504       this.plusNotationButton.Size = new System.Drawing.Size(78, 24);
    505       this.plusNotationButton.TabIndex = 37;
    506       this.plusNotationButton.Text = "Plus";
    507       this.plusNotationButton.UseVisualStyleBackColor = true;
    508       this.plusNotationButton.Click += new System.EventHandler(this.plusNotationButton_Click);
    509       //
    510       // targetSuccessRateLabel
    511       //
    512       this.targetSuccessRateLabel.Anchor = System.Windows.Forms.AnchorStyles.None;
    513       this.targetSuccessRateLabel.AutoSize = true;
    514       this.targetSuccessRateLabel.Location = new System.Drawing.Point(65, 185);
    515       this.targetSuccessRateLabel.Name = "targetSuccessRateLabel";
    516       this.targetSuccessRateLabel.Size = new System.Drawing.Size(111, 13);
    517       this.targetSuccessRateLabel.TabIndex = 38;
    518       this.targetSuccessRateLabel.Text = "Target Success Rate:";
    519       //
    520       // targetSuccessRateTextBox
    521       //
    522       this.targetSuccessRateTextBox.Anchor = System.Windows.Forms.AnchorStyles.None;
    523       this.targetSuccessRateTextBox.Location = new System.Drawing.Point(218, 182);
    524       this.targetSuccessRateTextBox.Name = "targetSuccessRateTextBox";
    525       this.targetSuccessRateTextBox.Size = new System.Drawing.Size(186, 20);
    526       this.targetSuccessRateTextBox.TabIndex = 39;
    527527      //
    528528      // ESEditor
  • trunk/sources/HeuristicLab.ES/ESEditor.cs

    r71 r78  
    5050      ES.Engine.ExceptionOccurred -= new EventHandler<ExceptionEventArgs>(Engine_ExceptionOccurred);
    5151      ES.Engine.Finished -= new EventHandler(Engine_Finished);
     52      ES.Changed -= new EventHandler(ES_Changed);
    5253      scopeView.Scope = null;
    5354      base.RemoveItemEvents();
     
    5758      ES.Engine.ExceptionOccurred += new EventHandler<ExceptionEventArgs>(Engine_ExceptionOccurred);
    5859      ES.Engine.Finished += new EventHandler(Engine_Finished);
     60      ES.Changed += new EventHandler(ES_Changed);
    5961      SetDataBinding();
    6062      scopeView.Scope = ES.Engine.GlobalScope;
     63    }
     64
     65    void ES_Changed(object sender, EventArgs e) {
     66      // neither Refresh() nor Update() work
     67      muTextBox.Text = ES.Mu.ToString();
     68      lambdaTextBox.Text = ES.Lambda.ToString();
    6169    }
    6270
Note: See TracChangeset for help on using the changeset viewer.