Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/13/10 18:32:07 (15 years ago)
Author:
abeham
Message:

updated Evolution Stratgy #932
StrategyParameters moved completely out of the ES into the encoding and problem, because they are inherently problem specific
The ProblemDimension and a few other parameters of ES were removed
Fixed a few bugs also and added some documentation

File:
1 edited

Legend:

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

    r3207 r3336  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Data;
     25using HeuristicLab.Optimization;
    2526using HeuristicLab.Parameters;
    2627using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3839  [Item("NormalAllPositionsManipulator", "This manipulation operator adds a value sigma_i * N(0,1) to the current value in each position i. The values for sigma_i are taken from the strategy vector, if there are less elements in the strategy vector than positions, then the strategy vector is cycled. It is implemented as described in Beyer, H.-G. and Schwefel, H.-P. 2002. Evolution Strategies - A Comprehensive Introduction Natural Computing, 1, pp. 3-52.")]
    3940  [StorableClass]
    40   public class NormalAllPositionsManipulator : RealVectorManipulator {
     41  public class NormalAllPositionsManipulator : RealVectorManipulator, IRealVectorStrategyParameterOperator, ISelfAdaptiveManipulator {
    4142    /// <summary>
    4243    /// Parameter for the strategy vector.
    4344    /// </summary>
    44     public ValueLookupParameter<RealVector> StrategyVectorParameter {
    45       get { return (ValueLookupParameter<RealVector>)Parameters["StrategyVector"]; }
     45    public IValueLookupParameter<RealVector> StrategyParameterParameter {
     46      get { return (IValueLookupParameter<RealVector>)Parameters["StrategyParameter"]; }
     47    }
     48
     49    IParameter ISelfAdaptiveManipulator.StrategyParameterParameter {
     50      get { return StrategyParameterParameter; }
    4651    }
    4752    /// <summary>
     
    5156    public NormalAllPositionsManipulator()
    5257      : base() {
    53       Parameters.Add(new ValueLookupParameter<RealVector>("StrategyVector", "The vector containing the endogenous strategy parameters."));
     58      Parameters.Add(new ValueLookupParameter<RealVector>("StrategyParameter", "The vector containing the endogenous strategy parameters."));
    5459    }
    5560
     
    7782    /// <param name="realVector">The vector of real values that is manipulated.</param>
    7883    protected override void Manipulate(IRandom random, RealVector realVector) {
    79       if (StrategyVectorParameter.ActualValue == null) throw new InvalidOperationException("NormalAllPositionsManipulator: The strategy vector parameter could not be found and does not have an associated value.");
    80       Apply(random, realVector, StrategyVectorParameter.ActualValue);
     84      if (StrategyParameterParameter.ActualValue == null) throw new InvalidOperationException("NormalAllPositionsManipulator: The strategy parameter could not be found and does not have an associated value.");
     85      Apply(random, realVector, StrategyParameterParameter.ActualValue);
    8186    }
    8287  }
Note: See TracChangeset for help on using the changeset viewer.