Changeset 78
- Timestamp:
- 03/19/08 12:23:17 (17 years ago)
- Location:
- trunk/sources/HeuristicLab.ES
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.ES/ES.cs
r71 r78 159 159 op.OperatorGraph.InitialOperator = sp; 160 160 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); 167 167 168 168 SequentialSubScopesProcessor ssp = new SequentialSubScopesProcessor(); … … 334 334 public int Mu { 335 335 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 } 337 341 } 338 342 private IntData myLambda; 339 343 public int Lambda { 340 344 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 } 342 362 } 343 363 private BoolData myPlusNotation; 344 364 public bool PlusNotation { 345 365 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 } 347 375 } 348 376 private DoubleData myShakingFactor; -
trunk/sources/HeuristicLab.ES/ESEditor.Designer.cs
r71 r78 49 49 this.tabControl = new System.Windows.Forms.TabControl(); 50 50 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(); 51 55 this.setEvaluationButton = new System.Windows.Forms.Button(); 52 56 this.setMutationButton = new System.Windows.Forms.Button(); … … 68 72 this.problemInitializationLabel = new System.Windows.Forms.Label(); 69 73 this.initialMutationStrengthLabel = new System.Windows.Forms.Label(); 70 this.lambdaTextBox = new System.Windows.Forms.TextBox();71 74 this.mutationRateLabel = new System.Windows.Forms.Label(); 72 75 this.maximumGenerationsTextBox = new System.Windows.Forms.TextBox(); … … 77 80 this.randomSeedLabel = new System.Windows.Forms.Label(); 78 81 this.populationSizeLabel = new System.Windows.Forms.Label(); 82 this.lambdaTextBox = new System.Windows.Forms.TextBox(); 79 83 this.scopesTabPage = new System.Windows.Forms.TabPage(); 80 84 this.scopeView = new HeuristicLab.Core.ScopeView(); … … 82 86 this.resetButton = new System.Windows.Forms.Button(); 83 87 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();88 88 this.tabControl.SuspendLayout(); 89 89 this.parametersTabPage.SuspendLayout(); … … 157 157 this.parametersTabPage.UseVisualStyleBackColor = true; 158 158 // 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 // 159 199 // setEvaluationButton 160 200 // … … 349 389 this.initialMutationStrengthLabel.Text = "Initial Mutation Strength:"; 350 390 // 351 // lambdaTextBox352 //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 //359 391 // mutationRateLabel 360 392 // … … 430 462 this.populationSizeLabel.TabIndex = 4; 431 463 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; 432 472 // 433 473 // scopesTabPage … … 485 525 this.cloneEngineButton.UseVisualStyleBackColor = true; 486 526 this.cloneEngineButton.Click += new System.EventHandler(this.cloneEngineButton_Click); 487 //488 // plusNotationLabel489 //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 // plusNotationButton499 //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 // targetSuccessRateLabel511 //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 // targetSuccessRateTextBox521 //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;527 527 // 528 528 // ESEditor -
trunk/sources/HeuristicLab.ES/ESEditor.cs
r71 r78 50 50 ES.Engine.ExceptionOccurred -= new EventHandler<ExceptionEventArgs>(Engine_ExceptionOccurred); 51 51 ES.Engine.Finished -= new EventHandler(Engine_Finished); 52 ES.Changed -= new EventHandler(ES_Changed); 52 53 scopeView.Scope = null; 53 54 base.RemoveItemEvents(); … … 57 58 ES.Engine.ExceptionOccurred += new EventHandler<ExceptionEventArgs>(Engine_ExceptionOccurred); 58 59 ES.Engine.Finished += new EventHandler(Engine_Finished); 60 ES.Changed += new EventHandler(ES_Changed); 59 61 SetDataBinding(); 60 62 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(); 61 69 } 62 70
Note: See TracChangeset
for help on using the changeset viewer.