Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/06/12 14:45:59 (12 years ago)
Author:
jkarder
Message:

#1853:

  • added MultiDoubleValueCrossover
  • fixed bug in AverageDoubleValueCrossover
  • minor code improvements
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  
    3636  [StorableClass]
    3737  public class NormalIntValueManipulator : SingleSuccessorOperator, IIntValueManipulator, IStochasticOperator {
    38 
    3938    public ILookupParameter<IRandom> RandomParameter {
    4039      get { return (LookupParameter<IRandom>)Parameters["Random"]; }
     
    5958    public static void ApplyStatic(IRandom random, IntValue value, IntValueRange range) {
    6059      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);
    6261      int val = value.Value;
    6362
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Manipulators/IntValue/UniformIntValueManipulator.cs

    r8574 r8590  
    3636  [StorableClass]
    3737  public class UniformIntValueManipulator : SingleSuccessorOperator, IIntValueManipulator, IStochasticOperator {
    38 
    3938    public ILookupParameter<IRandom> RandomParameter {
    4039      get { return (LookupParameter<IRandom>)Parameters["Random"]; }
     
    5857
    5958    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;
    6163      int val = value.Value;
    6264
    6365      do {
    6466        vector[0] = val;
    65         UniformOnePositionManipulator.Apply(random, vector, new IntMatrix(new int[,] { { range.LowerBound.Value, range.UpperBound.Value } }));
     67        UniformOnePositionManipulator.Apply(random, vector, bounds);
    6668        value.Value = vector[0];
    6769        value.Value = range.ApplyStepSize(value.Value);
Note: See TracChangeset for help on using the changeset viewer.