Changeset 3048 for trunk/sources/HeuristicLab.Encodings.IntVector/3.3/Manipulators/UniformOnePositionManipulator.cs
- Timestamp:
- 03/15/10 23:49:54 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.IntVector/3.3/Manipulators/UniformOnePositionManipulator.cs
r3032 r3048 42 42 /// The lower bound of the values in the int vector. 43 43 /// </summary> 44 public ValueLookupParameter<Int Data> MinimumParameter {45 get { return (ValueLookupParameter<Int Data>)Parameters["Minimum"]; }44 public ValueLookupParameter<IntValue> MinimumParameter { 45 get { return (ValueLookupParameter<IntValue>)Parameters["Minimum"]; } 46 46 } 47 47 /// <summary> 48 48 /// The upper bound of the values in the int vector. 49 49 /// </summary> 50 public ValueLookupParameter<Int Data> MaximumParameter {51 get { return (ValueLookupParameter<Int Data>)Parameters["Maximum"]; }50 public ValueLookupParameter<IntValue> MaximumParameter { 51 get { return (ValueLookupParameter<IntValue>)Parameters["Maximum"]; } 52 52 } 53 53 … … 57 57 /// </summary> 58 58 public UniformOnePositionManipulator() { 59 Parameters.Add(new ValueLookupParameter<Int Data>("Minimum", "Minimum of the sampling range for the vector element (included)"));60 Parameters.Add(new ValueLookupParameter<Int Data>("Maximum", "Maximum of the sampling range for the vector element (excluded)"));59 Parameters.Add(new ValueLookupParameter<IntValue>("Minimum", "Minimum of the sampling range for the vector element (included)")); 60 Parameters.Add(new ValueLookupParameter<IntValue>("Maximum", "Maximum of the sampling range for the vector element (excluded)")); 61 61 } 62 62 … … 70 70 /// <param name="max">The maximum value of the sampling range for 71 71 /// the vector element to change (exclusive).</param> 72 public static void Apply(IRandom random, IntArray Data vector, IntData min, IntDatamax) {72 public static void Apply(IRandom random, IntArray vector, IntValue min, IntValue max) { 73 73 int index = random.Next(vector.Length); 74 74 vector[index] = random.Next(min.Value, max.Value); … … 81 81 /// <param name="random">A random number generator.</param> 82 82 /// <param name="vector">The integer vector to manipulate.</param> 83 protected override void Manipulate(IRandom random, IntArray Datavector) {83 protected override void Manipulate(IRandom random, IntArray vector) { 84 84 if (MinimumParameter.ActualValue == null) throw new InvalidOperationException("UniformOnePositionManipulator: Parameter " + MinimumParameter.ActualName + " could not be found."); 85 85 if (MaximumParameter.ActualValue == null) throw new InvalidOperationException("UniformOnePositionManipulator: Parameter " + MaximumParameter.ActualName + " could not be found.");
Note: See TracChangeset
for help on using the changeset viewer.