Changeset 8303 for branches/ScatterSearch (trunk integration)
- Timestamp:
- 07/19/12 11:04:48 (12 years ago)
- Location:
- branches/ScatterSearch (trunk integration)
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ScatterSearch (trunk integration)/HeuristicLab.Optimization.Operators/3.3/SimilarityCalculator.cs
r8299 r8303 43 43 [StorableConstructor] 44 44 protected SimilarityCalculator(bool deserializing) : base(deserializing) { } 45 protected SimilarityCalculator(SimilarityCalculator original, Cloner cloner) : base(original, cloner) { } 45 protected SimilarityCalculator(SimilarityCalculator original, Cloner cloner) 46 : base(original, cloner) { 47 if (original.Target != null) 48 this.target = (string)original.Target.Clone(); 49 } 46 50 protected SimilarityCalculator() : base() { } 47 51 … … 55 59 56 60 protected abstract double CalculateSimilarity(IScope left, IScope right); 57 58 public override IDeepCloneable Clone(Cloner cloner) { return null; }59 61 } 60 62 } -
branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.Knapsack/3.3/SimilarityCalculators/KnapsackSimilarityCalculator.cs
r8086 r8303 36 36 public KnapsackSimilarityCalculator() : base() { } 37 37 38 public override IDeepCloneable Clone(Cloner cloner) { 39 return new KnapsackSimilarityCalculator(this, cloner); 40 } 41 38 42 public static double CalculateSimilarity(BinaryVector left, BinaryVector right) { 39 43 if (left == null || right == null) -
branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.TestFunctions/3.3/SimilarityCalculators/SingleObjectiveTestFunctionSimilarityCalculator.cs
r8086 r8303 26 26 using HeuristicLab.Encodings.RealVectorEncoding; 27 27 using HeuristicLab.Optimization.Operators; 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 29 29 30 namespace HeuristicLab.Problems.TestFunctions { … … 32 33 /// </summary> 33 34 [Item("SingleObjectiveTestFunctionSimilarityCalculator", "An operator that performs similarity calculation between two test functions solutions.")] 35 [StorableClass] 34 36 public sealed class SingleObjectiveTestFunctionSimilarityCalculator : SimilarityCalculator { 35 37 #region Properties 38 [Storable] 36 39 public DoubleMatrix Bounds { get; set; } 37 40 #endregion 38 41 42 [StorableConstructor] 39 43 private SingleObjectiveTestFunctionSimilarityCalculator(bool deserializing) : base(deserializing) { } 40 private SingleObjectiveTestFunctionSimilarityCalculator(SingleObjectiveTestFunctionSimilarityCalculator original, Cloner cloner) : base(original, cloner) { } 44 private SingleObjectiveTestFunctionSimilarityCalculator(SingleObjectiveTestFunctionSimilarityCalculator original, Cloner cloner) 45 : base(original, cloner) { 46 this.Bounds = cloner.Clone(original.Bounds); 47 } 41 48 public SingleObjectiveTestFunctionSimilarityCalculator() : base() { } 49 50 public override IDeepCloneable Clone(Cloner cloner) { 51 return new SingleObjectiveTestFunctionSimilarityCalculator(this, cloner); 52 } 42 53 43 54 public static double CalculateSimilarity(RealVector left, RealVector right, DoubleMatrix bounds) { -
branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.TravelingSalesman/3.3/SimilarityCalculators/TSPSimilarityCalculator.cs
r8086 r8303 36 36 public TSPSimilarityCalculator() : base() { } 37 37 38 public override IDeepCloneable Clone(Cloner cloner) { 39 return new TSPSimilarityCalculator(this, cloner); 40 } 41 38 42 public static double CalculateSimilarity(Permutation left, Permutation right) { 39 43 if (left == null || right == null) -
branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.VehicleRouting/3.3/SimilarityCalculators/VRPSimilarityCalculator.cs
r8086 r8303 38 38 private VRPSimilarityCalculator(VRPSimilarityCalculator original, Cloner cloner) : base(original, cloner) { } 39 39 public VRPSimilarityCalculator() : base() { } 40 41 public override IDeepCloneable Clone(Cloner cloner) { 42 return new VRPSimilarityCalculator(this, cloner); 43 } 40 44 41 45 public static double CalculateSimilarity(PotvinEncoding left, PotvinEncoding right) {
Note: See TracChangeset
for help on using the changeset viewer.