Changeset 4664 for branches/CloningRefactoring
- Timestamp:
- 10/29/10 16:50:38 (14 years ago)
- Location:
- branches/CloningRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CloningRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Creators/UniformRandomIntegerVectorCreator.cs
r4068 r4664 23 23 using HeuristicLab.Data; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Encodings.IntegerVectorEncoding { … … 31 32 [StorableClass] 32 33 public class UniformRandomIntegerVectorCreator : IntegerVectorCreator { 34 [StorableConstructor] 35 protected UniformRandomIntegerVectorCreator(bool deserializing) : base(deserializing) { } 36 protected UniformRandomIntegerVectorCreator(UniformRandomIntegerVectorCreator original, Cloner cloner) : base(original, cloner) { } 37 public UniformRandomIntegerVectorCreator() : base() { } 38 39 public override IDeepCloneable Clone(Cloner cloner) { 40 return new UniformRandomIntegerVectorCreator(this, cloner); 41 } 42 33 43 /// <summary> 34 44 /// Generates a new random integer vector with the given <paramref name="length"/>. -
branches/CloningRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Crossovers/DiscreteCrossover.cs
r4068 r4664 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Encodings.IntegerVectorEncoding { … … 34 35 [StorableClass] 35 36 public class DiscreteCrossover : IntegerVectorCrossover { 37 [StorableConstructor] 38 protected DiscreteCrossover(bool deserializing) : base(deserializing) { } 39 protected DiscreteCrossover(DiscreteCrossover original, Cloner cloner) : base(original, cloner) { } 40 public DiscreteCrossover() : base() { } 41 42 public override IDeepCloneable Clone(Cloner cloner) { 43 return new DiscreteCrossover(this, cloner); 44 } 45 36 46 /// <summary> 37 47 /// Performs a discrete crossover operation of the two given parents. -
branches/CloningRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Crossovers/MultiIntegerVectorCrossover.cs
r3674 r4664 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 30 using HeuristicLab.PluginInfrastructure; 31 using HeuristicLab.Common; 31 32 32 33 namespace HeuristicLab.Encodings.IntegerVectorEncoding { … … 50 51 51 52 [StorableConstructor] 52 private MultiIntegerVectorCrossover(bool deserializing) : base(deserializing) { } 53 protected MultiIntegerVectorCrossover(bool deserializing) : base(deserializing) { } 54 protected MultiIntegerVectorCrossover(MultiIntegerVectorCrossover original, Cloner cloner) : base(original, cloner) { } 53 55 public MultiIntegerVectorCrossover() 54 56 : base() { … … 62 64 Operators.Add((IIntegerVectorCrossover)Activator.CreateInstance(type), true); 63 65 } 66 } 67 68 public override IDeepCloneable Clone(Cloner cloner) { 69 return new MultiIntegerVectorCrossover(this, cloner); 64 70 } 65 71 -
branches/CloningRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Crossovers/SinglePointCrossover.cs
r4068 r4664 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Encodings.IntegerVectorEncoding { … … 34 35 [StorableClass] 35 36 public class SinglePointCrossover : IntegerVectorCrossover { 37 [StorableConstructor] 38 protected SinglePointCrossover(bool deserializing) : base(deserializing) { } 39 protected SinglePointCrossover(SinglePointCrossover original, Cloner cloner) : base(original, cloner) { } 40 public SinglePointCrossover() : base() { } 41 42 public override IDeepCloneable Clone(Cloner cloner) { 43 return new SinglePointCrossover(this, cloner); 44 } 45 36 46 /// <summary> 37 47 /// Performs a single point crossover at a randomly chosen position of the two -
branches/CloningRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVector.cs
r3431 r4664 29 29 [Item("IntegerVector", "Represents a vector of integer values.")] 30 30 public class IntegerVector : IntArray { 31 [StorableConstructor] 32 protected IntegerVector(bool deserializing) : base(deserializing) { } 33 protected IntegerVector(IntegerVector original, Cloner cloner) : base(original, cloner) { } 31 34 public IntegerVector() : base() { } 32 35 public IntegerVector(int length) : base(length) { } … … 43 46 44 47 public override IDeepCloneable Clone(Cloner cloner) { 45 IntegerVector clone = new IntegerVector(array); 46 cloner.RegisterClonedObject(this, clone); 47 clone.readOnly = readOnly; 48 return clone; 48 return new IntegerVector(this, cloner); 49 49 } 50 50 -
branches/CloningRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorCreator.cs
r4068 r4664 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Encodings.IntegerVectorEncoding { … … 53 54 } 54 55 56 [StorableConstructor] 57 protected IntegerVectorCreator(bool deserializing) : base(deserializing) { } 58 protected IntegerVectorCreator(IntegerVectorCreator original, Cloner cloner) : base(original, cloner) { } 55 59 protected IntegerVectorCreator() 56 60 : base() { -
branches/CloningRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorCrossover.cs
r4068 r4664 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.IntegerVectorEncoding { … … 46 47 } 47 48 49 [StorableConstructor] 50 protected IntegerVectorCrossover(bool deserializing) : base(deserializing) { } 51 protected IntegerVectorCrossover(IntegerVectorCrossover original, Cloner cloner) : base(original, cloner) { } 48 52 protected IntegerVectorCrossover() 49 53 : base() { -
branches/CloningRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorManipulator.cs
r4068 r4664 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.IntegerVectorEncoding { … … 43 44 } 44 45 46 [StorableConstructor] 47 protected IntegerVectorManipulator(bool deserializing) : base(deserializing) { } 48 protected IntegerVectorManipulator(IntegerVectorManipulator original, Cloner cloner) : base(original, cloner) { } 45 49 protected IntegerVectorManipulator() 46 50 : base() { -
branches/CloningRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Manipulators/UniformOnePositionManipulator.cs
r4068 r4664 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Encodings.IntegerVectorEncoding { … … 49 50 } 50 51 52 [StorableConstructor] 53 protected UniformOnePositionManipulator(bool deserializing) : base(deserializing) { } 54 protected UniformOnePositionManipulator(UniformOnePositionManipulator original, Cloner cloner) : base(original, cloner) { } 51 55 /// <summary> 52 56 /// Initializes a new instance of <see cref="UniformOnePositionManipulator"/> with two parameters 53 57 /// (<c>Minimum</c> and <c>Maximum</c>). 54 58 /// </summary> 55 public UniformOnePositionManipulator() { 59 public UniformOnePositionManipulator() 60 : base() { 56 61 Parameters.Add(new ValueLookupParameter<IntValue>("Minimum", "Minimum of the sampling range for the vector element (included)")); 57 62 Parameters.Add(new ValueLookupParameter<IntValue>("Maximum", "Maximum of the sampling range for the vector element (excluded)")); 63 } 64 65 public override IDeepCloneable Clone(Cloner cloner) { 66 return new UniformOnePositionManipulator(this, cloner); 58 67 } 59 68
Note: See TracChangeset
for help on using the changeset viewer.