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:
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/PermutationMoveAttribute.cs

    r3376 r4722  
    3131    public double MoveQuality { get; protected set; }
    3232
    33     public PermutationMoveAttribute()
    34       : base() {
    35       MoveQuality = 0;
     33    [StorableConstructor]
     34    protected PermutationMoveAttribute(bool deserializing) : base(deserializing) { }
     35    protected PermutationMoveAttribute(PermutationMoveAttribute original, Cloner cloner)
     36      : base(original, cloner) {
     37      this.MoveQuality = original.MoveQuality;
    3638    }
    37 
     39    public PermutationMoveAttribute() : this(0) { }
    3840    public PermutationMoveAttribute(double moveQuality)
    3941      : base() {
     
    4244
    4345    public override IDeepCloneable Clone(Cloner cloner) {
    44       PermutationMoveAttribute clone = (PermutationMoveAttribute)base.Clone(cloner);
    45       clone.MoveQuality = MoveQuality;
    46       return clone;
     46      return new PermutationMoveAttribute(this, cloner);
    4747    }
    4848  }
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeIndexMove.cs

    r3376 r4722  
    3737    public Permutation Permutation { get; protected set; }
    3838
    39     public ThreeIndexMove()
    40       : base() {
    41       Index1 = -1;
    42       Index2 = -1;
    43       Index3 = -1;
    44       Permutation = null;
     39    [StorableConstructor]
     40    protected ThreeIndexMove(bool deserializing) : base(deserializing) { }
     41    protected ThreeIndexMove(ThreeIndexMove original, Cloner cloner)
     42      : base(original, cloner) {
     43      this.Index1 = original.Index1;
     44      this.Index2 = original.Index2;
     45      this.Index3 = original.Index3;
     46      if (original.Permutation != null)
     47        this.Permutation = cloner.Clone(original.Permutation);
    4548    }
    46 
     49    public ThreeIndexMove() : this(-1, -1, -1, null) { }
    4750    public ThreeIndexMove(int index1, int index2, int index3, Permutation permutation)
    4851      : base() {
     
    5457
    5558    public override IDeepCloneable Clone(Cloner cloner) {
    56       ThreeIndexMove clone = (ThreeIndexMove)base.Clone(cloner);
    57       clone.Index1 = Index1;
    58       clone.Index2 = Index2;
    59       clone.Index3 = Index3;
    60       if (Permutation != null)
    61         clone.Permutation = (Permutation)Permutation.Clone(cloner);
    62       return clone;
     59      return new ThreeIndexMove(this, cloner);
    6360    }
    6461  }
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/ExhaustiveInsertionMoveGenerator.cs

    r4068 r4722  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Optimization;
     
    2930  [StorableClass]
    3031  public class ExhaustiveInsertionMoveGenerator : TranslocationMoveGenerator, IExhaustiveMoveGenerator {
     32    [StorableConstructor]
     33    protected ExhaustiveInsertionMoveGenerator(bool deserializing) : base(deserializing) { }
     34    protected ExhaustiveInsertionMoveGenerator(ExhaustiveInsertionMoveGenerator original, Cloner cloner) : base(original, cloner) { }
     35    public ExhaustiveInsertionMoveGenerator() : base() { }
     36
     37    public override IDeepCloneable Clone(Cloner cloner) {
     38      return new ExhaustiveInsertionMoveGenerator(this, cloner);
     39    }
     40
    3141    public static TranslocationMove[] Apply(Permutation permutation) {
    3242      int length = permutation.Length;
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/StochasticSingleInsertionMoveGenerator.cs

    r4068 r4722  
    2222using System;
    2323using System.Collections.Generic;
     24using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Data;
     
    4445    }
    4546
    46     public StochasticInsertionMultiMoveGenerator() {
     47    [StorableConstructor]
     48    protected StochasticInsertionMultiMoveGenerator(bool deserializing) : base(deserializing) { }
     49    protected StochasticInsertionMultiMoveGenerator(StochasticInsertionMultiMoveGenerator original, Cloner cloner) : base(original, cloner) { }
     50    public StochasticInsertionMultiMoveGenerator() : base() {
    4751      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));
    4852      Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves to generate."));
     53    }
     54
     55    public override IDeepCloneable Clone(Cloner cloner) {
     56      return new StochasticInsertionMultiMoveGenerator(this, cloner);
    4957    }
    5058
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/StochasticTranslocationMultiMoveGenerator.cs

    r4068 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Data;
     
    4243    }
    4344
    44     public StochasticTranslocationMultiMoveGenerator()
    45       : base() {
     45    [StorableConstructor]
     46    protected StochasticTranslocationMultiMoveGenerator(bool deserializing) : base(deserializing) { }
     47    protected StochasticTranslocationMultiMoveGenerator(StochasticTranslocationMultiMoveGenerator original, Cloner cloner) : base(original, cloner) { }
     48    public StochasticTranslocationMultiMoveGenerator() : base() {
    4649      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator."));
    4750      Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves to generate."));
     51    }
     52
     53    public override IDeepCloneable Clone(Cloner cloner) {
     54      return new StochasticTranslocationMultiMoveGenerator(this, cloner);
    4855    }
    4956
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/StochasticTranslocationSingleMoveGenerator.cs

    r4068 r4722  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Optimization;
     
    3435    }
    3536
     37    [StorableConstructor]
     38    protected StochasticTranslocationSingleMoveGenerator(bool deserializing) : base(deserializing) { }
     39    protected StochasticTranslocationSingleMoveGenerator(StochasticTranslocationSingleMoveGenerator original, Cloner cloner) : base(original, cloner) { }
    3640    public StochasticTranslocationSingleMoveGenerator()
    3741      : base() {
    3842      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator."));
     43    }
     44
     45    public override IDeepCloneable Clone(Cloner cloner) {
     46      return new StochasticTranslocationSingleMoveGenerator(this, cloner);
    3947    }
    4048
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMove.cs

    r4068 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    2728  [StorableClass]
    2829  public class TranslocationMove : ThreeIndexMove {
    29     public TranslocationMove()
    30       : base() {
    31     }
     30    [StorableConstructor]
     31    protected TranslocationMove(bool deserializing) : base(deserializing) { }
     32    protected TranslocationMove(TranslocationMove original, Cloner cloner) : base(original, cloner) { }
     33    public TranslocationMove() : base() { }
     34    public TranslocationMove(int index1, int index2, int index3) : base(index1, index2, index3, null) { }
     35    public TranslocationMove(int index1, int index2, int index3, Permutation permutation) : base(index1, index2, index3, permutation) { }
    3236
    33     public TranslocationMove(int index1, int index2, int index3)
    34       : base(index1, index2, index3, null) {
    35     }
    36 
    37     public TranslocationMove(int index1, int index2, int index3, Permutation permutation)
    38       : base(index1, index2, index3, permutation) {
     37    public override IDeepCloneable Clone(Cloner cloner) {
     38      return new TranslocationMove(this, cloner);
    3939    }
    4040  }
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveAbsoluteAttribute.cs

    r3376 r4722  
    3636
    3737    [StorableConstructor]
    38     private TranslocationMoveAbsoluteAttribute(bool deserializing)
    39       : base() {
     38    protected TranslocationMoveAbsoluteAttribute(bool deserializing) : base(deserializing) { }
     39    protected TranslocationMoveAbsoluteAttribute(TranslocationMoveAbsoluteAttribute original, Cloner cloner)
     40      : base(original, cloner) {
     41      this.Number = (int[])original.Number.Clone();
     42      this.OldPosition = original.OldPosition;
     43      this.NewPosition = original.NewPosition;
    4044    }
    41 
    42     public TranslocationMoveAbsoluteAttribute()
    43       : this(null, -1, -1, -1) { }
    44 
    4545    public TranslocationMoveAbsoluteAttribute(int[] number, int oldPosition, int newPosition, double moveQuality)
    4646      : base(moveQuality) {
     
    5151
    5252    public override IDeepCloneable Clone(Cloner cloner) {
    53       TranslocationMoveAbsoluteAttribute clone = (TranslocationMoveAbsoluteAttribute)base.Clone(cloner);
    54       clone.Number = Number;
    55       clone.OldPosition = OldPosition;
    56       clone.NewPosition = NewPosition;
    57       return clone;
     53      return new TranslocationMoveAbsoluteAttribute(this, cloner);
    5854    }
    5955  }
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveGenerator.cs

    r4068 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Operators;
     
    4344    }
    4445
     46    [StorableConstructor]
     47    protected TranslocationMoveGenerator(bool deserializing) : base(deserializing) { }
     48    protected TranslocationMoveGenerator(TranslocationMoveGenerator original, Cloner cloner) : base(original, cloner) { }
    4549    public TranslocationMoveGenerator()
    4650      : base() {
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveHardTabuCriterion.cs

    r4068 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Data;
     
    6465    }
    6566
     67    [StorableConstructor]
     68    protected TranslocationMoveHardTabuCriterion(bool deserializing) : base(deserializing) { }
     69    protected TranslocationMoveHardTabuCriterion(TranslocationMoveHardTabuCriterion original, Cloner cloner) : base(original, cloner) { }
    6670    public TranslocationMoveHardTabuCriterion()
    6771      : base() {
     
    7377      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, else if it is a minimization problem."));
    7478      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The quality of the current move."));
     79    }
     80
     81    public override IDeepCloneable Clone(Cloner cloner) {
     82      return new TranslocationMoveHardTabuCriterion(this, cloner);
    7583    }
    7684
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveMaker.cs

    r4068 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Data;
     
    4748    }
    4849
     50    [StorableConstructor]
     51    protected TranslocationMoveMaker(bool deserializing) : base(deserializing) { }
     52    protected TranslocationMoveMaker(TranslocationMoveMaker original, Cloner cloner) : base(original, cloner) { }
    4953    public TranslocationMoveMaker()
    5054      : base() {
     
    5357      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The relative quality of the move."));
    5458      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation."));
     59    }
     60
     61    public override IDeepCloneable Clone(Cloner cloner) {
     62      return new TranslocationMoveMaker(this, cloner);
    5563    }
    5664
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveRelativeAttribute.cs

    r3376 r4722  
    4242
    4343    [StorableConstructor]
    44     private TranslocationMoveRelativeAttribute(bool deserializing)
    45       : base() {
     44    protected TranslocationMoveRelativeAttribute(bool deserializing) : base(deserializing) { }
     45    protected TranslocationMoveRelativeAttribute(TranslocationMoveRelativeAttribute original, Cloner cloner)
     46      : base(original, cloner) {
     47      this.Edge1Source = original.Edge1Source;
     48      this.Edge1Target = original.Edge1Target;
     49      this.Edge2Source = original.Edge2Source;
     50      this.Edge2Target = original.Edge2Target;
     51      this.Edge3Source = original.Edge3Source;
     52      this.Edge3Target = original.Edge3Target;
    4653    }
    47 
    48     public TranslocationMoveRelativeAttribute()
    49       : this(-1, -1, -1, -1, -1, -1, -1) { }
    50 
     54    public TranslocationMoveRelativeAttribute() : this(-1, -1, -1, -1, -1, -1, -1) { }
    5155    public TranslocationMoveRelativeAttribute(int edge1Source, int edge1Target, int edge2Source, int edge2Target, int edge3Source, int edge3Target, double moveQuality)
    5256      : base(moveQuality) {
     
    6064
    6165    public override IDeepCloneable Clone(Cloner cloner) {
    62       TranslocationMoveRelativeAttribute clone = (TranslocationMoveRelativeAttribute)base.Clone(cloner);
    63       clone.Edge1Source = Edge1Source;
    64       clone.Edge1Target = Edge1Target;
    65       clone.Edge2Source = Edge2Source;
    66       clone.Edge2Target = Edge2Target;
    67       clone.Edge3Source = Edge3Source;
    68       clone.Edge3Target = Edge3Target;
    69       return clone;
     66      return new TranslocationMoveRelativeAttribute(this, cloner);
    7067    }
    7168  }
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveSoftTabuCriterion.cs

    r4068 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Data;
     
    6465    }
    6566
     67    [StorableConstructor]
     68    protected TranslocationMoveSoftTabuCriterion(bool deserializing) : base(deserializing) { }
     69    protected TranslocationMoveSoftTabuCriterion(TranslocationMoveSoftTabuCriterion original, Cloner cloner) : base(original, cloner) { }
    6670    public TranslocationMoveSoftTabuCriterion()
    6771      : base() {
     
    7377      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, else if it is a minimization problem."));
    7478      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The quality of the current move."));
     79    }
     80
     81    public override IDeepCloneable Clone(Cloner cloner) {
     82      return new TranslocationMoveSoftTabuCriterion(this, cloner);
    7583    }
    7684
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveTabuMaker.cs

    r4068 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Optimization.Operators;
     
    3637    }
    3738
     39    [StorableConstructor]
     40    protected TranslocationMoveTabuMaker(bool deserializing) : base(deserializing) { }
     41    protected TranslocationMoveTabuMaker(TranslocationMoveTabuMaker original, Cloner cloner) : base(original, cloner) { }
    3842    public TranslocationMoveTabuMaker()
    3943      : base() {
    4044      Parameters.Add(new LookupParameter<TranslocationMove>("TranslocationMove", "The move that was made."));
    4145      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation."));
     46    }
     47
     48    public override IDeepCloneable Clone(Cloner cloner) {
     49      return new TranslocationMoveTabuMaker(this, cloner);
    4250    }
    4351
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoIndexMove.cs

    r3376 r4722  
    3535    public Permutation Permutation { get; protected set; }
    3636
    37     public TwoIndexMove()
    38       : base() {
    39       Index1 = -1;
    40       Index2 = -1;
    41       Permutation = null;
     37    [StorableConstructor]
     38    protected TwoIndexMove(bool deserializing) : base(deserializing) { }
     39    protected TwoIndexMove(TwoIndexMove original, Cloner cloner)
     40      : base(original, cloner) {
     41      this.Index1 = original.Index1;
     42      this.Index2 = original.Index2;
     43      if (original.Permutation != null)
     44        this.Permutation = cloner.Clone(original.Permutation);
    4245    }
    43 
     46    public TwoIndexMove() : this(-1, -1, null) { }
    4447    public TwoIndexMove(int index1, int index2, Permutation permutation)
    4548      : base() {
     
    5053
    5154    public override IDeepCloneable Clone(Cloner cloner) {
    52       TwoIndexMove clone = (TwoIndexMove)base.Clone(cloner);
    53       clone.Index1 = Index1;
    54       clone.Index2 = Index2;
    55       if (Permutation != null)
    56         clone.Permutation = (Permutation)Permutation.Clone(cloner);
    57       return clone;
     55      return new TwoIndexMove(this, cloner);
    5856    }
    5957  }
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/ExhaustiveInversionMoveGenerator.cs

    r4068 r4722  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Optimization;
     
    2930  [StorableClass]
    3031  public class ExhaustiveInversionMoveGenerator : InversionMoveGenerator, IExhaustiveMoveGenerator {
     32    [StorableConstructor]
     33    protected ExhaustiveInversionMoveGenerator(bool deserializing) : base(deserializing) { }
     34    protected ExhaustiveInversionMoveGenerator(ExhaustiveInversionMoveGenerator original, Cloner cloner) : base(original, cloner) { }
     35    public ExhaustiveInversionMoveGenerator() : base() { }
     36
     37    public override IDeepCloneable Clone(Cloner cloner) {
     38      return new ExhaustiveInversionMoveGenerator(this, cloner);
     39    }
     40
    3141    public static InversionMove[] Apply(Permutation permutation) {
    3242      int length = permutation.Length;
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMove.cs

    r4068 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    2728  [StorableClass]
    2829  public class InversionMove : TwoIndexMove {
    29     public InversionMove()
    30       : base() {
    31     }
     30    [StorableConstructor]
     31    protected InversionMove(bool deserializing) : base(deserializing) { }
     32    protected InversionMove(InversionMove original, Cloner cloner) : base(original, cloner) { }
     33    public InversionMove() : base() { }
     34    public InversionMove(int index1, int index2) : base(index1, index2, null) { }
     35    public InversionMove(int index1, int index2, Permutation permutation) : base(index1, index2, permutation) { }
    3236
    33     public InversionMove(int index1, int index2)
    34       : base(index1, index2, null) {
    35     }
    36 
    37     public InversionMove(int index1, int index2, Permutation permutation)
    38       : base(index1, index2, permutation) {
     37    public override IDeepCloneable Clone(Cloner cloner) {
     38      return new InversionMove(this, cloner);
    3939    }
    4040  }
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveAbsoluteAttribute.cs

    r3376 r4722  
    3838
    3939    [StorableConstructor]
    40     private InversionMoveAbsoluteAttribute(bool deserializing)
    41       : base() {
     40    protected InversionMoveAbsoluteAttribute(bool deserializing) : base(deserializing) { }
     41    protected InversionMoveAbsoluteAttribute(InversionMoveAbsoluteAttribute original, Cloner cloner)
     42      : base(original, cloner) {
     43      this.Index1 = original.Index1;
     44      this.Number1 = original.Number1;
     45      this.Index2 = original.Index2;
     46      this.Number2 = original.Number2;
    4247    }
    43 
    44     public InversionMoveAbsoluteAttribute()
    45       : this(-1, -1, -1, -1, -1) { }
    46 
     48    public InversionMoveAbsoluteAttribute() : this(-1, -1, -1, -1, -1) { }
    4749    public InversionMoveAbsoluteAttribute(int index1, int number1, int index2, int number2, double moveQuality)
    4850      : base(moveQuality) {
     
    5456
    5557    public override IDeepCloneable Clone(Cloner cloner) {
    56       InversionMoveAbsoluteAttribute clone = (InversionMoveAbsoluteAttribute)base.Clone(cloner);
    57       clone.Index1 = Index1;
    58       clone.Number1 = Number1;
    59       clone.Index2 = Index2;
    60       clone.Number2 = Number2;
    61       return clone;
     58      return new InversionMoveAbsoluteAttribute(this, cloner);
    6259    }
    6360  }
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveGenerator.cs

    r4068 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Operators;
     
    4344    }
    4445
     46    [StorableConstructor]
     47    protected InversionMoveGenerator(bool deserializing) : base(deserializing) { }
     48    protected InversionMoveGenerator(InversionMoveGenerator original, Cloner cloner) : base(original, cloner) { }
    4549    public InversionMoveGenerator()
    4650      : base() {
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveHardTabuCriterion.cs

    r4068 r4722  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    6566    }
    6667
     68    [StorableConstructor]
     69    protected InversionMoveHardTabuCriterion(bool deserializing) : base(deserializing) { }
     70    protected InversionMoveHardTabuCriterion(InversionMoveHardTabuCriterion original, Cloner cloner) : base(original, cloner) { }
    6771    public InversionMoveHardTabuCriterion()
    6872      : base() {
     
    7478      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, else if it is a minimization problem."));
    7579      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The quality of the current move."));
     80    }
     81
     82    public override IDeepCloneable Clone(Cloner cloner) {
     83      return new InversionMoveHardTabuCriterion(this, cloner);
    7684    }
    7785
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveMaker.cs

    r4068 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Data;
     
    4748    }
    4849
     50    [StorableConstructor]
     51    protected InversionMoveMaker(bool deserializing) : base(deserializing) { }
     52    protected InversionMoveMaker(InversionMoveMaker original, Cloner cloner) : base(original, cloner) { }
    4953    public InversionMoveMaker()
    5054      : base() {
     
    5357      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The relative quality of the move."));
    5458      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation."));
     59    }
     60
     61    public override IDeepCloneable Clone(Cloner cloner) {
     62      return new InversionMoveMaker(this, cloner);
    5563    }
    5664
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveRelativeAttribute.cs

    r3376 r4722  
    3838
    3939    [StorableConstructor]
    40     private InversionMoveRelativeAttribute(bool deserializing)
    41       : base() {
     40    protected InversionMoveRelativeAttribute(bool deserializing) : base(deserializing) { }
     41    protected InversionMoveRelativeAttribute(InversionMoveRelativeAttribute original, Cloner cloner)
     42      : base(original, cloner) {
     43      this.Edge1Source = original.Edge1Source;
     44      this.Edge1Target = original.Edge1Target;
     45      this.Edge2Source = original.Edge2Source;
     46      this.Edge2Target = original.Edge2Target;
    4247    }
    43 
    44     public InversionMoveRelativeAttribute()
    45       : this(-1, -1, -1, -1, -1) { }
    46 
     48    public InversionMoveRelativeAttribute() : this(-1, -1, -1, -1, -1) { }
    4749    public InversionMoveRelativeAttribute(int edge1Source, int edge1Target, int edge2Source, int edge2Target, double moveQuality)
    4850      : base(moveQuality) {
     
    5456
    5557    public override IDeepCloneable Clone(Cloner cloner) {
    56       InversionMoveRelativeAttribute clone = (InversionMoveRelativeAttribute)base.Clone(cloner);
    57       clone.Edge1Source = Edge1Source;
    58       clone.Edge1Target = Edge1Target;
    59       clone.Edge2Source = Edge2Source;
    60       clone.Edge2Target = Edge2Target;
    61       return clone;
     58      return new InversionMoveRelativeAttribute(this, cloner);
    6259    }
    6360  }
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveSoftTabuCriterion.cs

    r4068 r4722  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    6566    }
    6667
     68    [StorableConstructor]
     69    protected InversionMoveSoftTabuCriterion(bool deserializing) : base(deserializing) { }
     70    protected InversionMoveSoftTabuCriterion(InversionMoveSoftTabuCriterion original, Cloner cloner) : base(original, cloner) { }
    6771    public InversionMoveSoftTabuCriterion()
    6872      : base() {
     
    7478      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, else if it is a minimization problem."));
    7579      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The quality of the current move."));
     80    }
     81
     82    public override IDeepCloneable Clone(Cloner cloner) {
     83      return new InversionMoveSoftTabuCriterion(this, cloner);
    7684    }
    7785
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveTabuMaker.cs

    r4068 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Optimization.Operators;
     
    3637    }
    3738
     39    [StorableConstructor]
     40    protected InversionMoveTabuMaker(bool deserializing) : base(deserializing) { }
     41    protected InversionMoveTabuMaker(InversionMoveTabuMaker original, Cloner cloner) : base(original, cloner) { }
    3842    public InversionMoveTabuMaker()
    3943      : base() {
    4044      Parameters.Add(new LookupParameter<InversionMove>("InversionMove", "The move that was made."));
    4145      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation."));
     46    }
     47
     48    public override IDeepCloneable Clone(Cloner cloner) {
     49      return new InversionMoveTabuMaker(this, cloner);
    4250    }
    4351
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/StochasticInversionMultiMoveGenerator.cs

    r4068 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Data;
     
    4243    }
    4344
     45    [StorableConstructor]
     46    protected StochasticInversionMultiMoveGenerator(bool deserializing) : base(deserializing) { }
     47    protected StochasticInversionMultiMoveGenerator(StochasticInversionMultiMoveGenerator original, Cloner cloner) : base(original, cloner) { }
    4448    public StochasticInversionMultiMoveGenerator()
    4549      : base() {
    4650      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator."));
    4751      Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves to generate."));
     52    }
     53
     54    public override IDeepCloneable Clone(Cloner cloner) {
     55      return new StochasticInversionMultiMoveGenerator(this, cloner);
    4856    }
    4957
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/StochasticInversionSingleMoveGenerator.cs

    r4068 r4722  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Optimization;
     
    3435    }
    3536
     37    [StorableConstructor]
     38    protected StochasticInversionSingleMoveGenerator(bool deserializing) : base(deserializing) { }
     39    protected StochasticInversionSingleMoveGenerator(StochasticInversionSingleMoveGenerator original, Cloner cloner) : base(original, cloner) { }
    3640    public StochasticInversionSingleMoveGenerator()
    3741      : base() {
    3842      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator."));
     43    }
     44
     45    public override IDeepCloneable Clone(Cloner cloner) {
     46      return new StochasticInversionSingleMoveGenerator(this, cloner);
    3947    }
    4048
Note: See TracChangeset for help on using the changeset viewer.