Changeset 1180


Ignore:
Timestamp:
01/27/09 14:25:47 (12 years ago)
Author:
abeham
Message:

Changed the main ES mutation operator in RealVector to allow different lengths of the strategy vector (ticket #84)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.RealVector/SelfAdaptiveNormalAllPositionsManipulator.cs

    r99 r1180  
    4040    public static double[] Apply(double[] strategyParameters, IRandom random, double[] vector) {
    4141      NormalDistributedRandom N = new NormalDistributedRandom(random, 0.0, 1.0);
    42       if (strategyParameters.Length != vector.Length)
    43         throw new InvalidOperationException("ERROR: Strategy Vector must be as long as parameter vector");
    4442      for (int i = 0; i < vector.Length; i++) {
    45         vector[i] = vector[i] + (N.NextDouble() * strategyParameters[i]);
     43        vector[i] = vector[i] + (N.NextDouble() * strategyParameters[i % strategyParameters.Length]);
    4644      }
    4745      return vector;
Note: See TracChangeset for help on using the changeset viewer.