- Timestamp:
- 03/19/10 15:59:37 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVector.cs
r3054 r3123 56 56 } 57 57 } 58 59 public virtual void Randomize(IRandom random, int startIndex, int length, DoubleMatrix bounds) { 60 if (length > 0) { 61 for (int i = startIndex; i < startIndex + length; i++) { 62 double min = bounds[i % bounds.Rows, 0]; 63 double max = bounds[i % bounds.Rows, 1]; 64 array[i] = min + (max - min) * random.NextDouble(); 65 } 66 OnReset(); 67 } 68 } 69 58 70 public void Randomize(IRandom random, double min, double max) { 59 71 Randomize(random, 0, Length, min, max); 60 72 } 73 74 public void Randomize(IRandom random, DoubleMatrix bounds) { 75 Randomize(random, 0, Length, bounds); 76 } 77 61 78 } 62 79 }
Note: See TracChangeset
for help on using the changeset viewer.