- Timestamp:
- 04/13/10 18:32:07 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/NormalAllPositionsManipulator.cs
r3207 r3336 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Data; 25 using HeuristicLab.Optimization; 25 26 using HeuristicLab.Parameters; 26 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 38 39 [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.")] 39 40 [StorableClass] 40 public class NormalAllPositionsManipulator : RealVectorManipulator {41 public class NormalAllPositionsManipulator : RealVectorManipulator, IRealVectorStrategyParameterOperator, ISelfAdaptiveManipulator { 41 42 /// <summary> 42 43 /// Parameter for the strategy vector. 43 44 /// </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; } 46 51 } 47 52 /// <summary> … … 51 56 public NormalAllPositionsManipulator() 52 57 : base() { 53 Parameters.Add(new ValueLookupParameter<RealVector>("Strategy Vector", "The vector containing the endogenous strategy parameters."));58 Parameters.Add(new ValueLookupParameter<RealVector>("StrategyParameter", "The vector containing the endogenous strategy parameters.")); 54 59 } 55 60 … … 77 82 /// <param name="realVector">The vector of real values that is manipulated.</param> 78 83 protected override void Manipulate(IRandom random, RealVector realVector) { 79 if (Strategy VectorParameter.ActualValue == null) throw new InvalidOperationException("NormalAllPositionsManipulator: The strategy vectorparameter could not be found and does not have an associated value.");80 Apply(random, realVector, Strategy VectorParameter.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); 81 86 } 82 87 }
Note: See TracChangeset
for help on using the changeset viewer.