Changeset 17546 for branches/2521_ProblemRefactoring/HeuristicLab.Problems.Binary/3.3/DeceptiveStepTrapProblem.cs
- Timestamp:
- 05/19/20 15:01:59 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Binary/3.3/DeceptiveStepTrapProblem.cs
r17544 r17546 22 22 #endregion 23 23 24 using System;25 24 using HEAL.Attic; 26 25 using HeuristicLab.Common; … … 45 44 public DeceptiveStepTrapProblem() : base() { 46 45 Parameters.Add(StepSizeParameter = new FixedValueParameter<IntValue>("Step Size", "", new IntValue(2))); 47 offset = (TrapSize - StepSize) % StepSize;46 CalculateOffset(); 48 47 49 48 RegisterParameterEvents(); … … 79 78 80 79 private void RegisterParameterEvents() { 81 StepSizeParameter.Value.ValueChanged += StepSizeOnChanged;80 IntValueParameterChangeHandler.Create(StepSizeParameter, CalculateOffset); 82 81 } 83 82 84 protected override void TrapSizeOnChanged( object sender, EventArgs e) {85 base.TrapSizeOnChanged( sender, e);86 offset = (TrapSize - StepSize) % StepSize;83 protected override void TrapSizeOnChanged() { 84 base.TrapSizeOnChanged(); 85 CalculateOffset(); 87 86 } 88 87 89 private void StepSizeOnChanged(object sender, EventArgs e) {88 private void CalculateOffset() { 90 89 offset = (TrapSize - StepSize) % StepSize; 91 90 }
Note: See TracChangeset
for help on using the changeset viewer.