Changeset 4722 for trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoIndexMove.cs
- Timestamp:
- 11/06/10 01:56:04 (13 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
/branches/CloningRefactoring (added) merged: 4656-4693,4696-4697,4711-4714,4718-4719
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoIndexMove.cs
r3376 r4722 35 35 public Permutation Permutation { get; protected set; } 36 36 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); 42 45 } 43 46 public TwoIndexMove() : this(-1, -1, null) { } 44 47 public TwoIndexMove(int index1, int index2, Permutation permutation) 45 48 : base() { … … 50 53 51 54 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); 58 56 } 59 57 }
Note: See TracChangeset
for help on using the changeset viewer.