Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/26/11 18:39:49 (13 years ago)
Author:
abeham
Message:

#1395

  • Allowed to select the bounds checker to use in all RealVectorManipulator and RealVectorCrossover operators
  • Added a second bounds checker, the ReflectiveBoundsChecker which does not cut at the bounds, but mirrors the vector at the bounds
  • Use a repeating strategy in the move generators
  • Removed obsolete IRealVectorPSODecoder and IRealVectorPSOEncoder interfaces
  • Marked RealVectorToRealVectorEncoder as obsolete, internal and removed all meaningful code from it (it slipped into the release and should be thrown out as soon as possible)
  • Use a repeating strategy to stick within the bounds in the StdDevStrategyVectorManipulator when manipulating the mutation strengths
  • By default use smaller initial bounds in the StdDevStrategyVectorCreator (parameterized by the problem)
File:
1 edited

Legend:

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

    r4722 r5381  
    6565    public override IOperation Apply() {
    6666      RealVector vector = RealVectorParameter.ActualValue;
    67       AdditiveMove[] moves = GenerateMoves(RandomParameter.ActualValue, vector);
    6867      DoubleMatrix bounds = BoundsParameter.ActualValue;
    69       if (bounds != null) {
    70         for (int i = 0; i < moves.Length; i++) {
    71           AdditiveMove move = moves[i];
    72           if (vector[move.Dimension] + move.MoveDistance < bounds[move.Dimension % bounds.Rows, 0])
    73             vector[move.Dimension] = bounds[move.Dimension % bounds.Rows, 0];
    74           else if (vector[move.Dimension] + move.MoveDistance > bounds[move.Dimension % bounds.Rows, 1])
    75             vector[move.Dimension] = bounds[move.Dimension % bounds.Rows, 1];
    76         }
    77       }
     68      AdditiveMove[] moves = GenerateMoves(RandomParameter.ActualValue, vector, bounds);
    7869      Scope[] moveScopes = new Scope[moves.Length];
    7970      for (int i = 0; i < moveScopes.Length; i++) {
     
    8576    }
    8677
    87     protected abstract AdditiveMove[] GenerateMoves(IRandom random, RealVector realVector);
     78    protected abstract AdditiveMove[] GenerateMoves(IRandom random, RealVector realVector, DoubleMatrix bounds);
    8879  }
    8980}
Note: See TracChangeset for help on using the changeset viewer.