Changeset 4692
- Timestamp:
- 10/29/10 20:36:25 (14 years ago)
- Location:
- branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Tour.cs
r4174 r4692 32 32 public List<int> Cities { get; private set; } 33 33 34 [StorableConstructor] 35 protected Tour(bool deserializing) : base(deserializing) { } 36 protected Tour(Tour original, Cloner cloner) 37 : base(original, cloner) { 38 Cities = new List<int>(original.Cities); 39 } 34 40 public Tour() { 35 41 Cities = new List<int>(); … … 37 43 38 44 public override IDeepCloneable Clone(Cloner cloner) { 39 Tour clone = base.Clone(cloner) as Tour; 40 clone.Cities = new List<int>(Cities); 41 42 return clone; 45 return new Tour(this, cloner); 43 46 } 44 47 … … 63 66 return eval.Overload < double.Epsilon && eval.Tardiness < double.Epsilon; 64 67 } 65 66 public double GetLength(DoubleMatrix coordinates, 67 ILookupParameter<DoubleMatrix> distanceMatrix, 68 69 public double GetLength(DoubleMatrix coordinates, 70 ILookupParameter<DoubleMatrix> distanceMatrix, 68 71 BoolValue useDistanceMatrix) { 69 72 double length = 0; … … 79 82 for (int i = 1; i < cities.Count; i++) { 80 83 length += VRPUtilities.GetDistance( 81 cities[i - 1], cities[i], coordinates, distanceMatrix, useDistanceMatrix); 84 cities[i - 1], cities[i], coordinates, distanceMatrix, useDistanceMatrix); 82 85 } 83 86 } -
branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/VRPCreator.cs
r4352 r4692 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings { … … 41 42 [StorableConstructor] 42 43 protected VRPCreator(bool deserializing) : base(deserializing) { } 43 44 protected VRPCreator(VRPCreator original, Cloner cloner) 45 : base(original, cloner) { 46 } 44 47 public VRPCreator() 45 48 : base() { 46 49 Parameters.Add(new LookupParameter<IVRPEncoding>("VRPTours", "The new VRP tours.")); 47 50 } 48 49 51 #endregion 50 52 } -
branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/VRPCrossover.cs
r4179 r4692 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings { … … 44 45 [StorableConstructor] 45 46 protected VRPCrossover(bool deserializing) : base(deserializing) { } 46 47 protected VRPCrossover(VRPCrossover original, Cloner cloner) 48 : base(original, cloner) { 49 } 47 50 public VRPCrossover() 48 51 : base() { -
branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/VRPManipulator.cs
r4183 r4692 25 25 using HeuristicLab.Data; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings { … … 40 41 [StorableConstructor] 41 42 protected VRPManipulator(bool deserializing) : base(deserializing) { } 42 43 protected VRPManipulator(VRPManipulator original, Cloner cloner) 44 : base(original, cloner) { 45 } 43 46 public VRPManipulator() 44 47 : base() { -
branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/VRPMoveOperator.cs
r4179 r4692 25 25 using HeuristicLab.Data; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings { … … 35 36 get { return (ILookupParameter<IVRPEncoding>)Parameters["VRPTours"]; } 36 37 } 37 38 38 39 #endregion 39 40 40 41 [StorableConstructor] 41 42 protected VRPMoveOperator(bool deserializing) : base(deserializing) { } 42 43 protected VRPMoveOperator(VRPMoveOperator original, Cloner cloner) : base(original, cloner) { } 43 44 public VRPMoveOperator() 44 45 : base() {
Note: See TracChangeset
for help on using the changeset viewer.