- Timestamp:
- 03/14/22 11:37:51 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3040_VectorBasedGP/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Manipulators/UniformOnePositionManipulator.cs
r18233 r18235 85 85 if (bounds == null || bounds.Rows == 0 || bounds.Columns < 2) throw new ArgumentException("UniformOnePositionManipulator: Invalid bounds specified", "bounds"); 86 86 int min = bounds[index % bounds.Rows, 0], max = bounds[index % bounds.Rows, 1], step = 1; 87 if (min == max ) {87 if (min == max || min == max - 1) { 88 88 vector[index] = min; 89 89 } else { … … 93 93 // but 99 is not a feasible value, so max needs to be adjusted => min = 0, max = 95 94 94 max = FloorFeasible(min, max, step, max - 1); 95 if (min == max) 96 vector[index] = min; 97 else 98 vector[index] = RoundFeasible(min, max, step, random.Next(min, max)); 95 vector[index] = RoundFeasible(min, max, step, random.Next(min, max + 1)); 99 96 } 100 97 }
Note: See TracChangeset
for help on using the changeset viewer.