- Timestamp:
- 03/16/10 10:46:59 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/BreederGeneticAlgorithmManipulator.cs
r3053 r3060 66 66 /// <param name="max">The maximum number of the sampling range for the vector element (exclusive).</param> 67 67 /// <param name="searchIntervalFactor">The factor determining the size of the search interval.</param> 68 public static void Apply(IRandom random, DoubleArrayvector, DoubleValue min, DoubleValue max, DoubleValue searchIntervalFactor) {68 public static void Apply(IRandom random, RealVector vector, DoubleValue min, DoubleValue max, DoubleValue searchIntervalFactor) { 69 69 int length = vector.Length; 70 70 double prob, value; … … 114 114 115 115 /// <summary> 116 /// Checks the parameters Minimum, Maximum, and SearchIntervalFactor and forwards the call to <see cref="Apply(IRandom, DoubleArray, DoubleValue, DoubleValue, DoubleValue)"/>.116 /// Checks the parameters Minimum, Maximum, and SearchIntervalFactor and forwards the call to <see cref="Apply(IRandom, RealVector, DoubleValue, DoubleValue, DoubleValue)"/>. 117 117 /// </summary> 118 118 /// <param name="random">A random number generator.</param> 119 119 /// <param name="realVector">The real vector to manipulate.</param> 120 protected override void Manipulate(IRandom random, DoubleArrayrealVector) {120 protected override void Manipulate(IRandom random, RealVector realVector) { 121 121 if (MinimumParameter.ActualValue == null) throw new InvalidOperationException("BreederGeneticAlgorithmManipulator: Parameter " + MinimumParameter.ActualName + " could not be found."); 122 122 if (MaximumParameter.ActualValue == null) throw new InvalidOperationException("BreederGeneticAlgorithmManipulator: Paraemter " + MaximumParameter.ActualName + " could not be found."); -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/MichalewiczNonUniformAllPositionsManipulator.cs
r3053 r3060 95 95 /// <param name="generationsDependency">Specifies the degree of dependency on the number of generations.</param> 96 96 /// <returns>The manipulated real vector.</returns> 97 public static void Apply(IRandom random, DoubleArrayvector, DoubleValue min, DoubleValue max, IntValue currentGeneration, IntValue maximumGenerations, DoubleValue generationsDependency) {97 public static void Apply(IRandom random, RealVector vector, DoubleValue min, DoubleValue max, IntValue currentGeneration, IntValue maximumGenerations, DoubleValue generationsDependency) { 98 98 if (currentGeneration.Value > maximumGenerations.Value) throw new ArgumentException("MichalewiczNonUniformAllPositionManipulator: CurrentGeneration must be smaller or equal than MaximumGeneration", "currentGeneration"); 99 99 int length = vector.Length; … … 111 111 112 112 /// <summary> 113 /// Checks if all parameters are available and forwards the call to <see cref="Apply(IRandom, DoubleArray, DoubleValue, DoubleValue, IntValue, IntValue, DoubleValue)"/>.113 /// Checks if all parameters are available and forwards the call to <see cref="Apply(IRandom, RealVector, DoubleValue, DoubleValue, IntValue, IntValue, DoubleValue)"/>. 114 114 /// </summary> 115 115 /// <param name="random">The random number generator.</param> 116 116 /// <param name="realVector">The real vector that should be manipulated.</param> 117 protected override void Manipulate(IRandom random, DoubleArrayrealVector) {117 protected override void Manipulate(IRandom random, RealVector realVector) { 118 118 if (MinimumParameter.ActualValue == null) throw new InvalidOperationException("MichalewiczNonUniformAllPositionManipulator: Parameter " + MinimumParameter.ActualName + " could not be found."); 119 119 if (MaximumParameter.ActualValue == null) throw new InvalidOperationException("MichalewiczNonUniformAllPositionManipulator: Parameter " + MaximumParameter.ActualName + " could not be found."); -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/MichalewiczNonUniformOnePositionManipulator.cs
r3053 r3060 95 95 /// <param name="generationsDependency">Specifies the degree of dependency on the number of generations.</param> 96 96 /// <returns>The manipulated real vector.</returns> 97 public static void Apply(IRandom random, DoubleArrayvector, DoubleValue min, DoubleValue max, IntValue currentGeneration, IntValue maximumGenerations, DoubleValue generationsDependency) {97 public static void Apply(IRandom random, RealVector vector, DoubleValue min, DoubleValue max, IntValue currentGeneration, IntValue maximumGenerations, DoubleValue generationsDependency) { 98 98 if (currentGeneration.Value > maximumGenerations.Value) throw new ArgumentException("MichalewiczNonUniformOnePositionManipulator: CurrentGeneration must be smaller or equal than MaximumGeneration", "currentGeneration"); 99 99 int length = vector.Length; … … 110 110 111 111 /// <summary> 112 /// Checks if all parameters are available and forwards the call to <see cref="Apply(IRandom, DoubleArray, DoubleValue, DoubleValue, IntValue, IntValue, DoubleValue)"/>.112 /// Checks if all parameters are available and forwards the call to <see cref="Apply(IRandom, RealVector, DoubleValue, DoubleValue, IntValue, IntValue, DoubleValue)"/>. 113 113 /// </summary> 114 114 /// <param name="random">The random number generator.</param> 115 115 /// <param name="realVector">The real vector that should be manipulated.</param> 116 protected override void Manipulate(IRandom random, DoubleArrayrealVector) {116 protected override void Manipulate(IRandom random, RealVector realVector) { 117 117 if (MinimumParameter.ActualValue == null) throw new InvalidOperationException("MichalewiczNonUniformOnePositionManipulator: Parameter " + MinimumParameter.ActualName + " could not be found."); 118 118 if (MaximumParameter.ActualValue == null) throw new InvalidOperationException("MichalewiczNonUniformOnePositionManipulator: Parameter " + MaximumParameter.ActualName + " could not be found."); -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/PolynomialAllPositionManipulator.cs
r3053 r3060 71 71 /// <param name="contiguity">A parameter describing the shape of the probability density function which influences the strength of the manipulation.</param> 72 72 /// <param name="maxManipulation">The maximum strength of the manipulation.</param> 73 public static void Apply(IRandom random, DoubleArrayvector, DoubleValue contiguity, DoubleValue maxManipulation) {73 public static void Apply(IRandom random, RealVector vector, DoubleValue contiguity, DoubleValue maxManipulation) { 74 74 if (contiguity.Value < 0) throw new ArgumentException("PolynomialAllPositionManipulator: Contiguity value is smaller than 0", "contiguity"); 75 75 double u, delta = 0; … … 88 88 89 89 /// <summary> 90 /// Checks the availability of the parameters and forwards the call to <see cref="Apply(IRandom, DoubleArray, DoubleValue, DoubleValue)"/>.90 /// Checks the availability of the parameters and forwards the call to <see cref="Apply(IRandom, RealVector, DoubleValue, DoubleValue)"/>. 91 91 /// </summary> 92 92 /// <param name="random">The random number generator to use.</param> 93 93 /// <param name="realVector">The vector of real values to manipulate.</param> 94 protected override void Manipulate(IRandom random, DoubleArrayrealVector) {94 protected override void Manipulate(IRandom random, RealVector realVector) { 95 95 if (ContiguityParameter.ActualValue == null) throw new InvalidOperationException("PolynomialAllPositionManipulator: Parameter " + ContiguityParameter.ActualName + " could not be found."); 96 96 if (MaximumManipulationParameter.ActualValue == null) throw new InvalidOperationException("PolynomialAllPositionManipulator: Parameter " + MaximumManipulationParameter.ActualName + " could not be found."); -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/PolynomialOnePositionManipulator.cs
r3053 r3060 70 70 /// <param name="contiguity">A parameter describing the shape of the probability density function which influences the strength of the manipulation.</param> 71 71 /// <param name="maxManipulation">The maximum strength of the manipulation.</param> 72 public static void Apply(IRandom random, DoubleArrayvector, DoubleValue contiguity, DoubleValue maxManipulation) {72 public static void Apply(IRandom random, RealVector vector, DoubleValue contiguity, DoubleValue maxManipulation) { 73 73 if (contiguity.Value < 0) throw new ArgumentException("PolynomialOnePositionManipulator: Contiguity value is smaller than 0", "contiguity"); 74 74 int index = random.Next(vector.Length); … … 85 85 86 86 /// <summary> 87 /// Checks the availability of the parameters and forwards the call to <see cref="Apply(IRandom, DoubleArray, DoubleValue, DoubleValue)"/>.87 /// Checks the availability of the parameters and forwards the call to <see cref="Apply(IRandom, RealVector, DoubleValue, DoubleValue)"/>. 88 88 /// </summary> 89 89 /// <param name="random">The random number generator to use.</param> 90 90 /// <param name="realVector">The vector of real values to manipulate.</param> 91 protected override void Manipulate(IRandom random, DoubleArrayrealVector) {91 protected override void Manipulate(IRandom random, RealVector realVector) { 92 92 if (ContiguityParameter.ActualValue == null) throw new InvalidOperationException("PolynomialOnePositionManipulator: Parameter " + ContiguityParameter.ActualName + " could not be found."); 93 93 if (MaximumManipulationParameter.ActualValue == null) throw new InvalidOperationException("PolynomialOnePositionManipulator: Parameter " + MaximumManipulationParameter.ActualName + " could not be found."); -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/SelfAdaptiveNormalAllPositionsManipulator.cs
r3053 r3060 42 42 /// Parameter for the strategy vector. 43 43 /// </summary> 44 public LookupParameter< DoubleArray> StrategyVectorParameter {45 get { return (LookupParameter< DoubleArray>)Parameters["StrategyVector"]; }44 public LookupParameter<RealVector> StrategyVectorParameter { 45 get { return (LookupParameter<RealVector>)Parameters["StrategyVector"]; } 46 46 } 47 47 /// <summary> … … 51 51 public SelfAdaptiveNormalAllPositionsManipulator() 52 52 : base() { 53 Parameters.Add(new LookupParameter< DoubleArray>("StrategyVector", "The vector containing the endogenous strategy parameters."));53 Parameters.Add(new LookupParameter<RealVector>("StrategyVector", "The vector containing the endogenous strategy parameters.")); 54 54 } 55 55 … … 64 64 /// <param name="vector">The real vector to manipulate.</param> 65 65 /// <returns>The manipulated real vector.</returns> 66 public static void Apply(IRandom random, DoubleArray vector, DoubleArraystrategyParameters) {66 public static void Apply(IRandom random, RealVector vector, RealVector strategyParameters) { 67 67 NormalDistributedRandom N = new NormalDistributedRandom(random, 0.0, 1.0); 68 68 for (int i = 0; i < vector.Length; i++) { … … 72 72 73 73 /// <summary> 74 /// Checks that the strategy vector is not null and forwards the call to <see cref="Apply(IRandom, DoubleArray, DoubleArray)"/>.74 /// Checks that the strategy vector is not null and forwards the call to <see cref="Apply(IRandom, RealVector, RealVector)"/>. 75 75 /// </summary> 76 76 /// <param name="random">The random number generator.</param> 77 77 /// <param name="realVector">The vector of real values that is manipulated.</param> 78 protected override void Manipulate(IRandom random, DoubleArrayrealVector) {78 protected override void Manipulate(IRandom random, RealVector realVector) { 79 79 if (StrategyVectorParameter.ActualValue == null) throw new InvalidOperationException("SelfAdaptiveNormalAllPositionsManipulator: Parameter " + StrategyVectorParameter.ActualName + " could not be found."); 80 80 Apply(random, realVector, StrategyVectorParameter.ActualValue); -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/UniformOnePositionManipulator.cs
r3053 r3060 67 67 /// <param name="max">The maximum value of the sampling range for 68 68 /// the vector element to change (exclusive).</param> 69 public static void Apply(IRandom random, DoubleArrayvector, DoubleValue min, DoubleValue max) {69 public static void Apply(IRandom random, RealVector vector, DoubleValue min, DoubleValue max) { 70 70 int index = random.Next(vector.Length); 71 71 vector[index] = min.Value + random.NextDouble() * (max.Value - min.Value); … … 73 73 74 74 /// <summary> 75 /// Checks if the minimum and maximum parameters are available and forwards the call to <see cref="Apply(IRandom, DoubleArray, DoubleValue, DoubleValue)"/>.75 /// Checks if the minimum and maximum parameters are available and forwards the call to <see cref="Apply(IRandom, RealVector, DoubleValue, DoubleValue)"/>. 76 76 /// </summary> 77 77 /// <param name="random">The random number generator to use.</param> 78 78 /// <param name="realVector">The real vector to manipulate.</param> 79 protected override void Manipulate(IRandom random, DoubleArrayrealVector) {79 protected override void Manipulate(IRandom random, RealVector realVector) { 80 80 if (MinimumParameter.ActualValue == null) throw new InvalidOperationException("UniformOnePositionManipulator: Parameter " + MinimumParameter.ActualName + " could not be found."); 81 81 if (MaximumParameter.ActualValue == null) throw new InvalidOperationException("UniformOnePositionManipulator: Parameter " + MaximumParameter.ActualName + " could not be found.");
Note: See TracChangeset
for help on using the changeset viewer.