- Timestamp:
- 11/06/10 01:56:04 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 9 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.RealVectorEncoding/3.3/Moves/AdditiveMove.cs
r3376 r4722 35 35 public RealVector RealVector { get; protected set; } 36 36 37 public AdditiveMove() 38 : this(-1, 0, null) { 37 [StorableConstructor] 38 protected AdditiveMove(bool deserializing) : base(deserializing) { } 39 protected AdditiveMove(AdditiveMove original, Cloner cloner) 40 : base(original, cloner) { 41 this.Dimension = original.Dimension; 42 this.MoveDistance = original.MoveDistance; 43 if (original.RealVector != null) 44 this.RealVector = cloner.Clone(original.RealVector); 39 45 } 40 41 public AdditiveMove(int dimension, double moveDistance) 42 : this(dimension, moveDistance, null) { 43 } 44 46 public AdditiveMove() : this(-1, 0, null) { } 47 public AdditiveMove(int dimension, double moveDistance) : this(dimension, moveDistance, null) { } 45 48 public AdditiveMove(int dimension, double moveDistance, RealVector realVector) 46 49 : base() { … … 51 54 52 55 public override IDeepCloneable Clone(Cloner cloner) { 53 AdditiveMove clone = (AdditiveMove)base.Clone(cloner); 54 clone.Dimension = Dimension; 55 clone.MoveDistance = MoveDistance; 56 if (RealVector != null) 57 clone.RealVector = (RealVector)RealVector.Clone(cloner); 58 return clone; 56 return new AdditiveMove(this, cloner); 59 57 } 60 58 } -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveGenerator.cs
r4101 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 50 51 } 51 52 53 [StorableConstructor] 54 protected AdditiveMoveGenerator(bool deserializing) : base(deserializing) { } 55 protected AdditiveMoveGenerator(AdditiveMoveGenerator original, Cloner cloner) : base(original, cloner) { } 52 56 public AdditiveMoveGenerator() 53 57 : base() { -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveMaker.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 AdditiveMoveMaker(bool deserializing) : base(deserializing) { } 52 protected AdditiveMoveMaker(AdditiveMoveMaker original, Cloner cloner) : base(original, cloner) { } 49 53 public AdditiveMoveMaker() 50 54 : base() { … … 53 57 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The relative quality of the move.")); 54 58 Parameters.Add(new LookupParameter<RealVector>("RealVector", "The solution as permutation.")); 59 } 60 61 public override IDeepCloneable Clone(Cloner cloner) { 62 return new AdditiveMoveMaker(this, cloner); 55 63 } 56 64 -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveTabuAttribute.cs
r3376 r4722 38 38 39 39 [StorableConstructor] 40 private AdditiveMoveTabuAttribute(bool deserializing) 41 : base() { 40 protected AdditiveMoveTabuAttribute(bool deserializing) : base(deserializing) { } 41 protected AdditiveMoveTabuAttribute(AdditiveMoveTabuAttribute original, Cloner cloner) 42 : base(original, cloner) { 43 this.Dimension = original.Dimension; 44 this.OriginalPosition = original.OriginalPosition; 45 this.MovedPosition = original.MovedPosition; 46 this.MoveQuality = original.MoveQuality; 42 47 } 43 public AdditiveMoveTabuAttribute() 44 : base() { 45 Dimension = -1; 46 OriginalPosition = 0; 47 MovedPosition = 0; 48 MoveQuality = 0; 49 } 50 48 public AdditiveMoveTabuAttribute() : this(-1, 0, 0, 0) { } 51 49 public AdditiveMoveTabuAttribute(int dimension, double originalPosition, double movedPosition, double moveQuality) 52 50 : base() { … … 58 56 59 57 public override IDeepCloneable Clone(Cloner cloner) { 60 AdditiveMoveTabuAttribute clone = (AdditiveMoveTabuAttribute)base.Clone(cloner); 61 clone.Dimension = Dimension; 62 clone.OriginalPosition = OriginalPosition; 63 clone.MovedPosition = MovedPosition; 64 clone.MoveQuality = MoveQuality; 65 return clone; 58 return new AdditiveMoveTabuAttribute(this, cloner); 66 59 } 67 60 } -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveTabuChecker.cs
r4068 r4722 21 21 22 22 using System; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; … … 62 63 } 63 64 64 65 [StorableConstructor] 66 protected AdditiveMoveTabuChecker(bool deserializing) : base(deserializing) { } 67 protected AdditiveMoveTabuChecker(AdditiveMoveTabuChecker original, Cloner cloner) : base(original, cloner) { } 65 68 public AdditiveMoveTabuChecker() 66 69 : base() { … … 72 75 Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, else if it is a minimization problem.")); 73 76 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The quality of the current move.")); 77 } 78 79 public override IDeepCloneable Clone(Cloner cloner) { 80 return new AdditiveMoveTabuChecker(this, cloner); 74 81 } 75 82 -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveTabuMaker.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 AdditiveMoveTabuMaker(bool deserializing) : base(deserializing) { } 41 protected AdditiveMoveTabuMaker(AdditiveMoveTabuMaker original, Cloner cloner) : base(original, cloner) { } 38 42 public AdditiveMoveTabuMaker() 39 43 : base() { 40 44 Parameters.Add(new LookupParameter<AdditiveMove>("AdditiveMove", "The move to evaluate.")); 41 45 Parameters.Add(new LookupParameter<RealVector>("RealVector", "The solution as permutation.")); 46 } 47 48 public override IDeepCloneable Clone(Cloner cloner) { 49 return new AdditiveMoveTabuMaker(this, cloner); 42 50 } 43 51 -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/StochasticNormalMultiMoveGenerator.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 38 39 } 39 40 41 [StorableConstructor] 42 protected StochasticNormalMultiMoveGenerator(bool deserializing) : base(deserializing) { } 43 protected StochasticNormalMultiMoveGenerator(StochasticNormalMultiMoveGenerator original, Cloner cloner) : base(original, cloner) { } 40 44 public StochasticNormalMultiMoveGenerator() 41 45 : base() { 42 46 Parameters.Add(new ValueLookupParameter<DoubleValue>("Sigma", "The standard deviation of the normal distribution.", new DoubleValue(1))); 43 47 Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves that should be generated.")); 48 } 49 50 public override IDeepCloneable Clone(Cloner cloner) { 51 return new StochasticNormalMultiMoveGenerator(this, cloner); 44 52 } 45 53 -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/StochasticPolynomialMultiMoveGenerator.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 StochasticPolynomialMultiMoveGenerator(bool deserializing) : base(deserializing) { } 52 protected StochasticPolynomialMultiMoveGenerator(StochasticPolynomialMultiMoveGenerator original, Cloner cloner) : base(original, cloner) { } 49 53 public StochasticPolynomialMultiMoveGenerator() 50 54 : base() { … … 52 56 Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves that should be generated.")); 53 57 Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumManipulation", "Specifies the maximum value that should be added or subtracted by the manipulation. If this value is set to 0 no mutation will be performed.", new DoubleValue(1))); 58 } 59 60 public override IDeepCloneable Clone(Cloner cloner) { 61 return new StochasticPolynomialMultiMoveGenerator(this, cloner); 54 62 } 55 63
Note: See TracChangeset
for help on using the changeset viewer.