Changeset 8590 for branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Manipulators
- Timestamp:
- 09/06/12 14:45:59 (12 years ago)
- Location:
- branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Manipulators/IntValue
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Manipulators/IntValue/NormalIntValueManipulator.cs
r8574 r8590 36 36 [StorableClass] 37 37 public class NormalIntValueManipulator : SingleSuccessorOperator, IIntValueManipulator, IStochasticOperator { 38 39 38 public ILookupParameter<IRandom> RandomParameter { 40 39 get { return (LookupParameter<IRandom>)Parameters["Random"]; } … … 59 58 public static void ApplyStatic(IRandom random, IntValue value, IntValueRange range) { 60 59 var strategy = new RealVector(new double[] { (range.UpperBound.Value - range.LowerBound.Value) / 10 }); 61 var vector = new RealVector( new double[] { value.Value });60 var vector = new RealVector(1); 62 61 int val = value.Value; 63 62 -
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Manipulators/IntValue/UniformIntValueManipulator.cs
r8574 r8590 36 36 [StorableClass] 37 37 public class UniformIntValueManipulator : SingleSuccessorOperator, IIntValueManipulator, IStochasticOperator { 38 39 38 public ILookupParameter<IRandom> RandomParameter { 40 39 get { return (LookupParameter<IRandom>)Parameters["Random"]; } … … 58 57 59 58 public static void ApplyStatic(IRandom random, IntValue value, IntValueRange range) { 60 var vector = new IntegerVector(new int[] { value.Value }); 59 var vector = new IntegerVector(1); 60 var bounds = new IntMatrix(1, 2); 61 bounds[0, 0] = range.LowerBound.Value; 62 bounds[0, 1] = range.UpperBound.Value; 61 63 int val = value.Value; 62 64 63 65 do { 64 66 vector[0] = val; 65 UniformOnePositionManipulator.Apply(random, vector, new IntMatrix(new int[,] { { range.LowerBound.Value, range.UpperBound.Value } }));67 UniformOnePositionManipulator.Apply(random, vector, bounds); 66 68 value.Value = vector[0]; 67 69 value.Value = range.ApplyStepSize(value.Value);
Note: See TracChangeset
for help on using the changeset viewer.