Changeset 5144 for branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/DoubleValueRange.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/DoubleValueRange.cs
r5112 r5144 37 37 if (value.Value < this.LowerBound.Value) value.Value = this.LowerBound.Value; 38 38 } 39 40 public override IEnumerable<DoubleValue> GetCombinations() { 41 var solutions = new List<DoubleValue>(); 42 double value = ((int)Math.Round(LowerBound.Value / StepSize.Value, 0)) * StepSize.Value; 43 if (value < LowerBound.Value) value += StepSize.Value; 44 45 while (value <= UpperBound.Value) { 46 //yield return new DoubleValue(value); 47 solutions.Add(new DoubleValue(value)); 48 value += StepSize.Value; 49 } 50 return solutions; 51 } 39 52 } 40 53 }
Note: See TracChangeset
for help on using the changeset viewer.