- Timestamp:
- 10/29/10 17:37:02 (14 years ago)
- Location:
- branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3
- Files:
-
- 50 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Creators/RandomPermutationCreator.cs
r4477 r4667 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Encodings.PermutationEncoding { … … 56 57 } 57 58 59 [StorableConstructor] 60 private RandomPermutationCreator(bool deserializing) : base(deserializing) { } 61 private RandomPermutationCreator(RandomPermutationCreator original, Cloner cloner) : base(original, cloner) { } 58 62 public RandomPermutationCreator() 59 63 : base() { … … 64 68 } 65 69 70 public override IDeepCloneable Clone(Cloner cloner) { 71 return new RandomPermutationCreator(this, cloner); 72 } 73 66 74 public override IOperation Apply() { 67 75 PermutationParameter.ActualValue = new Permutation(PermutationType, LengthParameter.ActualValue.Value, RandomParameter.ActualValue); -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Crossovers/CosaCrossover.cs
r4477 r4667 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Encodings.PermutationEncoding { … … 37 38 [StorableClass] 38 39 public class CosaCrossover : PermutationCrossover { 40 [StorableConstructor] 41 protected CosaCrossover(bool deserializing) : base(deserializing) { } 42 protected CosaCrossover(CosaCrossover original, Cloner cloner) : base(original, cloner) { } 43 public CosaCrossover() : base() { } 44 45 public override IDeepCloneable Clone(Cloner cloner) { 46 return new CosaCrossover(this, cloner); 47 } 48 39 49 /// <summary> 40 50 /// The operator actually performs a 2-opt mutation on the first parent, but it uses the second parent to determine which new edge should be inserted. -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Crossovers/CyclicCrossover.cs
r4477 r4667 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Encodings.PermutationEncoding { … … 34 35 [StorableClass] 35 36 public class CyclicCrossover : PermutationCrossover { 37 [StorableConstructor] 38 protected CyclicCrossover(bool deserializing) : base(deserializing) { } 39 protected CyclicCrossover(CyclicCrossover original, Cloner cloner) : base(original, cloner) { } 40 public CyclicCrossover() : base() { } 41 42 public override IDeepCloneable Clone(Cloner cloner) { 43 return new CyclicCrossover(this, cloner); 44 } 45 36 46 /// <summary> 37 47 /// Performs the cyclic crossover on <paramref name="parent1"/> and <paramref name="parent2"/>. -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Crossovers/CyclicCrossover2.cs
r4068 r4667 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Encodings.PermutationEncoding { … … 35 36 [StorableClass] 36 37 public class CyclicCrossover2 : PermutationCrossover { 38 [StorableConstructor] 39 protected CyclicCrossover2(bool deserializing) : base(deserializing) { } 40 protected CyclicCrossover2(CyclicCrossover2 original, Cloner cloner) : base(original, cloner) { } 41 public CyclicCrossover2() : base() { } 42 43 public override IDeepCloneable Clone(Cloner cloner) { 44 return new CyclicCrossover2(this, cloner); 45 } 46 37 47 /// <summary> 38 48 /// Performs a variant of the cyclic crossover on <paramref name="parent1"/> and <paramref name="parent2"/>. -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Crossovers/EdgeRecombinationCrossover.cs
r4477 r4667 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Encodings.PermutationEncoding { … … 37 38 [StorableClass] 38 39 public class EdgeRecombinationCrossover : PermutationCrossover { 40 [StorableConstructor] 41 protected EdgeRecombinationCrossover(bool deserializing) : base(deserializing) { } 42 protected EdgeRecombinationCrossover(EdgeRecombinationCrossover original, Cloner cloner) : base(original, cloner) { } 43 public EdgeRecombinationCrossover() : base() { } 44 45 public override IDeepCloneable Clone(Cloner cloner) { 46 return new EdgeRecombinationCrossover(this, cloner); 47 } 48 39 49 /// <summary> 40 50 /// Performs a cross over permutation of <paramref name="parent1"/> and <paramref name="2"/> -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Crossovers/MaximalPreservativeCrossover.cs
r4477 r4667 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Encodings.PermutationEncoding { … … 37 38 [StorableClass] 38 39 public class MaximalPreservativeCrossover : PermutationCrossover { 40 [StorableConstructor] 41 protected MaximalPreservativeCrossover(bool deserializing) : base(deserializing) { } 42 protected MaximalPreservativeCrossover(MaximalPreservativeCrossover original, Cloner cloner) : base(original, cloner) { } 43 public MaximalPreservativeCrossover() : base() { } 44 45 public override IDeepCloneable Clone(Cloner cloner) { 46 return new MaximalPreservativeCrossover(this, cloner); 47 } 48 39 49 /// <summary> 40 50 /// Performs the maximal preservative crossover on <paramref name="parent1"/> and <paramref name="parent2"/> -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Crossovers/MultiPermutationCrossover.cs
r3674 r4667 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 30 using HeuristicLab.PluginInfrastructure; 31 using HeuristicLab.Common; 31 32 32 33 namespace HeuristicLab.Encodings.PermutationEncoding { … … 50 51 51 52 [StorableConstructor] 52 private MultiPermutationCrossover(bool deserializing) : base(deserializing) { } 53 protected MultiPermutationCrossover(bool deserializing) : base(deserializing) { } 54 protected MultiPermutationCrossover(MultiPermutationCrossover original, Cloner cloner) : base(original, cloner) { } 53 55 public MultiPermutationCrossover() 54 56 : base() { … … 62 64 Operators.Add((IPermutationCrossover)Activator.CreateInstance(type), true); 63 65 } 66 } 67 68 public override IDeepCloneable Clone(Cloner cloner) { 69 return new MultiPermutationCrossover(this, cloner); 64 70 } 65 71 -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Crossovers/OrderBasedCrossover.cs
r4477 r4667 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Encodings.PermutationEncoding { … … 37 38 [StorableClass] 38 39 public class OrderBasedCrossover : PermutationCrossover { 40 [StorableConstructor] 41 protected OrderBasedCrossover(bool deserializing) : base(deserializing) { } 42 protected OrderBasedCrossover(OrderBasedCrossover original, Cloner cloner) : base(original, cloner) { } 43 public OrderBasedCrossover() : base() { } 44 45 public override IDeepCloneable Clone(Cloner cloner) { 46 return new OrderBasedCrossover(this, cloner); 47 } 48 39 49 /// <summary> 40 50 /// Performs a cross over permutation of <paramref name="parent1"/> and <paramref name="parent2"/> by -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Crossovers/OrderCrossover.cs
r4477 r4667 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Encodings.PermutationEncoding { … … 37 38 [StorableClass] 38 39 public class OrderCrossover : PermutationCrossover { 40 [StorableConstructor] 41 protected OrderCrossover(bool deserializing) : base(deserializing) { } 42 protected OrderCrossover(OrderCrossover original, Cloner cloner) : base(original, cloner) { } 43 public OrderCrossover() : base() { } 44 45 public override IDeepCloneable Clone(Cloner cloner) { 46 return new OrderCrossover(this, cloner); 47 } 48 39 49 /// <summary> 40 50 /// Performs the order crossover of two permutations. -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Crossovers/OrderCrossover2.cs
r4068 r4667 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Encodings.PermutationEncoding { … … 36 37 [StorableClass] 37 38 public class OrderCrossover2 : PermutationCrossover { 39 [StorableConstructor] 40 protected OrderCrossover2(bool deserializing) : base(deserializing) { } 41 protected OrderCrossover2(OrderCrossover2 original, Cloner cloner) : base(original, cloner) { } 42 public OrderCrossover2() : base() { } 43 44 public override IDeepCloneable Clone(Cloner cloner) { 45 return new OrderCrossover2(this, cloner); 46 } 47 38 48 /// <summary> 39 49 /// Performs a slight variation of the order crossover of two permutations. -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Crossovers/PartiallyMatchedCrossover.cs
r4545 r4667 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Encodings.PermutationEncoding { … … 36 37 [StorableClass] 37 38 public class PartiallyMatchedCrossover : PermutationCrossover { 39 [StorableConstructor] 40 protected PartiallyMatchedCrossover(bool deserializing) : base(deserializing) { } 41 protected PartiallyMatchedCrossover(PartiallyMatchedCrossover original, Cloner cloner) : base(original, cloner) { } 42 public PartiallyMatchedCrossover() : base() { } 43 44 public override IDeepCloneable Clone(Cloner cloner) { 45 return new PartiallyMatchedCrossover(this, cloner); 46 } 47 38 48 /// <summary> 39 49 /// Performs the partially matched crossover on <paramref name="parent1"/> and <paramref name="parent2"/>. -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Crossovers/PositionBasedCrossover.cs
r4477 r4667 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Encodings.PermutationEncoding { … … 34 35 [StorableClass] 35 36 public class PositionBasedCrossover : PermutationCrossover { 37 [StorableConstructor] 38 protected PositionBasedCrossover(bool deserializing) : base(deserializing) { } 39 protected PositionBasedCrossover(PositionBasedCrossover original, Cloner cloner) : base(original, cloner) { } 40 public PositionBasedCrossover() : base() { } 41 42 public override IDeepCloneable Clone(Cloner cloner) { 43 return new PositionBasedCrossover(this, cloner); 44 } 45 36 46 /// <summary> 37 47 /// Performs a cross over permutation of <paramref name="parent1"/> and <paramref name="parent2"/> -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Manipulators/InsertionManipulator.cs
r4477 r4667 22 22 using HeuristicLab.Core; 23 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 using HeuristicLab.Common; 24 25 25 26 namespace HeuristicLab.Encodings.PermutationEncoding { … … 33 34 [StorableClass] 34 35 public class InsertionManipulator : PermutationManipulator { 36 [StorableConstructor] 37 protected InsertionManipulator(bool deserializing) : base(deserializing) { } 38 protected InsertionManipulator(InsertionManipulator original, Cloner cloner) : base(original, cloner) { } 39 public InsertionManipulator() : base() { } 40 41 public override IDeepCloneable Clone(Cloner cloner) { 42 return new InsertionManipulator(this, cloner); 43 } 44 35 45 /// <summary> 36 46 /// Moves an randomly chosen element in the specified <paramref name="permutation"/> array -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Manipulators/InversionManipulator.cs
r4477 r4667 22 22 using HeuristicLab.Core; 23 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 using HeuristicLab.Common; 24 25 25 26 namespace HeuristicLab.Encodings.PermutationEncoding { … … 33 34 [StorableClass] 34 35 public class InversionManipulator : PermutationManipulator { 36 [StorableConstructor] 37 protected InversionManipulator(bool deserializing) : base(deserializing) { } 38 protected InversionManipulator(InversionManipulator original, Cloner cloner) : base(original, cloner) { } 39 public InversionManipulator() : base() { } 40 41 public override IDeepCloneable Clone(Cloner cloner) { 42 return new InversionManipulator(this, cloner); 43 } 44 35 45 /// <summary> 36 46 /// Inverts a randomly chosen part of a permutation. -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Manipulators/MultiPermutationManipulator.cs
r4373 r4667 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 30 using HeuristicLab.PluginInfrastructure; 31 using HeuristicLab.Common; 31 32 32 33 namespace HeuristicLab.Encodings.PermutationEncoding { … … 46 47 47 48 [StorableConstructor] 48 private MultiPermutationManipulator(bool deserializing) : base(deserializing) { } 49 protected MultiPermutationManipulator(bool deserializing) : base(deserializing) { } 50 protected MultiPermutationManipulator(MultiPermutationManipulator original, Cloner cloner) : base(original, cloner) { } 49 51 public MultiPermutationManipulator() 50 52 : base() { … … 55 57 Operators.Add((IPermutationManipulator)Activator.CreateInstance(type), true); 56 58 } 59 } 60 61 public override IDeepCloneable Clone(Cloner cloner) { 62 return new MultiPermutationManipulator(this, cloner); 57 63 } 58 64 -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Manipulators/ScrambleManipulator.cs
r4477 r4667 22 22 using HeuristicLab.Core; 23 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 using HeuristicLab.Common; 24 25 25 26 namespace HeuristicLab.Encodings.PermutationEncoding { … … 33 34 [StorableClass] 34 35 public class ScrambleManipulator : PermutationManipulator { 36 [StorableConstructor] 37 protected ScrambleManipulator(bool deserializing) : base(deserializing) { } 38 protected ScrambleManipulator(ScrambleManipulator original, Cloner cloner) : base(original, cloner) { } 39 public ScrambleManipulator() : base() { } 40 41 public override IDeepCloneable Clone(Cloner cloner) { 42 return new ScrambleManipulator(this, cloner); 43 } 44 35 45 /// <summary> 36 46 /// Mixes the elements of the given <paramref name="permutation"/> randomly -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Manipulators/Swap2Manipulator.cs
r4477 r4667 22 22 using HeuristicLab.Core; 23 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 using HeuristicLab.Common; 24 25 25 26 namespace HeuristicLab.Encodings.PermutationEncoding { … … 33 34 [StorableClass] 34 35 public class Swap2Manipulator : PermutationManipulator { 36 [StorableConstructor] 37 protected Swap2Manipulator(bool deserializing) : base(deserializing) { } 38 protected Swap2Manipulator(Swap2Manipulator original, Cloner cloner) : base(original, cloner) { } 39 public Swap2Manipulator() : base() { } 40 41 public override IDeepCloneable Clone(Cloner cloner) { 42 return new Swap2Manipulator(this, cloner); 43 } 44 35 45 /// <summary> 36 46 /// Swaps two randomly chosen elements in the given <paramref name="permutation"/> permutation. -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Manipulators/Swap3Manipulator.cs
r4477 r4667 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Encodings.PermutationEncoding { … … 35 36 [StorableClass] 36 37 public class Swap3Manipulator : PermutationManipulator { 38 [StorableConstructor] 39 protected Swap3Manipulator(bool deserializing) : base(deserializing) { } 40 protected Swap3Manipulator(Swap3Manipulator original, Cloner cloner) : base(original, cloner) { } 41 public Swap3Manipulator() : base() { } 42 43 public override IDeepCloneable Clone(Cloner cloner) { 44 return new Swap3Manipulator(this, cloner); 45 } 46 37 47 /// <summary> 38 48 /// Swaps three randomly chosen elements of the given <paramref name="permutation"/> array. -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Manipulators/TranslocationInversionManipulator.cs
r4477 r4667 22 22 using HeuristicLab.Core; 23 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 using HeuristicLab.Common; 24 25 25 26 namespace HeuristicLab.Encodings.PermutationEncoding { … … 34 35 [StorableClass] 35 36 public class TranslocationInversionManipulator : PermutationManipulator { 37 [StorableConstructor] 38 protected TranslocationInversionManipulator(bool deserializing) : base(deserializing) { } 39 protected TranslocationInversionManipulator(TranslocationInversionManipulator original, Cloner cloner) : base(original, cloner) { } 40 public TranslocationInversionManipulator() : base() { } 41 42 public override IDeepCloneable Clone(Cloner cloner) { 43 return new TranslocationInversionManipulator(this, cloner); 44 } 45 36 46 /// <summary> 37 47 /// Moves a randomly chosen interval of elements to another (randomly chosen) position in the given -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Manipulators/TranslocationManipulator.cs
r4477 r4667 22 22 using HeuristicLab.Core; 23 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 using HeuristicLab.Common; 24 25 25 26 namespace HeuristicLab.Encodings.PermutationEncoding { … … 34 35 [StorableClass] 35 36 public class TranslocationManipulator : PermutationManipulator { 37 [StorableConstructor] 38 protected TranslocationManipulator(bool deserializing) : base(deserializing) { } 39 protected TranslocationManipulator(TranslocationManipulator original, Cloner cloner) : base(original, cloner) { } 40 public TranslocationManipulator() : base() { } 41 42 public override IDeepCloneable Clone(Cloner cloner) { 43 return new TranslocationManipulator(this, cloner); 44 } 45 36 46 /// <summary> 37 47 /// Moves a randomly chosen interval of elements to another (randomly chosen) position in the given -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/PermutationMoveAttribute.cs
r3376 r4667 31 31 public double MoveQuality { get; protected set; } 32 32 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; 36 38 } 37 39 public PermutationMoveAttribute() : this(0) { } 38 40 public PermutationMoveAttribute(double moveQuality) 39 41 : base() { … … 42 44 43 45 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); 47 47 } 48 48 } -
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 } -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/ExhaustiveInsertionMoveGenerator.cs
r4068 r4667 24 24 using HeuristicLab.Optimization; 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HeuristicLab.Common; 26 27 27 28 namespace HeuristicLab.Encodings.PermutationEncoding { … … 29 30 [StorableClass] 30 31 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 31 41 public static TranslocationMove[] Apply(Permutation permutation) { 32 42 int length = permutation.Length; -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/StochasticSingleInsertionMoveGenerator.cs
r4068 r4667 27 27 using HeuristicLab.Parameters; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.Common; 29 30 30 31 namespace HeuristicLab.Encodings.PermutationEncoding { … … 44 45 } 45 46 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() { 47 51 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use.")); 48 52 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); 49 57 } 50 58 -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/StochasticTranslocationMultiMoveGenerator.cs
r4068 r4667 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.PermutationEncoding { … … 42 43 } 43 44 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() { 46 49 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator.")); 47 50 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); 48 55 } 49 56 -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/StochasticTranslocationSingleMoveGenerator.cs
r4068 r4667 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.PermutationEncoding { … … 34 35 } 35 36 37 [StorableConstructor] 38 protected StochasticTranslocationSingleMoveGenerator(bool deserializing) : base(deserializing) { } 39 protected StochasticTranslocationSingleMoveGenerator(StochasticTranslocationSingleMoveGenerator original, Cloner cloner) : base(original, cloner) { } 36 40 public StochasticTranslocationSingleMoveGenerator() 37 41 : base() { 38 42 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); 39 47 } 40 48 -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMove.cs
r4068 r4667 22 22 using HeuristicLab.Core; 23 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 using HeuristicLab.Common; 24 25 25 26 namespace HeuristicLab.Encodings.PermutationEncoding { … … 27 28 [StorableClass] 28 29 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) { } 32 36 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); 39 39 } 40 40 } -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveAbsoluteAttribute.cs
r3376 r4667 36 36 37 37 [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; 40 44 } 41 42 public TranslocationMoveAbsoluteAttribute() 43 : this(null, -1, -1, -1) { } 44 45 public TranslocationMoveAbsoluteAttribute() : this(null, -1, -1, -1) { } 45 46 public TranslocationMoveAbsoluteAttribute(int[] number, int oldPosition, int newPosition, double moveQuality) 46 47 : base(moveQuality) { … … 51 52 52 53 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; 54 return new TranslocationMoveAbsoluteAttribute(this, cloner); 58 55 } 59 56 } -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveGenerator.cs
r4068 r4667 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.PermutationEncoding { … … 43 44 } 44 45 46 [StorableConstructor] 47 protected TranslocationMoveGenerator(bool deserializing) : base(deserializing) { } 48 protected TranslocationMoveGenerator(TranslocationMoveGenerator original, Cloner cloner) : base(original, cloner) { } 45 49 public TranslocationMoveGenerator() 46 50 : base() { -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveHardTabuCriterion.cs
r4068 r4667 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Encodings.PermutationEncoding { … … 64 65 } 65 66 67 [StorableConstructor] 68 protected TranslocationMoveHardTabuCriterion(bool deserializing) : base(deserializing) { } 69 protected TranslocationMoveHardTabuCriterion(TranslocationMoveHardTabuCriterion original, Cloner cloner) : base(original, cloner) { } 66 70 public TranslocationMoveHardTabuCriterion() 67 71 : base() { … … 73 77 Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, else if it is a minimization problem.")); 74 78 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); 75 83 } 76 84 -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveMaker.cs
r4068 r4667 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Encodings.PermutationEncoding { … … 47 48 } 48 49 50 [StorableConstructor] 51 protected TranslocationMoveMaker(bool deserializing) : base(deserializing) { } 52 protected TranslocationMoveMaker(TranslocationMoveMaker original, Cloner cloner) : base(original, cloner) { } 49 53 public TranslocationMoveMaker() 50 54 : base() { … … 53 57 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The relative quality of the move.")); 54 58 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); 55 63 } 56 64 -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveRelativeAttribute.cs
r3376 r4667 42 42 43 43 [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; 46 53 } 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) { } 51 55 public TranslocationMoveRelativeAttribute(int edge1Source, int edge1Target, int edge2Source, int edge2Target, int edge3Source, int edge3Target, double moveQuality) 52 56 : base(moveQuality) { … … 60 64 61 65 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); 70 67 } 71 68 } -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveSoftTabuCriterion.cs
r4068 r4667 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Encodings.PermutationEncoding { … … 64 65 } 65 66 67 [StorableConstructor] 68 protected TranslocationMoveSoftTabuCriterion(bool deserializing) : base(deserializing) { } 69 protected TranslocationMoveSoftTabuCriterion(TranslocationMoveSoftTabuCriterion original, Cloner cloner) : base(original, cloner) { } 66 70 public TranslocationMoveSoftTabuCriterion() 67 71 : base() { … … 73 77 Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, else if it is a minimization problem.")); 74 78 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); 75 83 } 76 84 -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveTabuMaker.cs
r4068 r4667 24 24 using HeuristicLab.Parameters; 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HeuristicLab.Common; 26 27 27 28 namespace HeuristicLab.Encodings.PermutationEncoding { … … 36 37 } 37 38 39 [StorableConstructor] 40 protected TranslocationMoveTabuMaker(bool deserializing) : base(deserializing) { } 41 protected TranslocationMoveTabuMaker(TranslocationMoveTabuMaker original, Cloner cloner) : base(original, cloner) { } 38 42 public TranslocationMoveTabuMaker() 39 43 : base() { 40 44 Parameters.Add(new LookupParameter<TranslocationMove>("TranslocationMove", "The move that was made.")); 41 45 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); 42 50 } 43 51 -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoIndexMove.cs
r3376 r4667 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 } -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/ExhaustiveInversionMoveGenerator.cs
r4068 r4667 24 24 using HeuristicLab.Optimization; 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HeuristicLab.Common; 26 27 27 28 namespace HeuristicLab.Encodings.PermutationEncoding { … … 29 30 [StorableClass] 30 31 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 31 41 public static InversionMove[] Apply(Permutation permutation) { 32 42 int length = permutation.Length; -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMove.cs
r4068 r4667 22 22 using HeuristicLab.Core; 23 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 using HeuristicLab.Common; 24 25 25 26 namespace HeuristicLab.Encodings.PermutationEncoding { … … 27 28 [StorableClass] 28 29 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) { } 32 36 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); 39 39 } 40 40 } -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveAbsoluteAttribute.cs
r3376 r4667 38 38 39 39 [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; 42 47 } 43 44 public InversionMoveAbsoluteAttribute() 45 : this(-1, -1, -1, -1, -1) { } 46 48 public InversionMoveAbsoluteAttribute() : this(-1, -1, -1, -1, -1) { } 47 49 public InversionMoveAbsoluteAttribute(int index1, int number1, int index2, int number2, double moveQuality) 48 50 : base(moveQuality) { … … 54 56 55 57 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); 62 59 } 63 60 } -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveGenerator.cs
r4068 r4667 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.PermutationEncoding { … … 43 44 } 44 45 46 [StorableConstructor] 47 protected InversionMoveGenerator(bool deserializing) : base(deserializing) { } 48 protected InversionMoveGenerator(InversionMoveGenerator original, Cloner cloner) : base(original, cloner) { } 45 49 public InversionMoveGenerator() 46 50 : base() { -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveHardTabuCriterion.cs
r4068 r4667 27 27 using HeuristicLab.Parameters; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.Common; 29 30 30 31 namespace HeuristicLab.Encodings.PermutationEncoding { … … 65 66 } 66 67 68 [StorableConstructor] 69 protected InversionMoveHardTabuCriterion(bool deserializing) : base(deserializing) { } 70 protected InversionMoveHardTabuCriterion(InversionMoveHardTabuCriterion original, Cloner cloner) : base(original, cloner) { } 67 71 public InversionMoveHardTabuCriterion() 68 72 : base() { … … 74 78 Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, else if it is a minimization problem.")); 75 79 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); 76 84 } 77 85 -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveMaker.cs
r4068 r4667 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Encodings.PermutationEncoding { … … 47 48 } 48 49 50 [StorableConstructor] 51 protected InversionMoveMaker(bool deserializing) : base(deserializing) { } 52 protected InversionMoveMaker(InversionMoveMaker original, Cloner cloner) : base(original, cloner) { } 49 53 public InversionMoveMaker() 50 54 : base() { … … 53 57 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The relative quality of the move.")); 54 58 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); 55 63 } 56 64 -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveRelativeAttribute.cs
r3376 r4667 38 38 39 39 [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; 42 47 } 43 44 public InversionMoveRelativeAttribute() 45 : this(-1, -1, -1, -1, -1) { } 46 48 public InversionMoveRelativeAttribute() : this(-1, -1, -1, -1, -1) { } 47 49 public InversionMoveRelativeAttribute(int edge1Source, int edge1Target, int edge2Source, int edge2Target, double moveQuality) 48 50 : base(moveQuality) { … … 54 56 55 57 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); 62 59 } 63 60 } -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveSoftTabuCriterion.cs
r4068 r4667 27 27 using HeuristicLab.Parameters; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.Common; 29 30 30 31 namespace HeuristicLab.Encodings.PermutationEncoding { … … 65 66 } 66 67 68 [StorableConstructor] 69 protected InversionMoveSoftTabuCriterion(bool deserializing) : base(deserializing) { } 70 protected InversionMoveSoftTabuCriterion(InversionMoveSoftTabuCriterion original, Cloner cloner) : base(original, cloner) { } 67 71 public InversionMoveSoftTabuCriterion() 68 72 : base() { … … 74 78 Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, else if it is a minimization problem.")); 75 79 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); 76 84 } 77 85 -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveTabuMaker.cs
r4068 r4667 24 24 using HeuristicLab.Parameters; 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HeuristicLab.Common; 26 27 27 28 namespace HeuristicLab.Encodings.PermutationEncoding { … … 36 37 } 37 38 39 [StorableConstructor] 40 protected InversionMoveTabuMaker(bool deserializing) : base(deserializing) { } 41 protected InversionMoveTabuMaker(InversionMoveTabuMaker original, Cloner cloner) : base(original, cloner) { } 38 42 public InversionMoveTabuMaker() 39 43 : base() { 40 44 Parameters.Add(new LookupParameter<InversionMove>("InversionMove", "The move that was made.")); 41 45 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); 42 50 } 43 51 -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/StochasticInversionMultiMoveGenerator.cs
r4068 r4667 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.PermutationEncoding { … … 42 43 } 43 44 45 [StorableConstructor] 46 protected StochasticInversionMultiMoveGenerator(bool deserializing) : base(deserializing) { } 47 protected StochasticInversionMultiMoveGenerator(StochasticInversionMultiMoveGenerator original, Cloner cloner) : base(original, cloner) { } 44 48 public StochasticInversionMultiMoveGenerator() 45 49 : base() { 46 50 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator.")); 47 51 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); 48 56 } 49 57 -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/StochasticInversionSingleMoveGenerator.cs
r4068 r4667 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.PermutationEncoding { … … 34 35 } 35 36 37 [StorableConstructor] 38 protected StochasticInversionSingleMoveGenerator(bool deserializing) : base(deserializing) { } 39 protected StochasticInversionSingleMoveGenerator(StochasticInversionSingleMoveGenerator original, Cloner cloner) : base(original, cloner) { } 36 40 public StochasticInversionSingleMoveGenerator() 37 41 : base() { 38 42 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); 39 47 } 40 48 -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Permutation.cs
r4477 r4667 38 38 } 39 39 40 public Permutation() : base() { 41 permutationType = PermutationTypes.RelativeUndirected; 40 [StorableConstructor] 41 protected Permutation(bool deserializing) : base(deserializing) { } 42 protected Permutation(Permutation original, Cloner cloner) 43 : base(original, cloner) { 44 this.permutationType = original.permutationType; 42 45 } 46 public Permutation() : this(PermutationTypes.RelativeUndirected) { } 43 47 public Permutation(PermutationTypes type) : base() { 44 48 permutationType = type; 45 49 } 46 47 50 public Permutation(PermutationTypes type, int length) 48 51 : base(length) { … … 64 67 65 68 public override IDeepCloneable Clone(Cloner cloner) { 66 Permutation clone = new Permutation(permutationType, array); 67 cloner.RegisterClonedObject(this, clone); 68 clone.readOnly = readOnly; 69 return clone; 69 return new Permutation(this, cloner); 70 70 } 71 71 -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/PermutationCrossover.cs
r4068 r4667 47 47 } 48 48 49 [StorableConstructor] 50 protected PermutationCrossover(bool deserializing) : base(deserializing) { } 51 protected PermutationCrossover(PermutationCrossover original, Cloner cloner) : base(original, cloner) { } 49 52 protected PermutationCrossover() 50 53 : base() { -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/PermutationManipulator.cs
r4068 r4667 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.PermutationEncoding { … … 44 45 } 45 46 47 [StorableConstructor] 48 protected PermutationManipulator(bool deserializing) : base(deserializing) { } 49 protected PermutationManipulator(PermutationManipulator original, Cloner cloner) : base(original, cloner) { } 46 50 protected PermutationManipulator() 47 51 : base() { -
branches/CloningRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/PermutationType.cs
r3436 r4667 34 34 } 35 35 36 [StorableConstructor] 37 protected PermutationType(bool deserializing) : base(deserializing) { } 38 protected PermutationType(PermutationType original, Cloner cloner) : base(original, cloner) { } 36 39 public PermutationType() : base() { } 37 40 public PermutationType(PermutationTypes type) : base(type) { } 38 41 39 42 public override IDeepCloneable Clone(Cloner cloner) { 40 PermutationType clone = new PermutationType(value); 41 cloner.RegisterClonedObject(this, clone); 42 return clone; 43 return new PermutationType(this, cloner); 43 44 } 44 45 }
Note: See TracChangeset
for help on using the changeset viewer.