Changeset 5337 for branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints
- Timestamp:
- 01/20/11 01:30:44 (14 years ago)
- Location:
- branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/DoubleValueRange.cs
r5207 r5337 29 29 } 30 30 31 public void ApplyStepSize(DoubleValue value) {32 value.Value = ((int)Math.Round(value.Value / this.StepSize.Value, 0)) * this.StepSize.Value;31 public double ApplyStepSize(double value) { 32 return (Math.Round(value / this.StepSize.Value, 0)) * this.StepSize.Value; 33 33 } 34 34 … … 44 44 solutions.Add(new DoubleValue(value)); 45 45 value += StepSize.Value; 46 value = ApplyStepSize(value); 46 47 } 47 48 return solutions; -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/IntValueRange.cs
r5207 r5337 29 29 } 30 30 31 public void ApplyStepSize(IntValuevalue) {32 value.Value = ((int)Math.Round(value.Value / (double)this.StepSize.Value, 0)) * this.StepSize.Value;31 public int ApplyStepSize(int value) { 32 return ((int)Math.Round(value / (double)this.StepSize.Value, 0)) * this.StepSize.Value; 33 33 } 34 34 -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/PercentValueRange.cs
r5207 r5337 33 33 } 34 34 35 public void ApplyStepSize(PercentValue value) {36 value.Value = ((int)Math.Round(value.Value / this.StepSize.Value, 0)) * this.StepSize.Value;35 public double ApplyStepSize(double value) { 36 return ((int)Math.Round(value / this.StepSize.Value, 0)) * this.StepSize.Value; 37 37 } 38 38 … … 48 48 solutions.Add(new PercentValue(value)); 49 49 value += StepSize.Value; 50 value = ApplyStepSize(value); 50 51 } 51 52 return solutions;
Note: See TracChangeset
for help on using the changeset viewer.