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