Free cookie consent management tool by TermsFeed Policy Generator

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

Merged cloning refactoring branch back into trunk (#922)

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources

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