Changeset 5144 for branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/PercentValueRange.cs
- Timestamp:
- 12/21/10 01:13:49 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/PercentValueRange.cs
r5112 r5144 32 32 return new DoubleValueRange(LowerBound, UpperBound, StepSize); 33 33 } 34 35 public override IEnumerable<PercentValue> GetCombinations() { 36 var solutions = new List<PercentValue>(); 37 double value = ((int)Math.Round(LowerBound.Value / StepSize.Value, 0)) * StepSize.Value; 38 if (value < LowerBound.Value) value += StepSize.Value; 39 40 while (value <= UpperBound.Value) { 41 //yield return new PercentValue(value); 42 solutions.Add(new PercentValue(value)); 43 value += StepSize.Value; 44 } 45 return solutions; 46 } 34 47 } 35 48 }
Note: See TracChangeset
for help on using the changeset viewer.