Changeset 9363 for branches/OaaS/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Manipulators/UniformOnePositionManipulator.cs
- Timestamp:
- 04/16/13 13:13:41 (12 years ago)
- Location:
- branches/OaaS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll 23 24 packages
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/OaaS/HeuristicLab.Encodings.IntegerVectorEncoding
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding (added) merged: 8246,8600,8790,8806
- Property svn:mergeinfo changed
-
branches/OaaS/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Manipulators/UniformOnePositionManipulator.cs
r8019 r9363 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 (bounds.Columns > 2) step = bounds[index % bounds.Rows, 2]; 88 vector[index] = RoundFeasible(min, max, step, random.Next(min, max + 1)); 87 if (min == max) { 88 vector[index] = min; 89 } else { 90 if (bounds.Columns > 2) step = bounds[index % bounds.Rows, 2]; 91 // max has to be rounded to the lower feasible value 92 // e.g. min...max / step = 0...100 / 5, max is exclusive so it would be 0..99 93 // but 99 is not a feasible value, so max needs to be adjusted => min = 0, max = 95 94 max = FloorFeasible(min, max, step, max - 1); 95 vector[index] = RoundFeasible(min, max, step, random.Next(min, max)); 96 } 89 97 } 90 98
Note: See TracChangeset
for help on using the changeset viewer.