- Timestamp:
- 06/17/12 15:05:11 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding
-
Property
svn:mergeinfo
set to
/branches/IntegerVectorEncoding/HeuristicLab.Encodings.IntegerVectorEncoding merged eligible
-
Property
svn:mergeinfo
set to
-
trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Creators/UniformRandomIntegerVectorCreator.cs
r7259 r8019 49 49 /// <param name="max">The maximum value of the sampling range for each vector element (exclusive).</param> 50 50 /// <returns>The newly created integer vector.</returns> 51 public static IntegerVector Apply(IRandom random, int length, int min, int max) { 52 int[] result = new int[length]; 53 for (int i = 0; i < length; i++) 54 result[i] = random.Next(min, max); 55 return new IntegerVector(result); 51 public static IntegerVector Apply(IRandom random, int length, IntMatrix bounds) { 52 var result = new IntegerVector(length); 53 result.Randomize(random, bounds); 54 return result; 56 55 } 57 56 … … 61 60 /// <param name="random">The pseudo random number generator to use.</param> 62 61 /// <param name="length">The length of the int vector.</param> 63 /// <param name="minimum">The minimum value of the sampling range for each vector element (inclusive).</param> 64 /// <param name="maximum">The maximum value of the sampling range for each vector element (exclusive).</param> 62 /// <param name="bounds">Contains in each row for each dimension minimum (inclusive), maximum (inclusive), and step size.</param> 65 63 /// <returns>The newly created int vector.</returns> 66 protected override IntegerVector Create(IRandom random, IntValue length, Int Value minimum, IntValue maximum) {67 return Apply(random, length.Value, minimum.Value, maximum.Value);64 protected override IntegerVector Create(IRandom random, IntValue length, IntMatrix bounds) { 65 return Apply(random, length.Value, bounds); 68 66 } 69 67 }
Note: See TracChangeset
for help on using the changeset viewer.