Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/26/11 18:39:49 (14 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/StrategyParameters/StdDevStrategyVectorManipulator.cs

    r4722 r5381  
    8989      double generalMultiplier = Math.Exp(generalLearningRate * N.NextDouble());
    9090      for (int i = 0; i < vector.Length; i++) {
    91         vector[i] *= generalMultiplier * Math.Exp(learningRate * N.NextDouble());
     91        double change = vector[i] * generalMultiplier * Math.Exp(learningRate * N.NextDouble());
    9292        if (bounds != null) {
    9393          double min = bounds[i % bounds.Rows, 0], max = bounds[i % bounds.Rows, 1];
    94           if (vector[i] < min) vector[i] = min;
    95           if (vector[i] > max) vector[i] = max;
     94          if (min == max) vector[i] = min;
     95          else {
     96            while (change < min || change > max)
     97              change = vector[i] * generalMultiplier * Math.Exp(learningRate * N.NextDouble());
     98            vector[i] = change;
     99          }
    96100        }
    97101      }
Note: See TracChangeset for help on using the changeset viewer.