Changeset 4672
- Timestamp:
- 10/29/10 18:28:48 (14 years ago)
- Location:
- branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3
- Files:
-
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/BoundsChecker.cs
r4068 r4672 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 42 43 } 43 44 45 [StorableConstructor] 46 protected BoundsChecker(bool deserializing) : base(deserializing) { } 47 protected BoundsChecker(BoundsChecker original, Cloner cloner) : base(original, cloner) { } 44 48 /// <summary> 45 49 /// Initializes a new instance of <see cref="BoundsChecker"/> with two parameters … … 50 54 Parameters.Add(new LookupParameter<RealVector>("RealVector", "The real-valued vector for which the bounds should be checked.")); 51 55 Parameters.Add(new ValueLookupParameter<DoubleMatrix>("Bounds", "The lower and upper bound (1st and 2nd column) of the positions in the vector. If there are less rows than dimensions, the rows are cycled.")); 56 } 57 58 public override IDeepCloneable Clone(Cloner cloner) { 59 return new BoundsChecker(this, cloner); 52 60 } 53 61 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Creators/UniformRandomRealVectorCreator.cs
r4068 r4672 25 25 using HeuristicLab.Optimization; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 33 34 [StorableClass] 34 35 public class UniformRandomRealVectorCreator : RealVectorCreator, IStrategyParameterCreator { 36 [StorableConstructor] 37 protected UniformRandomRealVectorCreator(bool deserializing) : base(deserializing) { } 38 protected UniformRandomRealVectorCreator(UniformRandomRealVectorCreator original, Cloner cloner) : base(original, cloner) { } 39 public UniformRandomRealVectorCreator() : base() { } 40 41 public override IDeepCloneable Clone(Cloner cloner) { 42 return new UniformRandomRealVectorCreator(this, cloner); 43 } 44 35 45 /// <summary> 36 46 /// Generates a new random real vector with the given <paramref name="length"/> and in the interval [min,max). -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/AverageCrossover.cs
r4068 r4672 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 34 35 [StorableClass] 35 36 public class AverageCrossover : RealVectorCrossover { 37 [StorableConstructor] 38 protected AverageCrossover(bool deserializing) : base(deserializing) { } 39 protected AverageCrossover(AverageCrossover original, Cloner cloner) : base(original, cloner) { } 40 public AverageCrossover() : base() { } 41 42 public override IDeepCloneable Clone(Cloner cloner) { 43 return new AverageCrossover(this, cloner); 44 } 45 36 46 /// <summary> 37 47 /// Performs the average crossover (intermediate recombination) on a list of parents. -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/BlendAlphaBetaCrossover.cs
r4068 r4672 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 65 66 } 66 67 68 [StorableConstructor] 69 protected BlendAlphaBetaCrossover(bool deserializing) : base(deserializing) { } 70 protected BlendAlphaBetaCrossover(BlendAlphaBetaCrossover original, Cloner cloner) : base(original, cloner) { } 67 71 /// <summary> 68 72 /// Initializes a new instance of <see cref="BlendAlphaBetaCrossover"/> with four additional parameters … … 75 79 Parameters.Add(new ValueLookupParameter<DoubleValue>("Alpha", "The Alpha parameter controls the extension of the range beyond the better parent. The value must be >= 0 and does not depend on Beta.", new DoubleValue(0.75))); 76 80 Parameters.Add(new ValueLookupParameter<DoubleValue>("Beta", "The Beta parameter controls the extension of the range beyond the worse parent. The value must be >= 0 and does not depend on Alpha.", new DoubleValue(0.25))); 81 } 82 83 public override IDeepCloneable Clone(Cloner cloner) { 84 return new BlendAlphaBetaCrossover(this, cloner); 77 85 } 78 86 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/BlendAlphaCrossover.cs
r4068 r4672 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 48 49 get { return (ValueLookupParameter<DoubleValue>)Parameters["Alpha"]; } 49 50 } 51 52 [StorableConstructor] 53 protected BlendAlphaCrossover(bool deserializing) : base(deserializing) { } 54 protected BlendAlphaCrossover(BlendAlphaCrossover original, Cloner cloner) : base(original, cloner) { } 50 55 /// <summary> 51 56 /// Initializes a new instance of <see cref="BlendAlphaCrossover"/> with one parameter (<c>Alpha</c>). … … 54 59 : base() { 55 60 Parameters.Add(new ValueLookupParameter<DoubleValue>("Alpha", "The Alpha parameter controls the extension of the range beyond the two parents. It must be >= 0. A value of 0.5 means that half the range is added to both sides of the intervals.", new DoubleValue(0.5))); 61 } 62 63 public override IDeepCloneable Clone(Cloner cloner) { 64 return new BlendAlphaCrossover(this, cloner); 56 65 } 57 66 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/DiscreteCrossover.cs
r4068 r4672 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 36 37 [StorableClass] 37 38 public class DiscreteCrossover : RealVectorCrossover { 39 [StorableConstructor] 40 protected DiscreteCrossover(bool deserializing) : base(deserializing) { } 41 protected DiscreteCrossover(DiscreteCrossover original, Cloner cloner) : base(original, cloner) { } 42 public DiscreteCrossover() : base() { } 43 44 public override IDeepCloneable Clone(Cloner cloner) { 45 return new DiscreteCrossover(this, cloner); 46 } 47 38 48 /// <summary> 39 49 /// Performs a discrete crossover operation on multiple parents. -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/HeuristicCrossover.cs
r4068 r4672 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 50 51 } 51 52 53 [StorableConstructor] 54 protected HeuristicCrossover(bool deserializing) : base(deserializing) { } 55 protected HeuristicCrossover(HeuristicCrossover original, Cloner cloner) : base(original, cloner) { } 52 56 /// <summary> 53 57 /// Initializes a new instance of <see cref="HeuristicCrossover"/> with two variable infos … … 58 62 Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "Whether the problem is a maximization problem or not.")); 59 63 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The quality values of the parents.")); 64 } 65 66 public override IDeepCloneable Clone(Cloner cloner) { 67 return new HeuristicCrossover(this, cloner); 60 68 } 61 69 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/LocalCrossover.cs
r4068 r4672 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 34 35 [StorableClass] 35 36 public class LocalCrossover : RealVectorCrossover { 37 [StorableConstructor] 38 protected LocalCrossover(bool deserializing) : base(deserializing) { } 39 protected LocalCrossover(LocalCrossover original, Cloner cloner) : base(original, cloner) { } 40 public LocalCrossover() : base() { } 41 42 public override IDeepCloneable Clone(Cloner cloner) { 43 return new LocalCrossover(this, cloner); 44 } 45 36 46 /// <summary> 37 47 /// Performs a local crossover on the two given parent vectors. -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/MultiRealVectorCrossover.cs
r3674 r4672 30 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 31 using HeuristicLab.PluginInfrastructure; 32 using HeuristicLab.Common; 32 33 33 34 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 53 54 54 55 [StorableConstructor] 55 private MultiRealVectorCrossover(bool deserializing) : base(deserializing) { } 56 protected MultiRealVectorCrossover(bool deserializing) : base(deserializing) { } 57 protected MultiRealVectorCrossover(MultiRealVectorCrossover original, Cloner cloner) 58 : base(original, cloner) { 59 } 56 60 public MultiRealVectorCrossover() 57 61 : base() { … … 66 70 Operators.Add((IRealVectorCrossover)Activator.CreateInstance(type), true); 67 71 } 72 } 73 74 public override IDeepCloneable Clone(Cloner cloner) { 75 return new MultiRealVectorCrossover(this, cloner); 68 76 } 69 77 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/RandomConvexCrossover.cs
r4068 r4672 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 34 35 [StorableClass] 35 36 public class RandomConvexCrossover : RealVectorCrossover { 37 [StorableConstructor] 38 protected RandomConvexCrossover(bool deserializing) : base(deserializing) { } 39 protected RandomConvexCrossover(RandomConvexCrossover original, Cloner cloner) : base(original, cloner) { } 40 public RandomConvexCrossover() : base() { } 41 42 public override IDeepCloneable Clone(Cloner cloner) { 43 return new RandomConvexCrossover(this, cloner); 44 } 45 36 46 /// <summary> 37 47 /// Performs a random convex crossover on the two given parents. -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/SimulatedBinaryCrossover.cs
r4068 r4672 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 44 45 } 45 46 47 [StorableConstructor] 48 protected SimulatedBinaryCrossover(bool deserializing) : base(deserializing) { } 49 protected SimulatedBinaryCrossover(SimulatedBinaryCrossover original, Cloner cloner) : base(original, cloner) { } 46 50 /// <summary> 47 51 /// Initializes a new instance of <see cref="SimulatedBinaryCrossover"/> with one … … 51 55 : base() { 52 56 Parameters.Add(new ValueLookupParameter<DoubleValue>("Contiguity", "Specifies whether the crossover should produce very different (small value) or very similar (large value) children. Valid values must be greater or equal to 0.", new DoubleValue(2))); 57 } 58 59 public override IDeepCloneable Clone(Cloner cloner) { 60 return new SimulatedBinaryCrossover(this, cloner); 53 61 } 54 62 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/SinglePointCrossover.cs
r4068 r4672 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 36 37 [StorableClass] 37 38 public class SinglePointCrossover : RealVectorCrossover { 39 [StorableConstructor] 40 protected SinglePointCrossover(bool deserializing) : base(deserializing) { } 41 protected SinglePointCrossover(SinglePointCrossover original, Cloner cloner) : base(original, cloner) { } 42 public SinglePointCrossover() : base() { } 43 44 public override IDeepCloneable Clone(Cloner cloner) { 45 return new SinglePointCrossover(this, cloner); 46 } 47 38 48 /// <summary> 39 49 /// Performs the single point crossover for real vectors. The implementation is similar to the single point crossover for binary vectors. -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/UniformAllPositionsArithmeticCrossover.cs
r4068 r4672 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 44 45 } 45 46 47 [StorableConstructor] 48 protected UniformAllPositionsArithmeticCrossover(bool deserializing) : base(deserializing) { } 49 protected UniformAllPositionsArithmeticCrossover(UniformAllPositionsArithmeticCrossover original, Cloner cloner) : base(original, cloner) { } 46 50 /// <summary> 47 51 /// Initializes a new instance with one parameter (<c>Alpha</c>). … … 50 54 : base() { 51 55 Parameters.Add(new ValueLookupParameter<DoubleValue>("Alpha", "The alpha value in the range [0;1]", new DoubleValue(0.33))); 56 } 57 58 public override IDeepCloneable Clone(Cloner cloner) { 59 return new UniformAllPositionsArithmeticCrossover(this, cloner); 52 60 } 53 61 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/UniformSomePositionsArithmeticCrossover.cs
r4068 r4672 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 50 51 } 51 52 53 [StorableConstructor] 54 protected UniformSomePositionsArithmeticCrossover(bool deserializing) : base(deserializing) { } 55 protected UniformSomePositionsArithmeticCrossover(UniformSomePositionsArithmeticCrossover original, Cloner cloner) : base(original, cloner) { } 52 56 /// <summary> 53 57 /// Initializes a new instance with two parameters (<c>Alpha</c> and <c>Probability</c>). … … 57 61 Parameters.Add(new ValueLookupParameter<DoubleValue>("Alpha", "The alpha value in the range [0;1] that defines whether the point should be close to parent1 (=1) or parent2 (=0)", new DoubleValue(0.5))); 58 62 Parameters.Add(new ValueLookupParameter<DoubleValue>("Probability", "The probability for crossing a position in the range [0;1]", new DoubleValue(0.5))); 63 } 64 65 public override IDeepCloneable Clone(Cloner cloner) { 66 return new UniformSomePositionsArithmeticCrossover(this, cloner); 59 67 } 60 68 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/BreederGeneticAlgorithmManipulator.cs
r4068 r4672 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 41 42 get { return (ValueLookupParameter<DoubleValue>)Parameters["SearchIntervalFactor"]; } 42 43 } 44 45 [StorableConstructor] 46 protected BreederGeneticAlgorithmManipulator(bool deserializing) : base(deserializing) { } 47 protected BreederGeneticAlgorithmManipulator(BreederGeneticAlgorithmManipulator original, Cloner cloner) : base(original, cloner) { } 43 48 /// <summary> 44 49 /// Initializes a new instance of <see cref="BreederGeneticAlgorithmManipulator"/> with two … … 48 53 : base() { 49 54 Parameters.Add(new ValueLookupParameter<DoubleValue>("SearchIntervalFactor", "The factor determining the size of the search interval, that will be added/removed to/from the allele selected for manipulation. E.g. a value of 0.1 means 10% of the range will be maximally added/removed.", new DoubleValue(0.1))); 55 } 56 57 public override IDeepCloneable Clone(Cloner cloner) { 58 return new BreederGeneticAlgorithmManipulator(this, cloner); 50 59 } 51 60 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/MichalewiczNonUniformAllPositionsManipulator.cs
r4068 r4672 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 57 58 } 58 59 60 [StorableConstructor] 61 protected MichalewiczNonUniformAllPositionsManipulator(bool deserializing) : base(deserializing) { } 62 protected MichalewiczNonUniformAllPositionsManipulator(MichalewiczNonUniformAllPositionsManipulator original, Cloner cloner) : base(original, cloner) { } 59 63 /// <summary> 60 64 /// Initializes a new instance of <see cref="MichalewiczNonUniformAllPositionsManipulator"/> with three … … 66 70 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumIterations", "Maximum number of iterations")); 67 71 Parameters.Add(new ValueLookupParameter<DoubleValue>("IterationDependency", "Specifies the degree of dependency on the number of iterations. A value of 0 means no dependency and the higher the value the stronger the progress towards maximum iterations will be taken into account by sampling closer around the current position. Value must be >= 0.", new DoubleValue(5))); 72 } 73 74 public override IDeepCloneable Clone(Cloner cloner) { 75 return new MichalewiczNonUniformAllPositionsManipulator(this, cloner); 68 76 } 69 77 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/MichalewiczNonUniformOnePositionManipulator.cs
r4068 r4672 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 57 58 } 58 59 60 [StorableConstructor] 61 protected MichalewiczNonUniformOnePositionManipulator(bool deserializing) : base(deserializing) { } 62 protected MichalewiczNonUniformOnePositionManipulator(MichalewiczNonUniformOnePositionManipulator original, Cloner cloner) : base(original, cloner) { } 59 63 /// <summary> 60 64 /// Initializes a new instance of <see cref="MichalewiczNonUniformOnePositionManipulator"/> with three … … 66 70 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumIterations", "Maximum number of iterations.")); 67 71 Parameters.Add(new ValueLookupParameter<DoubleValue>("IterationDependency", "Specifies the degree of dependency on the number of iterations. A value of 0 means no dependency and the higher the value the stronger the progress towards maximum iterations will be taken into account by sampling closer around the current position. Value must be >= 0.", new DoubleValue(5))); 72 } 73 74 public override IDeepCloneable Clone(Cloner cloner) { 75 return new MichalewiczNonUniformOnePositionManipulator(this, cloner); 68 76 } 69 77 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/MultiRealVectorManipulator.cs
r3674 r4672 30 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 31 using HeuristicLab.PluginInfrastructure; 32 using HeuristicLab.Common; 32 33 33 34 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 50 51 51 52 [StorableConstructor] 52 private MultiRealVectorManipulator(bool deserializing) : base(deserializing) { } 53 protected MultiRealVectorManipulator(bool deserializing) : base(deserializing) { } 54 protected MultiRealVectorManipulator(MultiRealVectorManipulator original, Cloner cloner) : base(original, cloner) { } 53 55 public MultiRealVectorManipulator() 54 56 : base() { … … 60 62 Operators.Add((IRealVectorManipulator)Activator.CreateInstance(type), true); 61 63 } 64 } 65 66 public override IDeepCloneable Clone(Cloner cloner) { 67 return new MultiRealVectorManipulator(this, cloner); 62 68 } 63 69 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/NormalAllPositionsManipulator.cs
r4068 r4672 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 27 using HeuristicLab.Random; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 52 53 get { return StrategyParameterParameter; } 53 54 } 55 56 [StorableConstructor] 57 protected NormalAllPositionsManipulator(bool deserializing) : base(deserializing) { } 58 protected NormalAllPositionsManipulator(NormalAllPositionsManipulator original, Cloner cloner) : base(original, cloner) { } 54 59 /// <summary> 55 60 /// Initializes a new instance of <see cref="NormalAllPositionsManipulator"/> with one … … 59 64 : base() { 60 65 Parameters.Add(new ValueLookupParameter<RealVector>("StrategyParameter", "The vector containing the endogenous strategy parameters.")); 66 } 67 68 public override IDeepCloneable Clone(Cloner cloner) { 69 return new NormalAllPositionsManipulator(this, cloner); 61 70 } 62 71 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/PolynomialAllPositionManipulator.cs
r4068 r4672 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 54 55 } 55 56 57 [StorableConstructor] 58 protected PolynomialAllPositionManipulator(bool deserializing) : base(deserializing) { } 59 protected PolynomialAllPositionManipulator(PolynomialAllPositionManipulator original, Cloner cloner) : base(original, cloner) { } 56 60 /// <summary> 57 61 /// Initializes a new instance of <see cref="PolynomialAllPositionManipulator"/> with two parameters … … 62 66 Parameters.Add(new ValueLookupParameter<DoubleValue>("Contiguity", "Specifies whether the manipulation should produce far stretching (small value) or close (large value) manipulations with higher probability. Valid values must be greater or equal to 0.", new DoubleValue(2))); 63 67 Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumManipulation", "Specifies the maximum value that should be added or subtracted by the manipulation. If this value is set to 0 no mutation will be performed.", new DoubleValue(1))); 68 } 69 70 public override IDeepCloneable Clone(Cloner cloner) { 71 return new PolynomialAllPositionManipulator(this, cloner); 64 72 } 65 73 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/PolynomialOnePositionManipulator.cs
r4068 r4672 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 53 54 } 54 55 56 [StorableConstructor] 57 protected PolynomialOnePositionManipulator(bool deserializing) : base(deserializing) { } 58 protected PolynomialOnePositionManipulator(PolynomialOnePositionManipulator original, Cloner cloner) : base(original, cloner) { } 55 59 /// <summary> 56 60 /// Initializes a new instance of <see cref="PolynomialOnePositionManipulator"/> with two parameters … … 61 65 Parameters.Add(new ValueLookupParameter<DoubleValue>("Contiguity", "Specifies whether the manipulation should produce far stretching (small value) or close (large value) manipulations with higher probability. Valid values must be greater or equal to 0.", new DoubleValue(2))); 62 66 Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumManipulation", "Specifies the maximum value that should be added or subtracted by the manipulation. If this value is set to 0 no mutation will be performed.", new DoubleValue(1))); 67 } 68 69 public override IDeepCloneable Clone(Cloner cloner) { 70 return new PolynomialOnePositionManipulator(this, cloner); 63 71 } 64 72 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/UniformOnePositionManipulator.cs
r4068 r4672 24 24 using HeuristicLab.Data; 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HeuristicLab.Common; 26 27 27 28 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 35 36 [StorableClass] 36 37 public class UniformOnePositionManipulator : RealVectorManipulator { 38 [StorableConstructor] 39 protected UniformOnePositionManipulator(bool deserializing) : base(deserializing) { } 40 protected UniformOnePositionManipulator(UniformOnePositionManipulator original, Cloner cloner) : base(original, cloner) { } 41 public UniformOnePositionManipulator() : base() { } 42 43 public override IDeepCloneable Clone(Cloner cloner) { 44 return new UniformOnePositionManipulator(this, cloner); 45 } 46 37 47 /// <summary> 38 48 /// Changes randomly a single position in the given real <paramref name="vector"/>. -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMove.cs
r3376 r4672 35 35 public RealVector RealVector { get; protected set; } 36 36 37 public AdditiveMove() 38 : this(-1, 0, null) { 37 [StorableConstructor] 38 protected AdditiveMove(bool deserializing) : base(deserializing) { } 39 protected AdditiveMove(AdditiveMove original, Cloner cloner) 40 : base(original, cloner) { 41 this.Dimension = original.Dimension; 42 this.MoveDistance = original.MoveDistance; 43 if (original.RealVector != null) 44 this.RealVector = cloner.Clone(original.RealVector); 39 45 } 40 41 public AdditiveMove(int dimension, double moveDistance) 42 : this(dimension, moveDistance, null) { 43 } 44 46 public AdditiveMove() : this(-1, 0, null) { } 47 public AdditiveMove(int dimension, double moveDistance) : this(dimension, moveDistance, null) { } 45 48 public AdditiveMove(int dimension, double moveDistance, RealVector realVector) 46 49 : base() { … … 51 54 52 55 public override IDeepCloneable Clone(Cloner cloner) { 53 AdditiveMove clone = (AdditiveMove)base.Clone(cloner); 54 clone.Dimension = Dimension; 55 clone.MoveDistance = MoveDistance; 56 if (RealVector != null) 57 clone.RealVector = (RealVector)RealVector.Clone(cloner); 58 return clone; 56 return new AdditiveMove(this, cloner); 59 57 } 60 58 } -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveGenerator.cs
r4101 r4672 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 50 51 } 51 52 53 [StorableConstructor] 54 protected AdditiveMoveGenerator(bool deserializing) : base(deserializing) { } 55 protected AdditiveMoveGenerator(AdditiveMoveGenerator original, Cloner cloner) : base(original, cloner) { } 52 56 public AdditiveMoveGenerator() 53 57 : base() { … … 57 61 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope where the moves should be added as subscopes.")); 58 62 Parameters.Add(new ValueLookupParameter<DoubleMatrix>("Bounds", "A 2 column matrix specifying the lower and upper bound for each dimension. If there are less rows than dimension the bounds vector is cycled.")); 63 } 64 65 public override IDeepCloneable Clone(Cloner cloner) { 66 return new AdditiveMoveGenerator(this, cloner); 59 67 } 60 68 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveMaker.cs
r4068 r4672 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 47 48 } 48 49 50 [StorableConstructor] 51 protected AdditiveMoveMaker(bool deserializing) : base(deserializing) { } 52 protected AdditiveMoveMaker(AdditiveMoveMaker original, Cloner cloner) : base(original, cloner) { } 49 53 public AdditiveMoveMaker() 50 54 : base() { … … 53 57 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The relative quality of the move.")); 54 58 Parameters.Add(new LookupParameter<RealVector>("RealVector", "The solution as permutation.")); 59 } 60 61 public override IDeepCloneable Clone(Cloner cloner) { 62 return new AdditiveMoveMaker(this, cloner); 55 63 } 56 64 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveTabuAttribute.cs
r3376 r4672 38 38 39 39 [StorableConstructor] 40 private AdditiveMoveTabuAttribute(bool deserializing) 41 : base() { 40 protected AdditiveMoveTabuAttribute(bool deserializing) : base(deserializing) { } 41 protected AdditiveMoveTabuAttribute(AdditiveMoveTabuAttribute original, Cloner cloner) 42 : base(original, cloner) { 43 this.Dimension = original.Dimension; 44 this.OriginalPosition = original.OriginalPosition; 45 this.MovedPosition = original.MovedPosition; 46 this.MoveQuality = original.MoveQuality; 42 47 } 43 public AdditiveMoveTabuAttribute() 44 : base() { 45 Dimension = -1; 46 OriginalPosition = 0; 47 MovedPosition = 0; 48 MoveQuality = 0; 49 } 50 48 public AdditiveMoveTabuAttribute() : this(-1, 0, 0, 0) { } 51 49 public AdditiveMoveTabuAttribute(int dimension, double originalPosition, double movedPosition, double moveQuality) 52 50 : base() { … … 58 56 59 57 public override IDeepCloneable Clone(Cloner cloner) { 60 AdditiveMoveTabuAttribute clone = (AdditiveMoveTabuAttribute)base.Clone(cloner); 61 clone.Dimension = Dimension; 62 clone.OriginalPosition = OriginalPosition; 63 clone.MovedPosition = MovedPosition; 64 clone.MoveQuality = MoveQuality; 65 return clone; 58 return new AdditiveMoveTabuAttribute(this, cloner); 66 59 } 67 60 } -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveTabuChecker.cs
r4068 r4672 27 27 using HeuristicLab.Parameters; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.Common; 29 30 30 31 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 62 63 } 63 64 64 65 [StorableConstructor] 66 protected AdditiveMoveTabuChecker(bool deserializing) : base(deserializing) { } 67 protected AdditiveMoveTabuChecker(AdditiveMoveTabuChecker original, Cloner cloner) : base(original, cloner) { } 65 68 public AdditiveMoveTabuChecker() 66 69 : base() { … … 72 75 Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, else if it is a minimization problem.")); 73 76 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The quality of the current move.")); 77 } 78 79 public override IDeepCloneable Clone(Cloner cloner) { 80 return new AdditiveMoveTabuChecker(this, cloner); 74 81 } 75 82 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveTabuMaker.cs
r4068 r4672 24 24 using HeuristicLab.Parameters; 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HeuristicLab.Common; 26 27 27 28 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 36 37 } 37 38 39 [StorableConstructor] 40 protected AdditiveMoveTabuMaker(bool deserializing) : base(deserializing) { } 41 protected AdditiveMoveTabuMaker(AdditiveMoveTabuMaker original, Cloner cloner) : base(original, cloner) { } 38 42 public AdditiveMoveTabuMaker() 39 43 : base() { 40 44 Parameters.Add(new LookupParameter<AdditiveMove>("AdditiveMove", "The move to evaluate.")); 41 45 Parameters.Add(new LookupParameter<RealVector>("RealVector", "The solution as permutation.")); 46 } 47 48 public override IDeepCloneable Clone(Cloner cloner) { 49 return new AdditiveMoveTabuMaker(this, cloner); 42 50 } 43 51 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/StochasticNormalMultiMoveGenerator.cs
r4068 r4672 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 27 using HeuristicLab.Random; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 38 39 } 39 40 41 [StorableConstructor] 42 protected StochasticNormalMultiMoveGenerator(bool deserializing) : base(deserializing) { } 43 protected StochasticNormalMultiMoveGenerator(StochasticNormalMultiMoveGenerator original, Cloner cloner) : base(original, cloner) { } 40 44 public StochasticNormalMultiMoveGenerator() 41 45 : base() { 42 46 Parameters.Add(new ValueLookupParameter<DoubleValue>("Sigma", "The standard deviation of the normal distribution.", new DoubleValue(1))); 43 47 Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves that should be generated.")); 48 } 49 50 public override IDeepCloneable Clone(Cloner cloner) { 51 return new StochasticNormalMultiMoveGenerator(this, cloner); 44 52 } 45 53 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/StochasticPolynomialMultiMoveGenerator.cs
r4068 r4672 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 47 48 } 48 49 50 [StorableConstructor] 51 protected StochasticPolynomialMultiMoveGenerator(bool deserializing) : base(deserializing) { } 52 protected StochasticPolynomialMultiMoveGenerator(StochasticPolynomialMultiMoveGenerator original, Cloner cloner) : base(original, cloner) { } 49 53 public StochasticPolynomialMultiMoveGenerator() 50 54 : base() { … … 52 56 Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves that should be generated.")); 53 57 Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumManipulation", "Specifies the maximum value that should be added or subtracted by the manipulation. If this value is set to 0 no mutation will be performed.", new DoubleValue(1))); 58 } 59 60 public override IDeepCloneable Clone(Cloner cloner) { 61 return new StochasticPolynomialMultiMoveGenerator(this, cloner); 54 62 } 55 63 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVector.cs
r3431 r4672 29 29 [Item("RealVector", "Represents a vector of real values.")] 30 30 public class RealVector : DoubleArray { 31 [StorableConstructor] 32 protected RealVector(bool deserializing) : base(deserializing) { } 33 protected RealVector(RealVector original, Cloner cloner) : base(original, cloner) { } 31 34 public RealVector() : base() { } 32 35 public RealVector(int length) : base(length) { } … … 43 46 44 47 public override IDeepCloneable Clone(Cloner cloner) { 45 RealVector clone = new RealVector(array); 46 cloner.RegisterClonedObject(this, clone); 47 clone.readOnly = readOnly; 48 return clone; 48 return new RealVector(this, cloner); 49 49 } 50 50 -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorCreator.cs
r4068 r4672 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 51 52 } 52 53 54 [StorableConstructor] 55 protected RealVectorCreator(bool deserializing) : base(deserializing) { } 56 protected RealVectorCreator(RealVectorCreator original, Cloner cloner) : base(original, cloner) { } 53 57 protected RealVectorCreator() 54 58 : base() { -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorCrossover.cs
r4068 r4672 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 51 52 } 52 53 54 [StorableConstructor] 55 protected RealVectorCrossover(bool deserializing) : base(deserializing) { } 56 protected RealVectorCrossover(RealVectorCrossover original, Cloner cloner) : base(original, cloner) { } 53 57 protected RealVectorCrossover() 54 58 : base() { -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorManipulator.cs
r4068 r4672 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 48 49 } 49 50 51 [StorableConstructor] 52 protected RealVectorManipulator(bool deserializing) : base(deserializing) { } 53 protected RealVectorManipulator(RealVectorManipulator original, Cloner cloner) : base(original, cloner) { } 50 54 protected RealVectorManipulator() 51 55 : base() { -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/StrategyParameters/StdDevStrategyVectorCreator.cs
r4068 r4672 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 47 48 } 48 49 50 [StorableConstructor] 51 protected StdDevStrategyVectorCreator(bool deserializing) : base(deserializing) { } 52 protected StdDevStrategyVectorCreator(StdDevStrategyVectorCreator original, Cloner cloner) : base(original, cloner) { } 49 53 public StdDevStrategyVectorCreator() 50 54 : base() { … … 55 59 } 56 60 61 public override IDeepCloneable Clone(Cloner cloner) { 62 return new StdDevStrategyVectorCreator(this, cloner); 63 } 64 57 65 public override IOperation Apply() { 58 66 StrategyParameterParameter.ActualValue = UniformRandomRealVectorCreator.Apply(RandomParameter.ActualValue, LengthParameter.ActualValue.Value, BoundsParameter.ActualValue); -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/StrategyParameters/StdDevStrategyVectorCrossover.cs
r4068 r4672 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 43 44 } 44 45 46 [StorableConstructor] 47 protected StdDevStrategyVectorCrossover(bool deserializing) : base(deserializing) { } 48 protected StdDevStrategyVectorCrossover(StdDevStrategyVectorCrossover original, Cloner cloner) : base(original, cloner) { } 45 49 public StdDevStrategyVectorCrossover() 46 50 : base() { … … 51 55 } 52 56 57 public override IDeepCloneable Clone(Cloner cloner) { 58 return new StdDevStrategyVectorCrossover(this, cloner); 59 } 60 53 61 public override IOperation Apply() { 54 62 StrategyParameterParameter.ActualValue = AverageCrossover.Apply(RandomParameter.ActualValue, ParentsParameter.ActualValue); -
branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/StrategyParameters/StdDevStrategyVectorManipulator.cs
r4545 r4672 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 29 using HeuristicLab.Random; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Encodings.RealVectorEncoding { … … 54 55 get { return (IValueLookupParameter<DoubleMatrix>)Parameters["Bounds"]; } 55 56 } 57 58 [StorableConstructor] 59 protected StdDevStrategyVectorManipulator(bool deserializing) : base(deserializing) { } 60 protected StdDevStrategyVectorManipulator(StdDevStrategyVectorManipulator original, Cloner cloner) : base(original, cloner) { } 56 61 /// <summary> 57 62 /// Initializes a new instance of <see cref="StrategyVectorManipulator"/> with four … … 66 71 Parameters.Add(new ValueLookupParameter<DoubleValue>("LearningRate", "The learning rate (tau).")); 67 72 Parameters.Add(new ValueLookupParameter<DoubleMatrix>("Bounds", "A 2 column matrix specifying the lower and upper bound for each dimension. If there are less rows than dimension the bounds vector is cycled.", new DoubleMatrix(new double[,] { { 0, 5 } }))); 73 } 74 75 public override IDeepCloneable Clone(Cloner cloner) { 76 return new StdDevStrategyVectorManipulator(this, cloner); 68 77 } 69 78
Note: See TracChangeset
for help on using the changeset viewer.