Changeset 3048 for trunk/sources/HeuristicLab.Encodings.RealVector/3.3/Manipulators/UniformOnePositionManipulator.cs
- Timestamp:
- 03/15/10 23:49:54 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.RealVector/3.3/Manipulators/UniformOnePositionManipulator.cs
r3017 r3048 39 39 /// The lower bound of the values in the real vector. 40 40 /// </summary> 41 public ValueLookupParameter<Double Data> MinimumParameter {42 get { return (ValueLookupParameter<Double Data>)Parameters["Minimum"]; }41 public ValueLookupParameter<DoubleValue> MinimumParameter { 42 get { return (ValueLookupParameter<DoubleValue>)Parameters["Minimum"]; } 43 43 } 44 44 /// <summary> 45 45 /// The upper bound of the values in the real vector. 46 46 /// </summary> 47 public ValueLookupParameter<Double Data> MaximumParameter {48 get { return (ValueLookupParameter<Double Data>)Parameters["Maximum"]; }47 public ValueLookupParameter<DoubleValue> MaximumParameter { 48 get { return (ValueLookupParameter<DoubleValue>)Parameters["Maximum"]; } 49 49 } 50 50 … … 54 54 /// </summary> 55 55 public UniformOnePositionManipulator() { 56 Parameters.Add(new ValueLookupParameter<Double Data>("Minimum", "Minimum of the sampling range for the vector element (included)"));57 Parameters.Add(new ValueLookupParameter<Double Data>("Maximum", "Maximum of the sampling range for the vector element (excluded)"));56 Parameters.Add(new ValueLookupParameter<DoubleValue>("Minimum", "Minimum of the sampling range for the vector element (included)")); 57 Parameters.Add(new ValueLookupParameter<DoubleValue>("Maximum", "Maximum of the sampling range for the vector element (excluded)")); 58 58 } 59 59 … … 67 67 /// <param name="max">The maximum value of the sampling range for 68 68 /// the vector element to change (exclusive).</param> 69 public static void Apply(IRandom random, DoubleArray Data vector, DoubleData min, DoubleDatamax) {69 public static void Apply(IRandom random, DoubleArray vector, DoubleValue min, DoubleValue max) { 70 70 int index = random.Next(vector.Length); 71 71 vector[index] = min.Value + random.NextDouble() * (max.Value - min.Value); … … 73 73 74 74 /// <summary> 75 /// Checks if the minimum and maximum parameters are available and forwards the call to <see cref="Apply(IRandom, DoubleArray Data, DoubleData, DoubleData)"/>.75 /// Checks if the minimum and maximum parameters are available and forwards the call to <see cref="Apply(IRandom, DoubleArray, DoubleValue, DoubleValue)"/>. 76 76 /// </summary> 77 77 /// <param name="random">The random number generator to use.</param> 78 78 /// <param name="realVector">The real vector to manipulate.</param> 79 protected override void Manipulate(IRandom random, DoubleArray DatarealVector) {79 protected override void Manipulate(IRandom random, DoubleArray realVector) { 80 80 if (MinimumParameter.ActualValue == null) throw new InvalidOperationException("UniformOnePositionManipulator: Parameter " + MinimumParameter.ActualName + " could not be found."); 81 81 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.