Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/06/10 01:56:04 (14 years ago)
Author:
swagner
Message:

Merged cloning refactoring branch back into trunk (#922)

Location:
trunk/sources
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/BreederGeneticAlgorithmManipulator.cs

    r4068 r4722  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    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
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/MichalewiczNonUniformAllPositionsManipulator.cs

    r4068 r4722  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    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
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/MichalewiczNonUniformOnePositionManipulator.cs

    r4068 r4722  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    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
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/MultiRealVectorManipulator.cs

    r3674 r4722  
    2323using System.Linq;
    2424using HeuristicLab.Collections;
     25using HeuristicLab.Common;
    2526using HeuristicLab.Core;
    2627using HeuristicLab.Data;
     
    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
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/NormalAllPositionsManipulator.cs

    r4068 r4722  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Optimization;
     
    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
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/PolynomialAllPositionManipulator.cs

    r4068 r4722  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    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
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/PolynomialOnePositionManipulator.cs

    r4068 r4722  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    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
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/UniformOnePositionManipulator.cs

    r4068 r4722  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    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"/>.
Note: See TracChangeset for help on using the changeset viewer.