Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/29/10 17:37:02 (13 years ago)
Author:
abeham
Message:

#922

  • Refactored HeuristicLab.Encodings.PermutationEncoding
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeIndexMove.cs

    r3376 r4667  
    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  }
Note: See TracChangeset for help on using the changeset viewer.