- Timestamp:
- 11/06/10 01:56:04 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 12 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/TwoOpt/ExhaustiveInversionMoveGenerator.cs
r4068 r4722 21 21 22 22 using System; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Optimization; … … 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; -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMove.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 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 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveAbsoluteAttribute.cs
r3376 r4722 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 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveGenerator.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Operators; … … 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() { -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveHardTabuCriterion.cs
r4068 r4722 21 21 22 22 using System; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; … … 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 -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveMaker.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 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 -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveRelativeAttribute.cs
r3376 r4722 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 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveSoftTabuCriterion.cs
r4068 r4722 21 21 22 22 using System; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; … … 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 -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveTabuMaker.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Optimization.Operators; … … 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 -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/StochasticInversionMultiMoveGenerator.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 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 -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/StochasticInversionSingleMoveGenerator.cs
r4068 r4722 21 21 22 22 using System; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Optimization; … … 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
Note: See TracChangeset
for help on using the changeset viewer.