Changeset 4667 for branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeIndexMove.cs
- Timestamp:
- 10/29/10 17:37:02 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeIndexMove.cs
r3376 r4667 37 37 public Permutation Permutation { get; protected set; } 38 38 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); 45 48 } 46 49 public ThreeIndexMove() : this(-1, -1, -1, null) { } 47 50 public ThreeIndexMove(int index1, int index2, int index3, Permutation permutation) 48 51 : base() { … … 54 57 55 58 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); 63 60 } 64 61 }
Note: See TracChangeset
for help on using the changeset viewer.