Changeset 3336 for trunk/sources/HeuristicLab.Encodings.RealVectorEncoding
- Timestamp:
- 04/13/10 18:32:07 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3
- Files:
-
- 8 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Creators/UniformRandomRealVectorCreator.cs
r3160 r3336 34 34 [Item("UniformRandomRealVectorCreator", "An operator which creates a new random real vector with each element uniformly distributed in a specified range.")] 35 35 [StorableClass] 36 public class UniformRandomRealVectorCreator : RealVectorCreator {36 public class UniformRandomRealVectorCreator : RealVectorCreator, IStrategyParameterCreator { 37 37 /// <summary> 38 38 /// Generates a new random real vector with the given <paramref name="length"/> and in the interval [min,max). -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/HeuristicLab.Encodings.RealVectorEncoding-3.3.csproj
r3207 r3336 103 103 <Compile Include="Crossovers\UniformSomePositionsArithmeticCrossover.cs" /> 104 104 <Compile Include="HeuristicLabEncodingsRealVectorEncodingPlugin.cs" /> 105 <Compile Include="Interfaces\IRealVectorStrategyParameterManipulator.cs" /> 106 <Compile Include="Interfaces\IRealVectorStrategyParameterCrossover.cs" /> 107 <Compile Include="Interfaces\IRealVectorStrategyParameterCreator.cs" /> 108 <Compile Include="Interfaces\IRealVectorStrategyParameterOperator.cs" /> 105 109 <Compile Include="Interfaces\IAdditiveRealVectorMoveOperator.cs" /> 106 110 <Compile Include="Interfaces\IRealVectorBoundsChecker.cs" /> … … 108 112 <Compile Include="Interfaces\IRealVectorMoveOperator.cs" /> 109 113 <Compile Include="Manipulators\NormalAllPositionsManipulator.cs" /> 114 <Compile Include="StrategyParameters\StrategyVectorCreator.cs" /> 115 <Compile Include="StrategyParameters\StrategyVectorCrossover.cs" /> 116 <Compile Include="StrategyParameters\StrategyVectorManipulator.cs" /> 110 117 <Compile Include="Moves\AdditiveMoveTabuAttribute.cs" /> 111 118 <Compile Include="Moves\AdditiveTabuMoveEvaluator.cs" /> -
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.