Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/22/10 17:03:29 (14 years ago)
Author:
abeham
Message:

Updated real vector to check bounds after each crossover and manipulation #890

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorManipulator.cs

    r3060 r3182  
    4444      get { return (ILookupParameter<RealVector>)Parameters["RealVector"]; }
    4545    }
     46    public IValueLookupParameter<DoubleMatrix> BoundsParameter {
     47      get { return (IValueLookupParameter<DoubleMatrix>)Parameters["Bounds"]; }
     48    }
    4649
    4750    protected RealVectorManipulator()
     
    4952      Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators."));
    5053      Parameters.Add(new LookupParameter<RealVector>("RealVector", "The vector which should be manipulated."));
     54      Parameters.Add(new ValueLookupParameter<DoubleMatrix>("Bounds", "The lower and upper bounds of the real vector."));
    5155    }
    5256
    5357    public sealed override IOperation Apply() {
    54       Manipulate(RandomParameter.ActualValue, RealVectorParameter.ActualValue);
     58      RealVector vector = RealVectorParameter.ActualValue;
     59      Manipulate(RandomParameter.ActualValue, vector);
     60      DoubleMatrix bounds = BoundsParameter.ActualValue;
     61      if (bounds != null) BoundsChecker.Apply(vector, bounds);
    5562      return base.Apply();
    5663    }
Note: See TracChangeset for help on using the changeset viewer.