Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4672


Ignore:
Timestamp:
10/29/10 18:28:48 (14 years ago)
Author:
abeham
Message:

#922

  • Refactored HeuristicLab.Encodings.RealVectorEncoding
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  
    2626using HeuristicLab.Parameters;
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    4243    }
    4344
     45    [StorableConstructor]
     46    protected BoundsChecker(bool deserializing) : base(deserializing) { }
     47    protected BoundsChecker(BoundsChecker original, Cloner cloner) : base(original, cloner) { }
    4448    /// <summary>
    4549    /// Initializes a new instance of <see cref="BoundsChecker"/> with two parameters
     
    5054      Parameters.Add(new LookupParameter<RealVector>("RealVector", "The real-valued vector for which the bounds should be checked."));
    5155      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);
    5260    }
    5361
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Creators/UniformRandomRealVectorCreator.cs

    r4068 r4672  
    2525using HeuristicLab.Optimization;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    3334  [StorableClass]
    3435  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   
    3545    /// <summary>
    3646    /// 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  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    3435  [StorableClass]
    3536  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   
    3646    /// <summary>
    3747    /// Performs the average crossover (intermediate recombination) on a list of parents.
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/BlendAlphaBetaCrossover.cs

    r4068 r4672  
    2525using HeuristicLab.Parameters;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    6566    }
    6667
     68    [StorableConstructor]
     69    protected BlendAlphaBetaCrossover(bool deserializing) : base(deserializing) { }
     70    protected BlendAlphaBetaCrossover(BlendAlphaBetaCrossover original, Cloner cloner) : base(original, cloner) { }
    6771    /// <summary>
    6872    /// Initializes a new instance of <see cref="BlendAlphaBetaCrossover"/> with four additional parameters
     
    7579      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)));
    7680      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);
    7785    }
    7886
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/BlendAlphaCrossover.cs

    r4068 r4672  
    2525using HeuristicLab.Parameters;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    4849      get { return (ValueLookupParameter<DoubleValue>)Parameters["Alpha"]; }
    4950    }
     51
     52    [StorableConstructor]
     53    protected BlendAlphaCrossover(bool deserializing) : base(deserializing) { }
     54    protected BlendAlphaCrossover(BlendAlphaCrossover original, Cloner cloner) : base(original, cloner) { }
    5055    /// <summary>
    5156    /// Initializes a new instance of <see cref="BlendAlphaCrossover"/> with one parameter (<c>Alpha</c>).
     
    5459      : base() {
    5560      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);
    5665    }
    5766
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/DiscreteCrossover.cs

    r4068 r4672  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    3637  [StorableClass]
    3738  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   
    3848    /// <summary>
    3949    /// Performs a discrete crossover operation on multiple parents.
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/HeuristicCrossover.cs

    r4068 r4672  
    2525using HeuristicLab.Parameters;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    5051    }
    5152
     53    [StorableConstructor]
     54    protected HeuristicCrossover(bool deserializing) : base(deserializing) { }
     55    protected HeuristicCrossover(HeuristicCrossover original, Cloner cloner) : base(original, cloner) { }
    5256    /// <summary>
    5357    /// Initializes a new instance of <see cref="HeuristicCrossover"/> with two variable infos
     
    5862      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "Whether the problem is a maximization problem or not."));
    5963      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);
    6068    }
    6169
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/LocalCrossover.cs

    r4068 r4672  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    3435  [StorableClass]
    3536  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   
    3646    /// <summary>
    3747    /// Performs a local crossover on the two given parent vectors.
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/MultiRealVectorCrossover.cs

    r3674 r4672  
    3030using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3131using HeuristicLab.PluginInfrastructure;
     32using HeuristicLab.Common;
    3233
    3334namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    5354
    5455    [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    }
    5660    public MultiRealVectorCrossover()
    5761      : base() {
     
    6670          Operators.Add((IRealVectorCrossover)Activator.CreateInstance(type), true);
    6771      }
     72    }
     73
     74    public override IDeepCloneable Clone(Cloner cloner) {
     75      return new MultiRealVectorCrossover(this, cloner);
    6876    }
    6977
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/RandomConvexCrossover.cs

    r4068 r4672  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    3435  [StorableClass]
    3536  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   
    3646    /// <summary>
    3747    /// Performs a random convex crossover on the two given parents.
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/SimulatedBinaryCrossover.cs

    r4068 r4672  
    2525using HeuristicLab.Parameters;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    4445    }
    4546
     47    [StorableConstructor]
     48    protected SimulatedBinaryCrossover(bool deserializing) : base(deserializing) { }
     49    protected SimulatedBinaryCrossover(SimulatedBinaryCrossover original, Cloner cloner) : base(original, cloner) { }
    4650    /// <summary>
    4751    /// Initializes a new instance of <see cref="SimulatedBinaryCrossover"/> with one
     
    5155      : base() {
    5256      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);
    5361    }
    5462
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/SinglePointCrossover.cs

    r4068 r4672  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    3637  [StorableClass]
    3738  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   
    3848    /// <summary>
    3949    /// 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  
    2525using HeuristicLab.Parameters;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    4445    }
    4546
     47    [StorableConstructor]
     48    protected UniformAllPositionsArithmeticCrossover(bool deserializing) : base(deserializing) { }
     49    protected UniformAllPositionsArithmeticCrossover(UniformAllPositionsArithmeticCrossover original, Cloner cloner) : base(original, cloner) { }
    4650    /// <summary>
    4751    /// Initializes a new instance with one parameter (<c>Alpha</c>).
     
    5054      : base() {
    5155      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);
    5260    }
    5361
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/UniformSomePositionsArithmeticCrossover.cs

    r4068 r4672  
    2525using HeuristicLab.Parameters;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    5051    }
    5152
     53    [StorableConstructor]
     54    protected UniformSomePositionsArithmeticCrossover(bool deserializing) : base(deserializing) { }
     55    protected UniformSomePositionsArithmeticCrossover(UniformSomePositionsArithmeticCrossover original, Cloner cloner) : base(original, cloner) { }
    5256    /// <summary>
    5357    /// Initializes a new instance with two parameters (<c>Alpha</c> and <c>Probability</c>).
     
    5761      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)));
    5862      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);
    5967    }
    6068
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/BreederGeneticAlgorithmManipulator.cs

    r4068 r4672  
    2525using HeuristicLab.Parameters;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    4142      get { return (ValueLookupParameter<DoubleValue>)Parameters["SearchIntervalFactor"]; }
    4243    }
     44
     45    [StorableConstructor]
     46    protected BreederGeneticAlgorithmManipulator(bool deserializing) : base(deserializing) { }
     47    protected BreederGeneticAlgorithmManipulator(BreederGeneticAlgorithmManipulator original, Cloner cloner) : base(original, cloner) { }
    4348    /// <summary>
    4449    /// Initializes a new instance of <see cref="BreederGeneticAlgorithmManipulator"/> with two
     
    4853      : base() {
    4954      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);
    5059    }
    5160
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/MichalewiczNonUniformAllPositionsManipulator.cs

    r4068 r4672  
    2626using HeuristicLab.Parameters;
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    5758    }
    5859
     60    [StorableConstructor]
     61    protected MichalewiczNonUniformAllPositionsManipulator(bool deserializing) : base(deserializing) { }
     62    protected MichalewiczNonUniformAllPositionsManipulator(MichalewiczNonUniformAllPositionsManipulator original, Cloner cloner) : base(original, cloner) { }
    5963    /// <summary>
    6064    /// Initializes a new instance of <see cref="MichalewiczNonUniformAllPositionsManipulator"/> with three
     
    6670      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumIterations", "Maximum number of iterations"));
    6771      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);
    6876    }
    6977
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/MichalewiczNonUniformOnePositionManipulator.cs

    r4068 r4672  
    2626using HeuristicLab.Parameters;
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    5758    }
    5859
     60    [StorableConstructor]
     61    protected MichalewiczNonUniformOnePositionManipulator(bool deserializing) : base(deserializing) { }
     62    protected MichalewiczNonUniformOnePositionManipulator(MichalewiczNonUniformOnePositionManipulator original, Cloner cloner) : base(original, cloner) { }
    5963    /// <summary>
    6064    /// Initializes a new instance of <see cref="MichalewiczNonUniformOnePositionManipulator"/> with three
     
    6670      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumIterations", "Maximum number of iterations."));
    6771      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);
    6876    }
    6977
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/MultiRealVectorManipulator.cs

    r3674 r4672  
    3030using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3131using HeuristicLab.PluginInfrastructure;
     32using HeuristicLab.Common;
    3233
    3334namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    5051
    5152    [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) { }
    5355    public MultiRealVectorManipulator()
    5456      : base() {
     
    6062          Operators.Add((IRealVectorManipulator)Activator.CreateInstance(type), true);
    6163      }
     64    }
     65
     66    public override IDeepCloneable Clone(Cloner cloner) {
     67      return new MultiRealVectorManipulator(this, cloner);
    6268    }
    6369
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/NormalAllPositionsManipulator.cs

    r4068 r4672  
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2727using HeuristicLab.Random;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    5253      get { return StrategyParameterParameter; }
    5354    }
     55
     56    [StorableConstructor]
     57    protected NormalAllPositionsManipulator(bool deserializing) : base(deserializing) { }
     58    protected NormalAllPositionsManipulator(NormalAllPositionsManipulator original, Cloner cloner) : base(original, cloner) { }
    5459    /// <summary>
    5560    /// Initializes a new instance of <see cref="NormalAllPositionsManipulator"/> with one
     
    5964      : base() {
    6065      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);
    6170    }
    6271
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/PolynomialAllPositionManipulator.cs

    r4068 r4672  
    2525using HeuristicLab.Parameters;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    5455    }
    5556
     57    [StorableConstructor]
     58    protected PolynomialAllPositionManipulator(bool deserializing) : base(deserializing) { }
     59    protected PolynomialAllPositionManipulator(PolynomialAllPositionManipulator original, Cloner cloner) : base(original, cloner) { }
    5660    /// <summary>
    5761    /// Initializes a new instance of <see cref="PolynomialAllPositionManipulator"/> with two parameters
     
    6266      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)));
    6367      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);
    6472    }
    6573
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/PolynomialOnePositionManipulator.cs

    r4068 r4672  
    2525using HeuristicLab.Parameters;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    5354    }
    5455
     56    [StorableConstructor]
     57    protected PolynomialOnePositionManipulator(bool deserializing) : base(deserializing) { }
     58    protected PolynomialOnePositionManipulator(PolynomialOnePositionManipulator original, Cloner cloner) : base(original, cloner) { }
    5559    /// <summary>
    5660    /// Initializes a new instance of <see cref="PolynomialOnePositionManipulator"/> with two parameters
     
    6165      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)));
    6266      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);
    6371    }
    6472
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/UniformOnePositionManipulator.cs

    r4068 r4672  
    2424using HeuristicLab.Data;
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     26using HeuristicLab.Common;
    2627
    2728namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    3536  [StorableClass]
    3637  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   
    3747    /// <summary>
    3848    /// Changes randomly a single position in the given real <paramref name="vector"/>.
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMove.cs

    r3376 r4672  
    3535    public RealVector RealVector { get; protected set; }
    3636
    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);
    3945    }
    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) { }
    4548    public AdditiveMove(int dimension, double moveDistance, RealVector realVector)
    4649      : base() {
     
    5154
    5255    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);
    5957    }
    6058  }
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveGenerator.cs

    r4101 r4672  
    2626using HeuristicLab.Parameters;
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    5051    }
    5152
     53    [StorableConstructor]
     54    protected AdditiveMoveGenerator(bool deserializing) : base(deserializing) { }
     55    protected AdditiveMoveGenerator(AdditiveMoveGenerator original, Cloner cloner) : base(original, cloner) { }
    5256    public AdditiveMoveGenerator()
    5357      : base() {
     
    5761      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope where the moves should be added as subscopes."));
    5862      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);
    5967    }
    6068
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveMaker.cs

    r4068 r4672  
    2626using HeuristicLab.Parameters;
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    4748    }
    4849
     50    [StorableConstructor]
     51    protected AdditiveMoveMaker(bool deserializing) : base(deserializing) { }
     52    protected AdditiveMoveMaker(AdditiveMoveMaker original, Cloner cloner) : base(original, cloner) { }
    4953    public AdditiveMoveMaker()
    5054      : base() {
     
    5357      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The relative quality of the move."));
    5458      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);
    5563    }
    5664
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveTabuAttribute.cs

    r3376 r4672  
    3838
    3939    [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;
    4247    }
    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) { }
    5149    public AdditiveMoveTabuAttribute(int dimension, double originalPosition, double movedPosition, double moveQuality)
    5250      : base() {
     
    5856
    5957    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);
    6659    }
    6760  }
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveTabuChecker.cs

    r4068 r4672  
    2727using HeuristicLab.Parameters;
    2828using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     29using HeuristicLab.Common;
    2930
    3031namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    6263    }
    6364
    64 
     65    [StorableConstructor]
     66    protected AdditiveMoveTabuChecker(bool deserializing) : base(deserializing) { }
     67    protected AdditiveMoveTabuChecker(AdditiveMoveTabuChecker original, Cloner cloner) : base(original, cloner) { }
    6568    public AdditiveMoveTabuChecker()
    6669      : base() {
     
    7275      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, else if it is a minimization problem."));
    7376      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);
    7481    }
    7582
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveTabuMaker.cs

    r4068 r4672  
    2424using HeuristicLab.Parameters;
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     26using HeuristicLab.Common;
    2627
    2728namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    3637    }
    3738
     39    [StorableConstructor]
     40    protected AdditiveMoveTabuMaker(bool deserializing) : base(deserializing) { }
     41    protected AdditiveMoveTabuMaker(AdditiveMoveTabuMaker original, Cloner cloner) : base(original, cloner) { }
    3842    public AdditiveMoveTabuMaker()
    3943      : base() {
    4044      Parameters.Add(new LookupParameter<AdditiveMove>("AdditiveMove", "The move to evaluate."));
    4145      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);
    4250    }
    4351
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/StochasticNormalMultiMoveGenerator.cs

    r4068 r4672  
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2727using HeuristicLab.Random;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    3839    }
    3940
     41    [StorableConstructor]
     42    protected StochasticNormalMultiMoveGenerator(bool deserializing) : base(deserializing) { }
     43    protected StochasticNormalMultiMoveGenerator(StochasticNormalMultiMoveGenerator original, Cloner cloner) : base(original, cloner) { }
    4044    public StochasticNormalMultiMoveGenerator()
    4145      : base() {
    4246      Parameters.Add(new ValueLookupParameter<DoubleValue>("Sigma", "The standard deviation of the normal distribution.", new DoubleValue(1)));
    4347      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);
    4452    }
    4553
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/StochasticPolynomialMultiMoveGenerator.cs

    r4068 r4672  
    2525using HeuristicLab.Parameters;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    4748    }
    4849
     50    [StorableConstructor]
     51    protected StochasticPolynomialMultiMoveGenerator(bool deserializing) : base(deserializing) { }
     52    protected StochasticPolynomialMultiMoveGenerator(StochasticPolynomialMultiMoveGenerator original, Cloner cloner) : base(original, cloner) { }
    4953    public StochasticPolynomialMultiMoveGenerator()
    5054      : base() {
     
    5256      Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves that should be generated."));
    5357      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);
    5462    }
    5563
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVector.cs

    r3431 r4672  
    2929  [Item("RealVector", "Represents a vector of real values.")]
    3030  public class RealVector : DoubleArray {
     31    [StorableConstructor]
     32    protected RealVector(bool deserializing) : base(deserializing) { }
     33    protected RealVector(RealVector original, Cloner cloner) : base(original, cloner) { }
    3134    public RealVector() : base() { }
    3235    public RealVector(int length) : base(length) { }
     
    4346
    4447    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);
    4949    }
    5050
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorCreator.cs

    r4068 r4672  
    2626using HeuristicLab.Parameters;
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    5152    }
    5253
     54    [StorableConstructor]
     55    protected RealVectorCreator(bool deserializing) : base(deserializing) { }
     56    protected RealVectorCreator(RealVectorCreator original, Cloner cloner) : base(original, cloner) { }
    5357    protected RealVectorCreator()
    5458      : base() {
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorCrossover.cs

    r4068 r4672  
    2626using HeuristicLab.Parameters;
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    5152    }
    5253
     54    [StorableConstructor]
     55    protected RealVectorCrossover(bool deserializing) : base(deserializing) { }
     56    protected RealVectorCrossover(RealVectorCrossover original, Cloner cloner) : base(original, cloner) { }
    5357    protected RealVectorCrossover()
    5458      : base() {
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorManipulator.cs

    r4068 r4672  
    2626using HeuristicLab.Parameters;
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    4849    }
    4950
     51    [StorableConstructor]
     52    protected RealVectorManipulator(bool deserializing) : base(deserializing) { }
     53    protected RealVectorManipulator(RealVectorManipulator original, Cloner cloner) : base(original, cloner) { }
    5054    protected RealVectorManipulator()
    5155      : base() {
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/StrategyParameters/StdDevStrategyVectorCreator.cs

    r4068 r4672  
    2626using HeuristicLab.Parameters;
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    4748    }
    4849
     50    [StorableConstructor]
     51    protected StdDevStrategyVectorCreator(bool deserializing) : base(deserializing) { }
     52    protected StdDevStrategyVectorCreator(StdDevStrategyVectorCreator original, Cloner cloner) : base(original, cloner) { }
    4953    public StdDevStrategyVectorCreator()
    5054      : base() {
     
    5559    }
    5660
     61    public override IDeepCloneable Clone(Cloner cloner) {
     62      return new StdDevStrategyVectorCreator(this, cloner);
     63    }
     64
    5765    public override IOperation Apply() {
    5866      StrategyParameterParameter.ActualValue = UniformRandomRealVectorCreator.Apply(RandomParameter.ActualValue, LengthParameter.ActualValue.Value, BoundsParameter.ActualValue);
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/StrategyParameters/StdDevStrategyVectorCrossover.cs

    r4068 r4672  
    2525using HeuristicLab.Parameters;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    4344    }
    4445
     46    [StorableConstructor]
     47    protected StdDevStrategyVectorCrossover(bool deserializing) : base(deserializing) { }
     48    protected StdDevStrategyVectorCrossover(StdDevStrategyVectorCrossover original, Cloner cloner) : base(original, cloner) { }
    4549    public StdDevStrategyVectorCrossover()
    4650      : base() {
     
    5155    }
    5256
     57    public override IDeepCloneable Clone(Cloner cloner) {
     58      return new StdDevStrategyVectorCrossover(this, cloner);
     59    }
     60
    5361    public override IOperation Apply() {
    5462      StrategyParameterParameter.ActualValue = AverageCrossover.Apply(RandomParameter.ActualValue, ParentsParameter.ActualValue);
  • branches/CloningRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/StrategyParameters/StdDevStrategyVectorManipulator.cs

    r4545 r4672  
    2828using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2929using HeuristicLab.Random;
     30using HeuristicLab.Common;
    3031
    3132namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    5455      get { return (IValueLookupParameter<DoubleMatrix>)Parameters["Bounds"]; }
    5556    }
     57
     58    [StorableConstructor]
     59    protected StdDevStrategyVectorManipulator(bool deserializing) : base(deserializing) { }
     60    protected StdDevStrategyVectorManipulator(StdDevStrategyVectorManipulator original, Cloner cloner) : base(original, cloner) { }
    5661    /// <summary>
    5762    /// Initializes a new instance of <see cref="StrategyVectorManipulator"/> with four
     
    6671      Parameters.Add(new ValueLookupParameter<DoubleValue>("LearningRate", "The learning rate (tau)."));
    6772      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);
    6877    }
    6978
Note: See TracChangeset for help on using the changeset viewer.