- Timestamp:
- 03/16/10 10:35:28 (15 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Creators/UniformRandomIntegerVectorCreator.cs
r3054 r3059 31 31 /// Generates a new random integer vector with each element uniformly distributed in a specified range. 32 32 /// </summary> 33 [Item("UniformRandomInt VectorCreator", "An operator which creates a new random int vector with each element uniformly distributed in a specified range.")]33 [Item("UniformRandomIntegerVectorCreator", "An operator which creates a new random int vector with each element uniformly distributed in a specified range.")] 34 34 [StorableClass] 35 35 [Creatable("Test")] 36 public class UniformRandomInt VectorCreator : IntVectorCreator {36 public class UniformRandomIntegerVectorCreator : IntegerVectorCreator { 37 37 /// <summary> 38 38 /// Generates a new random integer vector with the given <paramref name="length"/>. … … 43 43 /// <param name="max">The maximum value of the sampling range for each vector element (exclusive).</param> 44 44 /// <returns>The newly created integer vector.</returns> 45 public static Int ArrayApply(IRandom random, int length, int min, int max) {45 public static IntegerVector Apply(IRandom random, int length, int min, int max) { 46 46 int[] result = new int[length]; 47 47 for (int i = 0; i < length; i++) 48 48 result[i] = random.Next(min, max); 49 return new Int Array(result);49 return new IntegerVector(result); 50 50 } 51 51 … … 58 58 /// <param name="maximum">The maximum value of the sampling range for each vector element (exclusive).</param> 59 59 /// <returns>The newly created int vector.</returns> 60 protected override Int ArrayCreate(IRandom random, IntValue length, IntValue minimum, IntValue maximum) {60 protected override IntegerVector Create(IRandom random, IntValue length, IntValue minimum, IntValue maximum) { 61 61 return Apply(random, length.Value, minimum.Value, maximum.Value); 62 62 }
Note: See TracChangeset
for help on using the changeset viewer.