- Timestamp:
- 11/06/10 01:56:04 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 13 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/ThreeOpt/ExhaustiveInsertionMoveGenerator.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 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; -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/StochasticSingleInsertionMoveGenerator.cs
r4068 r4722 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Data; … … 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 -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/StochasticTranslocationMultiMoveGenerator.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 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 -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/StochasticTranslocationSingleMoveGenerator.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 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 -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMove.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 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 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveAbsoluteAttribute.cs
r3376 r4722 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 45 public TranslocationMoveAbsoluteAttribute(int[] number, int oldPosition, int newPosition, double moveQuality) 46 46 : base(moveQuality) { … … 51 51 52 52 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); 58 54 } 59 55 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveGenerator.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 TranslocationMoveGenerator(bool deserializing) : base(deserializing) { } 48 protected TranslocationMoveGenerator(TranslocationMoveGenerator original, Cloner cloner) : base(original, cloner) { } 45 49 public TranslocationMoveGenerator() 46 50 : base() { -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveHardTabuCriterion.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 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 -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveMaker.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 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 -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveRelativeAttribute.cs
r3376 r4722 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 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveSoftTabuCriterion.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 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 -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveTabuMaker.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 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
Note: See TracChangeset
for help on using the changeset viewer.