Changeset 5207 for branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Manipulators/UniformIntValueManipulator.cs
- Timestamp:
- 01/04/11 02:18:27 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Manipulators/UniformIntValueManipulator.cs
r5111 r5207 37 37 38 38 public static void ApplyStatic(IRandom random, IntValue value, IntValueRange range) { 39 bool ok = false; 39 40 var vector = new IntegerVector(new int[] { value.Value }); 40 UniformOnePositionManipulator.Apply(random, vector, range.LowerBound, new IntValue(range.UpperBound.Value + 1)); 41 value.Value = vector[0]; 42 range.Fix(value); 41 int val = value.Value; 42 43 while (!ok) { 44 vector[0] = val; 45 UniformOnePositionManipulator.Apply(random, vector, range.LowerBound, new IntValue(range.UpperBound.Value + 1)); 46 value.Value = vector[0]; 47 range.ApplyStepSize(value); 48 ok = range.IsInRange(value.Value); 49 } 43 50 } 44 51 }
Note: See TracChangeset
for help on using the changeset viewer.