Changeset 4752 for branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4
- Timestamp:
- 11/09/10 09:55:31 (14 years ago)
- Location:
- branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4
- Files:
-
- 106 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/BestAverageWorstVRPToursAnalyzer.cs
r4374 r4752 178 178 private BestAverageWorstVRPToursAnalyzer(bool deserializing) : base() { } 179 179 180 public override IDeepCloneable Clone(Cloner cloner) { 181 return new BestAverageWorstVRPToursAnalyzer(this, cloner); 182 } 183 184 private BestAverageWorstVRPToursAnalyzer(BestAverageWorstVRPToursAnalyzer original, Cloner cloner) 185 : base(original, cloner) { 186 this.Initialize(); 187 } 188 180 189 [StorableHook(HookType.AfterDeserialization)] 181 190 private void Initialize() { … … 184 193 } 185 194 186 public override IDeepCloneable Clone(Cloner cloner) {187 BestAverageWorstVRPToursAnalyzer clone = (BestAverageWorstVRPToursAnalyzer)base.Clone(cloner);188 clone.Initialize();189 return clone;190 }191 192 195 void DistanceParameter_DepthChanged(object sender, EventArgs e) { 193 196 BestAverageWorstCalculator.DistanceParameter.Depth = DistanceParameter.Depth; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/BestAverageWorstVRPToursCalculator.cs
r4374 r4752 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 { … … 67 68 Parameters.Add(new ValueLookupParameter<DoubleValue>("AverageVehiclesUtilized", "The average utilized vehicles value of all solutions.")); 68 69 Parameters.Add(new ValueLookupParameter<DoubleValue>("WorstVehiclesUtilized", "The worst utilized vehicles value of all solutions.")); 70 } 71 72 [StorableConstructor] 73 private BestAverageWorstVRPToursCalculator(bool deserializing) : base(deserializing) { } 74 75 public override IDeepCloneable Clone(Cloner cloner) { 76 return new BestAverageWorstVRPToursCalculator(this, cloner); 77 } 78 79 private BestAverageWorstVRPToursCalculator(BestAverageWorstVRPToursCalculator original, Cloner cloner) 80 : base(original, cloner) { 69 81 } 70 82 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/BestVRPToursMemorizer.cs
r4374 r4752 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Problems.VehicleRouting { … … 55 56 } 56 57 58 [StorableConstructor] 59 protected BestVRPToursMemorizer(bool deserializing) : base(deserializing) { } 60 61 public override IDeepCloneable Clone(Cloner cloner) { 62 return new BestVRPToursMemorizer(this, cloner); 63 } 64 65 protected BestVRPToursMemorizer(BestVRPToursMemorizer original, Cloner cloner) 66 : base(original, cloner) { 67 } 68 57 69 public override IOperation Apply() { 58 70 int i = DistanceParameter.ActualValue.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/Capacitated/BestAverageWorstCapacitatedVRPToursAnalyzer.cs
r4376 r4752 137 137 138 138 public override IDeepCloneable Clone(Cloner cloner) { 139 BestAverageWorstCapaciatatedVRPToursAnalyzer clone = (BestAverageWorstCapaciatatedVRPToursAnalyzer)base.Clone(cloner); 140 clone.Initialize(); 141 return clone; 139 return new BestAverageWorstCapaciatatedVRPToursAnalyzer(this, cloner); 140 } 141 142 private BestAverageWorstCapaciatatedVRPToursAnalyzer(BestAverageWorstCapaciatatedVRPToursAnalyzer original, Cloner cloner) 143 : base(original, cloner) { 144 this.Initialize(); 142 145 } 143 146 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/Capacitated/BestAverageWorstCapacitatedVRPToursCalculator.cs
r4374 r4752 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 { … … 50 51 Parameters.Add(new ValueLookupParameter<DoubleValue>("WorstOverload", "The worst overload value of all solutions.")); 51 52 } 53 54 public override IDeepCloneable Clone(Cloner cloner) { 55 return new BestAverageWorstCapacitatedVRPToursCalculator(this, cloner); 56 } 57 58 private BestAverageWorstCapacitatedVRPToursCalculator(BestAverageWorstCapacitatedVRPToursCalculator original, Cloner cloner) 59 : base(original, cloner) { 60 } 61 62 [StorableConstructor] 63 private BestAverageWorstCapacitatedVRPToursCalculator(bool deserializing) : base(deserializing) { } 52 64 53 65 private void UpdateOverloads() { -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/Capacitated/BestCapacitatedVRPToursMemorizer.cs
r4374 r4752 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Problems.VehicleRouting { … … 46 47 } 47 48 49 public override IDeepCloneable Clone(Cloner cloner) { 50 return new BestCapacitatedVRPToursMemorizer(this, cloner); 51 } 52 53 protected BestCapacitatedVRPToursMemorizer(BestCapacitatedVRPToursMemorizer original, Cloner cloner) 54 : base(original, cloner) { 55 } 56 57 [StorableConstructor] 58 protected BestCapacitatedVRPToursMemorizer(bool deserializing) : base(deserializing) { } 59 48 60 public override IOperation Apply() { 49 61 int i = OverloadParameter.ActualValue.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/TimeWindowed/BestAverageWorstTimeWindowedVRPToursAnalyzer.cs
r4374 r4752 185 185 186 186 public override IDeepCloneable Clone(Cloner cloner) { 187 BestAverageWorstTimeWindowedVRPToursAnalyzer clone = (BestAverageWorstTimeWindowedVRPToursAnalyzer)base.Clone(cloner); 188 clone.Initialize(); 189 return clone; 187 return new BestAverageWorstTimeWindowedVRPToursAnalyzer(this, cloner); 188 } 189 190 private BestAverageWorstTimeWindowedVRPToursAnalyzer(BestAverageWorstTimeWindowedVRPToursAnalyzer original, Cloner cloner) 191 : base(original, cloner) { 192 this.Initialize(); 190 193 } 191 194 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/TimeWindowed/BestAverageWorstTimeWindowedVRPToursCalculator.cs
r4374 r4752 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 { … … 67 68 Parameters.Add(new ValueLookupParameter<DoubleValue>("AverageTravelTime", "The average travel time value of all solutions.")); 68 69 Parameters.Add(new ValueLookupParameter<DoubleValue>("WorstTravelTime", "The worst travel time value of all solutions.")); 70 } 71 72 [StorableConstructor] 73 private BestAverageWorstTimeWindowedVRPToursCalculator(bool deserializing) : base(deserializing) { } 74 75 public override IDeepCloneable Clone(Cloner cloner) { 76 return new BestAverageWorstTimeWindowedVRPToursCalculator(this, cloner); 77 } 78 79 private BestAverageWorstTimeWindowedVRPToursCalculator(BestAverageWorstTimeWindowedVRPToursCalculator original, Cloner cloner) 80 : base(original, cloner) { 69 81 } 70 82 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/TimeWindowed/BestTimeWindowedVRPToursMemorizer.cs
r4374 r4752 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Problems.VehicleRouting { … … 69 70 return base.Apply(); 70 71 } 72 73 [StorableConstructor] 74 protected BestTimeWindowedVRPToursMemorizer(bool deserializing) : base(deserializing) { } 75 76 public override IDeepCloneable Clone(Cloner cloner) { 77 return new BestTimeWindowedVRPToursMemorizer(this, cloner); 78 } 79 80 protected BestTimeWindowedVRPToursMemorizer(BestTimeWindowedVRPToursMemorizer original, Cloner cloner) 81 : base(original, cloner) { 82 } 71 83 } 72 84 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/BestVRPSolutionAnalyzer.cs
r4374 r4752 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 30 using HeuristicLab.Problems.VehicleRouting.Variants; 31 using HeuristicLab.Common; 31 32 32 33 namespace HeuristicLab.Problems.VehicleRouting { … … 77 78 } 78 79 80 public override IDeepCloneable Clone(Cloner cloner) { 81 return new BestVRPSolutionAnalyzer(this, cloner); 82 } 83 84 private BestVRPSolutionAnalyzer(BestVRPSolutionAnalyzer original, Cloner cloner) 85 : base(original, cloner) { 86 } 87 79 88 public override IOperation Apply() { 80 89 IVRPProblemInstance problemInstance = ProblemInstanceParameter.ActualValue; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/Capacitated/BestCapacitatedVRPSolutionAnalyzer.cs
r4454 r4752 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 30 using HeuristicLab.Problems.VehicleRouting.Variants; 31 using HeuristicLab.Common; 31 32 32 33 namespace HeuristicLab.Problems.VehicleRouting { … … 73 74 } 74 75 76 public override IDeepCloneable Clone(Cloner cloner) { 77 return new BestCapacitatedVRPSolutionAnalyzer(this, cloner); 78 } 79 80 private BestCapacitatedVRPSolutionAnalyzer(BestCapacitatedVRPSolutionAnalyzer original, Cloner cloner) 81 : base(original, cloner) { 82 } 83 75 84 public override IOperation Apply() { 76 85 ItemArray<IVRPEncoding> solutions = VRPToursParameter.ActualValue; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/TimeWindowed/BestTimeWindowedVRPSolutionAnalyzer.cs
r4454 r4752 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 30 using HeuristicLab.Problems.VehicleRouting.Variants; 31 using HeuristicLab.Common; 31 32 32 33 namespace HeuristicLab.Problems.VehicleRouting { … … 77 78 } 78 79 80 public override IDeepCloneable Clone(Cloner cloner) { 81 return new BestTimeWindowedVRPSolutionAnalyzer(this, cloner); 82 } 83 84 private BestTimeWindowedVRPSolutionAnalyzer(BestTimeWindowedVRPSolutionAnalyzer original, Cloner cloner) 85 : base(original, cloner) { 86 } 87 79 88 public override IOperation Apply() { 80 89 ItemArray<IVRPEncoding> solutions = VRPToursParameter.ActualValue; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/VRPSolution.cs
r4374 r4752 99 99 } 100 100 101 101 102 public override IDeepCloneable Clone(Cloner cloner) { 102 VRPSolution clone = new VRPSolution(); 103 cloner.RegisterClonedObject(this, clone); 104 clone.problemInstance = (IVRPProblemInstance)cloner.Clone(problemInstance); 105 clone.solution = (IVRPEncoding)cloner.Clone(solution); 106 clone.quality = (DoubleValue)cloner.Clone(quality); 107 108 clone.Initialize(); 109 return clone; 103 return new VRPSolution(this, cloner); 104 } 105 106 private VRPSolution(VRPSolution original, Cloner cloner) 107 : base(original, cloner) { 108 this.problemInstance = (IVRPProblemInstance)cloner.Clone(original.problemInstance); 109 this.solution = (IVRPEncoding)cloner.Clone(original.solution); 110 this.quality = (DoubleValue)cloner.Clone(original.quality); 111 112 this.Initialize(); 110 113 } 111 114 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/AlbaEncoding.cs
r4383 r4752 81 81 #endregion 82 82 83 public override IDeepCloneable Clone(HeuristicLab.Common.Cloner cloner) {84 AlbaEncoding clone = new AlbaEncoding(85 new Permutation(this.PermutationType, new IntArray(this.array)), ProblemInstance);86 cloner.RegisterClonedObject(this, clone);87 clone.readOnly = readOnly;88 return clone;89 }90 91 83 public AlbaEncoding(Permutation permutation, IVRPProblemInstance instance) 92 84 : base(permutation, instance) { … … 96 88 private AlbaEncoding(bool serializing) 97 89 : base(serializing) { 90 } 91 92 public override IDeepCloneable Clone(Cloner cloner) { 93 return new AlbaEncoding(this, cloner); 94 } 95 96 protected AlbaEncoding(AlbaEncoding original, Cloner cloner) 97 : base(original, cloner) { 98 98 } 99 99 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Creators/AlbaCreator.cs
r4369 r4752 27 27 using HeuristicLab.Problems.VehicleRouting.Interfaces; 28 28 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 29 using HeuristicLab.Common; 29 30 30 31 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 42 43 : base() { 43 44 } 45 46 protected AlbaCreator(AlbaCreator original, Cloner cloner) 47 : base(original, cloner) { 48 } 44 49 } 45 50 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Creators/DefaultRepresentationCreator.cs
r4365 r4752 28 28 using HeuristicLab.Problems.VehicleRouting.Encodings; 29 29 using HeuristicLab.Problems.VehicleRouting.Variants; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 40 41 public DefaultRepresentationCreator() : base() { } 41 42 43 protected DefaultRepresentationCreator(DefaultRepresentationCreator original, Cloner cloner) 44 : base(original, cloner) { 45 } 46 42 47 public override IOperation Apply() { 43 48 //choose default encoding here … … 45 50 46 51 return base.Apply(); 47 } 52 } 48 53 } 49 54 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Creators/PushForwardInsertionCreator.cs
r4365 r4752 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 30 using HeuristicLab.Problems.VehicleRouting.Variants; 31 using HeuristicLab.Common; 31 32 32 33 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 71 72 Parameters.Add(new ValueParameter<DoubleValue>("Gamma", "The gamma value.", new DoubleValue(0.2))); 72 73 Parameters.Add(new ValueParameter<DoubleValue>("GammaVariance", "The gamma variance.", new DoubleValue(0.14))); 74 } 75 76 public override IDeepCloneable Clone(Cloner cloner) { 77 return new PushForwardCreator(this, cloner); 78 } 79 80 private PushForwardCreator(PushForwardCreator original, Cloner cloner) 81 : base(original, cloner) { 73 82 } 74 83 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Creators/RandomCreator.cs
r4362 r4752 28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 45 46 : base() { 46 47 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator.")); 48 } 49 50 public override IDeepCloneable Clone(Cloner cloner) { 51 return new RandomCreator(this, cloner); 52 } 53 54 private RandomCreator(RandomCreator original, Cloner cloner) 55 : base(original, cloner) { 47 56 } 48 57 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Crossovers/AlbaCrossover.cs
r4376 r4752 28 28 using HeuristicLab.Problems.VehicleRouting.Interfaces; 29 29 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 44 45 : base() { 45 46 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators.")); 47 } 48 49 protected AlbaCrossover(AlbaCrossover original, Cloner cloner) 50 : base(original, cloner) { 46 51 } 47 52 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Crossovers/AlbaPermutationCrossover.cs
r4365 r4752 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 26 using HeuristicLab.Data; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 40 41 : base() { 41 42 Parameters.Add(new ValueLookupParameter<IPermutationCrossover>("InnerCrossover", "The permutation crossover.", new EdgeRecombinationCrossover())); 43 } 44 45 public override IDeepCloneable Clone(Cloner cloner) { 46 return new AlbaPermutationCrossover(this, cloner); 47 } 48 49 private AlbaPermutationCrossover(AlbaPermutationCrossover original, Cloner cloner) 50 : base(original, cloner) { 42 51 } 43 52 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaCustomerInsertionManipulator.cs
r4365 r4752 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 26 using HeuristicLab.Data; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 35 36 public AlbaCustomerInsertionManipulator() 36 37 : base() { 38 } 39 40 public override IDeepCloneable Clone(Cloner cloner) { 41 return new AlbaCustomerInsertionManipulator(this, cloner); 42 } 43 44 private AlbaCustomerInsertionManipulator(AlbaCustomerInsertionManipulator original, Cloner cloner) 45 : base(original, cloner) { 37 46 } 38 47 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaCustomerInversionManipulator.cs
r4365 r4752 26 26 using HeuristicLab.Data; 27 27 using System.Collections.Generic; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 36 37 public AlbaCustomerInversionManipulator() 37 38 : base() { 39 } 40 41 public override IDeepCloneable Clone(Cloner cloner) { 42 return new AlbaCustomerInversionManipulator(this, cloner); 43 } 44 45 private AlbaCustomerInversionManipulator(AlbaCustomerInversionManipulator original, Cloner cloner) 46 : base(original, cloner) { 38 47 } 39 48 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaCustomerSwapManipulator.cs
r4365 r4752 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 26 using HeuristicLab.Data; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 35 36 public AlbaCustomerSwapManipulator() 36 37 : base() { 38 } 39 40 public override IDeepCloneable Clone(Cloner cloner) { 41 return new AlbaCustomerSwapManipulator(this, cloner); 42 } 43 44 private AlbaCustomerSwapManipulator(AlbaCustomerSwapManipulator original, Cloner cloner) 45 : base(original, cloner) { 37 46 } 38 47 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaIntraRouteInversionManipulator.cs
r4365 r4752 27 27 using System; 28 28 using System.Collections.Generic; 29 using HeuristicLab.Common; 29 30 30 31 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 38 39 : base() { 39 40 } 41 42 public override IDeepCloneable Clone(Cloner cloner) { 43 return new AlbaIntraRouteInversionManipulator(this, cloner); 44 } 45 46 private AlbaIntraRouteInversionManipulator(AlbaIntraRouteInversionManipulator original, Cloner cloner) 47 : base(original, cloner) { 48 } 40 49 41 50 public static void Apply(AlbaEncoding individual, int index1, int index2) { -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaLambdaInterchangeManipulator.cs
r4365 r4752 27 27 using System; 28 28 using System.Collections.Generic; 29 using HeuristicLab.Common; 29 30 30 31 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 43 44 Parameters.Add(new ValueParameter<IntValue>("Lambda", "The lambda value.", new IntValue(1))); 44 45 } 46 47 public override IDeepCloneable Clone(Cloner cloner) { 48 return new AlbaLambdaInterchangeManipulator(this, cloner); 49 } 50 51 private AlbaLambdaInterchangeManipulator(AlbaLambdaInterchangeManipulator original, Cloner cloner) 52 : base(original, cloner) { 53 } 45 54 46 55 public static void Apply(AlbaEncoding individual, int tour1Index, int position1, int length1, … … 100 109 protected override void Manipulate(IRandom rand, AlbaEncoding individual) { 101 110 List<Tour> tours = individual.GetTours(); 102 int lambda = LambdaParameter.Value.Value; 111 if (tours.Count > 1) { 112 int lambda = LambdaParameter.Value.Value; 103 113 104 int route1Index = rand.Next(tours.Count);105 Tour route1 = tours[route1Index];114 int route1Index = rand.Next(tours.Count); 115 Tour route1 = tours[route1Index]; 106 116 107 int route2Index = rand.Next(tours.Count - 1);108 if (route2Index >= route1Index)109 route2Index += 1;110 Tour route2 = tours[route2Index];111 117 112 int length1 = rand.Next(Math.Min(lambda + 1, route1.Stops.Count + 1)); 113 int index1 = rand.Next(route1.Stops.Count - length1 + 1); 118 int route2Index = rand.Next(tours.Count - 1); 119 if (route2Index >= route1Index) 120 route2Index += 1; 121 Tour route2 = tours[route2Index]; 114 122 115 int l2Min = 0; 116 if (length1 == 0) 117 l2Min = 1; 118 int length2 = rand.Next(l2Min, Math.Min(lambda + 1, route2.Stops.Count + 1)); 119 int index2 = rand.Next(route2.Stops.Count - length2 + 1); 123 int length1 = rand.Next(Math.Min(lambda + 1, route1.Stops.Count + 1)); 124 int index1 = rand.Next(route1.Stops.Count - length1 + 1); 120 125 121 Apply(individual, route1Index, index1, length1, 122 route2Index, index2, length2); 126 int l2Min = 0; 127 if (length1 == 0) 128 l2Min = 1; 129 int length2 = rand.Next(l2Min, Math.Min(lambda + 1, route2.Stops.Count + 1)); 130 int index2 = rand.Next(route2.Stops.Count - length2 + 1); 131 132 Apply(individual, route1Index, index1, length1, 133 route2Index, index2, length2); 134 } 123 135 } 124 136 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaManipulator.cs
r4376 r4752 28 28 using HeuristicLab.Problems.VehicleRouting.Interfaces; 29 29 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 43 44 : base() { 44 45 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators.")); 46 } 47 48 protected AlbaManipulator(AlbaManipulator original, Cloner cloner) 49 : base(original, cloner) { 45 50 } 46 51 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaPermutationManipulator.cs
r4365 r4752 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 26 using HeuristicLab.Data; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 42 43 } 43 44 45 public override IDeepCloneable Clone(Cloner cloner) { 46 return new AlbaPermutationManipualtor(this, cloner); 47 } 48 49 private AlbaPermutationManipualtor(AlbaPermutationManipualtor original, Cloner cloner) 50 : base(original, cloner) { 51 } 52 44 53 protected override void Manipulate(IRandom random, AlbaEncoding individual) { 45 54 InnerManipulatorParameter.ActualValue.PermutationParameter.ActualName = VRPToursParameter.ActualName; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/AlbaMoveEvaluator.cs
r4369 r4752 27 27 using HeuristicLab.Core; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.Common; 29 30 30 31 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 38 39 : base() { 39 40 } 41 42 protected AlbaMoveEvaluator(AlbaMoveEvaluator original, Cloner cloner) 43 : base(original, cloner) { 44 } 40 45 } 41 46 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/AlbaMoveGenerator.cs
r4376 r4752 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 40 41 } 41 42 43 protected AlbaMoveGenerator(AlbaMoveGenerator original, Cloner cloner) 44 : base(original, cloner) { 45 } 46 42 47 public override IOperation Apply() { 43 48 IVRPEncoding solution = VRPToursParameter.ActualValue; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/AlbaMoveMaker.cs
r4378 r4752 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 39 40 : base() { 40 41 } 42 43 protected AlbaMoveMaker(AlbaMoveMaker original, Cloner cloner) 44 : base(original, cloner) { 45 } 41 46 } 42 47 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/IntraRouteInversion/AlbaExhaustiveIntraRouteInversionMoveGenerator.cs
r4370 r4752 28 28 using System.Collections.Generic; 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 38 39 public AlbaExhaustiveIntraRouteInversionGenerator() 39 40 : base() { 41 } 42 43 public override IDeepCloneable Clone(Cloner cloner) { 44 return new AlbaExhaustiveIntraRouteInversionGenerator(this, cloner); 45 } 46 47 private AlbaExhaustiveIntraRouteInversionGenerator(AlbaExhaustiveIntraRouteInversionGenerator original, Cloner cloner) 48 : base(original, cloner) { 40 49 } 41 50 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/IntraRouteInversion/AlbaIntraRouteInversionEvaluator.cs
r4383 r4752 26 26 using HeuristicLab.Problems.VehicleRouting.Encodings.Alba; 27 27 using HeuristicLab.Data; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Problems.VehicleRouting { … … 47 48 } 48 49 50 public override IDeepCloneable Clone(Cloner cloner) { 51 return new AlbaIntraRouteInversionMoveEvaluator(this, cloner); 52 } 53 54 private AlbaIntraRouteInversionMoveEvaluator(AlbaIntraRouteInversionMoveEvaluator original, Cloner cloner) 55 : base(original, cloner) { 56 } 57 49 58 protected override void EvaluateMove() { 50 59 AlbaEncoding newSolution = IntraRouteInversionMoveParameter.ActualValue.Permutation.Clone() as AlbaEncoding; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/IntraRouteInversion/AlbaIntraRouteInversionMove.cs
r4383 r4752 46 46 } 47 47 48 public override IDeepCloneable Clone( HeuristicLab.Common.Cloner cloner) {49 AlbaIntraRouteInversionMove clone = new AlbaIntraRouteInversionMove(50 Index1, Index2);48 public override IDeepCloneable Clone(Cloner cloner) { 49 return new AlbaIntraRouteInversionMove(this, cloner); 50 } 51 51 52 if (Permutation != null) 53 clone.Permutation = Permutation.Clone() as AlbaEncoding; 54 55 cloner.RegisterClonedObject(this, clone); 56 return clone; 52 protected AlbaIntraRouteInversionMove(AlbaIntraRouteInversionMove original, Cloner cloner) 53 : base(original, cloner) { 54 if (Permutation != null) 55 this.Permutation = cloner.Clone(original.Permutation); 57 56 } 58 57 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/IntraRouteInversion/AlbaIntraRouteInversionMoveGenerator.cs
r4370 r4752 28 28 using System.Collections.Generic; 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 54 55 } 55 56 57 protected AlbaIntraRouteInversionMoveGenerator(AlbaIntraRouteInversionMoveGenerator original, Cloner cloner) 58 : base(original, cloner) { 59 } 60 56 61 protected abstract AlbaIntraRouteInversionMove[] GenerateMoves(AlbaEncoding individual, IVRPProblemInstance problemInstance); 57 62 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/IntraRouteInversion/AlbaIntraRouteInversionMoveMaker.cs
r4383 r4752 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 47 48 } 48 49 50 public override IDeepCloneable Clone(Cloner cloner) { 51 return new AlbaIntraRouteInversionMoveMaker(this, cloner); 52 } 53 54 protected AlbaIntraRouteInversionMoveMaker(AlbaIntraRouteInversionMoveMaker original, Cloner cloner) 55 : base(original, cloner) { 56 } 57 49 58 public static void Apply(AlbaEncoding solution, AlbaIntraRouteInversionMove move) { 50 59 AlbaIntraRouteInversionManipulator.Apply(solution, move.Index1, move.Index2); -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/IntraRouteInversion/AlbaStochasticIntraRouteInversionMutliMoveGenerator.cs
r4370 r4752 29 29 using HeuristicLab.Data; 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 using HeuristicLab.Common; 31 32 32 33 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 51 52 } 52 53 54 public override IDeepCloneable Clone(Cloner cloner) { 55 return new AlbaStochasticIntraRouteInversionMultiMoveGenerator(this, cloner); 56 } 57 58 private AlbaStochasticIntraRouteInversionMultiMoveGenerator(AlbaStochasticIntraRouteInversionMultiMoveGenerator original, Cloner cloner) 59 : base(original, cloner) { 60 } 61 53 62 protected override AlbaIntraRouteInversionMove[] GenerateMoves(AlbaEncoding individual, IVRPProblemInstance problemInstance) { 54 63 int sampleSize = SampleSizeParameter.ActualValue.Value; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/IntraRouteInversion/AlbaStochasticIntraRouteInversionSingleMoveGenerator.cs
r4370 r4752 29 29 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 using HeuristicLab.Common; 31 32 32 33 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 53 54 : base() { 54 55 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator.")); 56 } 57 58 public override IDeepCloneable Clone(Cloner cloner) { 59 return new AlbaStochasticIntraRouteInversionSingleMoveGenerator(this, cloner); 60 } 61 62 private AlbaStochasticIntraRouteInversionSingleMoveGenerator(AlbaStochasticIntraRouteInversionSingleMoveGenerator original, Cloner cloner) 63 : base(original, cloner) { 55 64 } 56 65 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/LambdaInterchange/AlbaExhaustiveLambdaInterchangeMoveGenerator.cs
r4370 r4752 28 28 using System.Collections.Generic; 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 38 39 public AlbaExhaustiveLambdaInterchangeMoveGenerator() 39 40 : base() { 41 } 42 43 public override IDeepCloneable Clone(Cloner cloner) { 44 return new AlbaExhaustiveLambdaInterchangeMoveGenerator(this, cloner); 45 } 46 47 private AlbaExhaustiveLambdaInterchangeMoveGenerator(AlbaExhaustiveLambdaInterchangeMoveGenerator original, Cloner cloner) 48 : base(original, cloner) { 40 49 } 41 50 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/LambdaInterchange/AlbaLambdaInterchangeMove.cs
r4383 r4752 79 79 } 80 80 81 public override IDeepCloneable Clone(HeuristicLab.Common.Cloner cloner) { 82 AlbaLambdaInterchangeMove clone = new AlbaLambdaInterchangeMove(); 83 84 clone.Tour1 = Tour1; 85 clone.Position1 = Position1; 86 clone.Length1 = Length1; 87 88 clone.Tour2 = Tour2; 89 clone.Position2 = Position2; 90 clone.Length2 = Length2; 91 92 if (Individual != null) 93 clone.Individual = Individual.Clone() as AlbaEncoding; 94 95 cloner.RegisterClonedObject(this, clone); 96 return clone; 81 public override IDeepCloneable Clone(Cloner cloner) { 82 return new AlbaLambdaInterchangeMove(this, cloner); 97 83 } 98 84 85 protected AlbaLambdaInterchangeMove(AlbaLambdaInterchangeMove original, Cloner cloner) 86 : base(original, cloner) { 87 this.Tour1 = original.Tour1; 88 this.Position1 = original.Position1; 89 this.Length1 = original.Length1; 99 90 91 this.Tour2 = original.Tour2; 92 this.Position2 = original.Position2; 93 this.Length2 = original.Length2; 94 95 this.Individual = cloner.Clone(Individual) as AlbaEncoding; 96 } 100 97 101 98 #region IVRPMove Members -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/LambdaInterchange/AlbaLambdaInterchangeMoveEvaluator.cs
r4383 r4752 26 26 using HeuristicLab.Problems.VehicleRouting.Encodings.Alba; 27 27 using HeuristicLab.Data; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Problems.VehicleRouting { … … 47 48 } 48 49 50 public override IDeepCloneable Clone(Cloner cloner) { 51 return new AlbaLambdaInterchangeMoveEvaluator(this, cloner); 52 } 53 54 private AlbaLambdaInterchangeMoveEvaluator(AlbaLambdaInterchangeMoveEvaluator original, Cloner cloner) 55 : base(original, cloner) { 56 } 57 49 58 protected override void EvaluateMove() { 50 59 AlbaEncoding newSolution = LambdaInterchangeMoveParameter.ActualValue.Individual.Clone() as AlbaEncoding; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/LambdaInterchange/AlbaLambdaInterchangeMoveGenerator.cs
r4370 r4752 29 29 using HeuristicLab.Data; 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 using HeuristicLab.Common; 31 32 32 33 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 64 65 } 65 66 67 protected AlbaLambdaInterchangeMoveGenerator(AlbaLambdaInterchangeMoveGenerator original, Cloner cloner) 68 : base(original, cloner) { 69 } 70 66 71 protected abstract AlbaLambdaInterchangeMove[] GenerateMoves(AlbaEncoding individual, IVRPProblemInstance problemInstance, int lambda); 67 72 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/LambdaInterchange/AlbaLambdaInterchangeMoveMaker.cs
r4383 r4752 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 28 using System.Collections.Generic; 29 using HeuristicLab.Common; 29 30 30 31 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 51 52 } 52 53 54 public override IDeepCloneable Clone(Cloner cloner) { 55 return new AlbaLambdaInterchangeMoveMaker(this, cloner); 56 } 57 58 protected AlbaLambdaInterchangeMoveMaker(AlbaLambdaInterchangeMoveMaker original, Cloner cloner) 59 : base(original, cloner) { 60 } 61 53 62 public static void Apply(AlbaEncoding solution, AlbaLambdaInterchangeMove move) { 54 63 AlbaLambdaInterchangeManipulator.Apply( -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/LambdaInterchange/AlbaStochasticLambdaInterchangeMutliMoveGenerator.cs
r4370 r4752 29 29 using HeuristicLab.Data; 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 using HeuristicLab.Common; 31 32 32 33 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 51 52 } 52 53 54 public override IDeepCloneable Clone(Cloner cloner) { 55 return new AlbaStochasticLambdaInterchangeMultiMoveGenerator(this, cloner); 56 } 57 58 private AlbaStochasticLambdaInterchangeMultiMoveGenerator(AlbaStochasticLambdaInterchangeMultiMoveGenerator original, Cloner cloner) 59 : base(original, cloner) { 60 } 61 53 62 protected override AlbaLambdaInterchangeMove[] GenerateMoves(AlbaEncoding individual, IVRPProblemInstance problemInstance, int lambda) { 54 63 int sampleSize = SampleSizeParameter.ActualValue.Value; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/LambdaInterchange/AlbaStochasticLambdaInterchangeSingleMoveGenerator.cs
r4370 r4752 29 29 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 using HeuristicLab.Common; 31 32 32 33 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 53 54 : base() { 54 55 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator.")); 56 } 57 58 public override IDeepCloneable Clone(Cloner cloner) { 59 return new AlbaStochasticLambdaInterchangeSingleMoveGenerator(this, cloner); 60 } 61 62 private AlbaStochasticLambdaInterchangeSingleMoveGenerator(AlbaStochasticLambdaInterchangeSingleMoveGenerator original, Cloner cloner) 63 : base(original, cloner) { 55 64 } 56 65 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaStochasticTranslocationSingleMoveGenerator.cs
r4383 r4752 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 30 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 31 using HeuristicLab.Common; 31 32 32 33 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 63 64 } 64 65 66 public override IDeepCloneable Clone(Cloner cloner) { 67 return new AlbaStochasticTranslocationSingleMoveGenerator(this, cloner); 68 } 69 70 private AlbaStochasticTranslocationSingleMoveGenerator(AlbaStochasticTranslocationSingleMoveGenerator original, Cloner cloner) 71 : base(original, cloner) { 72 } 73 65 74 public override IOperation Apply() { 66 75 IOperation next = base.Apply(); -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMove.cs
r4383 r4752 43 43 } 44 44 45 public override IDeepCloneable Clone(HeuristicLab.Common.Cloner cloner) { 46 AlbaTranslocationMove clone = new AlbaTranslocationMove( 47 Index1, Index2, Index3); 48 if (Permutation != null) 49 clone.Permutation = Permutation.Clone() as AlbaEncoding; 45 [StorableConstructor] 46 protected AlbaTranslocationMove(bool deserializing) : base(deserializing) { } 50 47 51 cloner.RegisterClonedObject(this, clone); 52 return clone; 48 public override IDeepCloneable Clone(Cloner cloner) { 49 return new AlbaTranslocationMove(this, cloner); 50 } 51 52 protected AlbaTranslocationMove(AlbaTranslocationMove original, Cloner cloner) 53 : base(original, cloner) { 54 this.Index1 = original.Index1; 55 this.Index2 = original.Index2; 56 this.Index3 = original.Index3; 57 58 this.Permutation = cloner.Clone(Permutation) as AlbaEncoding; 53 59 } 54 60 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveEvaluator.cs
r4383 r4752 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 26 using HeuristicLab.Problems.VehicleRouting.Encodings.Alba; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Problems.VehicleRouting { … … 47 48 } 48 49 50 public override IDeepCloneable Clone(Cloner cloner) { 51 return new AlbaTranslocationMoveEvaluator(this, cloner); 52 } 53 54 private AlbaTranslocationMoveEvaluator(AlbaTranslocationMoveEvaluator original, Cloner cloner) 55 : base(original, cloner) { 56 } 57 49 58 protected override void EvaluateMove() { 50 59 TranslocationMove move = TranslocationMoveParameter.ActualValue; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveGenerator.cs
r4370 r4752 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 85 86 } 86 87 88 public override IDeepCloneable Clone(Cloner cloner) { 89 return new AlbaTranslocationMoveGenerator(this, cloner); 90 } 91 92 private AlbaTranslocationMoveGenerator(AlbaTranslocationMoveGenerator original, Cloner cloner) 93 : base(original, cloner) { 94 } 95 87 96 public override IOperation Apply() { 88 97 IOperation next = base.Apply(); -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveHardTabuCriterion.cs
r4370 r4752 27 27 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 28 28 using HeuristicLab.Problems.VehicleRouting.Interfaces; 29 using HeuristicLab.Common; 29 30 30 31 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 70 71 } 71 72 73 public override IDeepCloneable Clone(Cloner cloner) { 74 return new AlbaTranslocationMoveHardTabuCriterion(this, cloner); 75 } 76 77 private AlbaTranslocationMoveHardTabuCriterion(AlbaTranslocationMoveHardTabuCriterion original, Cloner cloner) 78 : base(original, cloner) { 79 } 80 72 81 public override IOperation Apply() { 73 82 IOperation next = base.Apply(); -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveMaker.cs
r4383 r4752 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 27 using HeuristicLab.Problems.VehicleRouting.Interfaces; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 53 54 } 54 55 56 public override IDeepCloneable Clone(Cloner cloner) { 57 return new AlbaTranslocationMoveMaker(this, cloner); 58 } 59 60 private AlbaTranslocationMoveMaker(AlbaTranslocationMoveMaker original, Cloner cloner) 61 : base(original, cloner) { 62 } 63 55 64 protected override void PerformMove() { 56 65 IVariable moveVariable = this.ExecutionContext.Scope.Variables[ -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveSoftTabuCriterion.cs
r4370 r4752 27 27 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 28 28 using HeuristicLab.Problems.VehicleRouting.Interfaces; 29 using HeuristicLab.Common; 29 30 30 31 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 70 71 } 71 72 73 public override IDeepCloneable Clone(Cloner cloner) { 74 return new AlbaTranslocationMoveSoftTabuCriterion(this, cloner); 75 } 76 77 private AlbaTranslocationMoveSoftTabuCriterion(AlbaTranslocationMoveSoftTabuCriterion original, Cloner cloner) 78 : base(original, cloner) { 79 } 80 72 81 public override IOperation Apply() { 73 82 IOperation next = base.Apply(); -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveTabuMaker.cs
r4370 r4752 27 27 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 28 28 using HeuristicLab.Problems.VehicleRouting.Interfaces; 29 using HeuristicLab.Common; 29 30 30 31 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { … … 70 71 } 71 72 73 public override IDeepCloneable Clone(Cloner cloner) { 74 return new AlbaTranslocationMoveTabuMaker(this, cloner); 75 } 76 77 private AlbaTranslocationMoveTabuMaker(AlbaTranslocationMoveTabuMaker original, Cloner cloner) 78 : base(original, cloner) { 79 } 80 72 81 public override IOperation Apply() { 73 82 IOperation next = base.Apply(); -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/GVR/Crossovers/GVRCrossover.cs
r4379 r4752 29 29 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 using HeuristicLab.Common; 31 32 32 33 namespace HeuristicLab.Problems.VehicleRouting.Encodings.GVR { … … 43 44 public GVRCrossover() { 44 45 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators.")); 46 } 47 48 public override IDeepCloneable Clone(Cloner cloner) { 49 return new GVRCrossover(this, cloner); 50 } 51 52 private GVRCrossover(GVRCrossover original, Cloner cloner) 53 : base(original, cloner) { 45 54 } 46 55 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/GVR/GVREncoding.cs
r4379 r4752 79 79 } 80 80 81 public override IDeepCloneable Clone(HeuristicLab.Common.Cloner cloner) {82 GVREncoding clone = new GVREncoding(ProblemInstance);83 cloner.RegisterClonedObject(this, clone);84 clone.Tours = (ItemList<Tour>)cloner.Clone(this.Tours);85 86 return clone;87 }88 89 81 public GVREncoding(IVRPProblemInstance problemInstance) 90 82 : base(problemInstance) { … … 94 86 private GVREncoding(bool serializing) 95 87 : base(serializing) { 88 } 89 90 public override IDeepCloneable Clone(Cloner cloner) { 91 return new GVREncoding(this, cloner); 92 } 93 94 protected GVREncoding(GVREncoding original, Cloner cloner) 95 : base(original, cloner) { 96 96 } 97 97 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/GVR/Manipulators/GVRDisplacementManipulator.cs
r4379 r4752 26 26 using HeuristicLab.Data; 27 27 using System.Collections.Generic; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Problems.VehicleRouting.Encodings.GVR { … … 36 37 public GVRDisplacementManipulator() 37 38 : base() { 39 } 40 41 public override IDeepCloneable Clone(Cloner cloner) { 42 return new GVRDisplacementManipulator(this, cloner); 43 } 44 45 private GVRDisplacementManipulator(GVRDisplacementManipulator original, Cloner cloner) 46 : base(original, cloner) { 38 47 } 39 48 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/GVR/Manipulators/GVRInsertionManipulator.cs
r4379 r4752 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 26 using HeuristicLab.Data; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.GVR { … … 35 36 public GVRInsertionManipulator() 36 37 : base() { 38 } 39 40 public override IDeepCloneable Clone(Cloner cloner) { 41 return new GVRInsertionManipulator(this, cloner); 42 } 43 44 private GVRInsertionManipulator(GVRInsertionManipulator original, Cloner cloner) 45 : base(original, cloner) { 37 46 } 38 47 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/GVR/Manipulators/GVRInversionManipulator.cs
r4379 r4752 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 26 using HeuristicLab.Data; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.GVR { … … 37 38 } 38 39 40 public override IDeepCloneable Clone(Cloner cloner) { 41 return new GVRInversionManipulator(this, cloner); 42 } 43 44 private GVRInversionManipulator(GVRInversionManipulator original, Cloner cloner) 45 : base(original, cloner) { 46 } 47 39 48 protected override void Manipulate(IRandom random, GVREncoding individual) { 40 49 Tour tour = individual.Tours[random.Next(individual.Tours.Count)]; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/GVR/Manipulators/GVRManipulator.cs
r4379 r4752 28 28 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.GVR { … … 44 45 } 45 46 47 protected GVRManipulator(GVRManipulator original, Cloner cloner) 48 : base(original, cloner) { 49 } 50 46 51 protected abstract void Manipulate(IRandom random, GVREncoding individual); 47 52 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/GVR/Manipulators/GVRSwapManipulator.cs
r4379 r4752 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 26 using HeuristicLab.Data; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.GVR { … … 35 36 public GVRSwapManipulator() 36 37 : base() { 38 } 39 40 public override IDeepCloneable Clone(Cloner cloner) { 41 return new GVRSwapManipulator(this, cloner); 42 } 43 44 private GVRSwapManipulator(GVRSwapManipulator original, Cloner cloner) 45 : base(original, cloner) { 37 46 } 38 47 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Creators/MultiVRPSolutionCreator.cs
r4365 r4752 33 33 using HeuristicLab.Problems.VehicleRouting.Variants; 34 34 using System.Collections.Generic; 35 using HeuristicLab.Common; 35 36 36 37 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { … … 60 61 61 62 Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance")); 63 } 64 65 public override IDeepCloneable Clone(Cloner cloner) { 66 return new MultiVRPSolutionCreator(this, cloner); 67 } 68 69 protected MultiVRPSolutionCreator(MultiVRPSolutionCreator original, Cloner cloner) 70 : base(original, cloner) { 62 71 } 63 72 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Creators/VRPCreator.cs
r4369 r4752 30 30 using HeuristicLab.Parameters; 31 31 using HeuristicLab.Problems.VehicleRouting.Interfaces; 32 using HeuristicLab.Common; 32 33 33 34 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { … … 46 47 Parameters.Add(new LookupParameter<IVRPEncoding>("VRPTours", "The VRP tours to be created.")); 47 48 } 49 50 protected VRPCreator(VRPCreator original, Cloner cloner) 51 : base(original, cloner) { 52 } 48 53 } 49 54 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveEvaluator.cs
r4370 r4752 26 26 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 27 27 using HeuristicLab.Problems.VehicleRouting.Variants; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Problems.VehicleRouting { … … 43 44 } 44 45 46 public override IDeepCloneable Clone(Cloner cloner) { 47 return new MultiVRPMoveEvaluator(this, cloner); 48 } 49 50 private MultiVRPMoveEvaluator(MultiVRPMoveEvaluator original, Cloner cloner) 51 : base(original, cloner) { 52 } 53 45 54 protected override void EvaluateMove() { 46 55 IVRPMove move = VRPMoveParameter.ActualValue as IVRPMove; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveGenerator.cs
r4370 r4752 33 33 using HeuristicLab.Problems.VehicleRouting.Interfaces; 34 34 using HeuristicLab.Problems.VehicleRouting.Variants; 35 using HeuristicLab.Common; 35 36 36 37 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { … … 86 87 Parameters.Add(new LookupParameter<IVRPEncoding>("VRPTours", "The VRP tours.")); 87 88 Parameters.Add(new LookupParameter<IVRPMove>("VRPMove", "The generated moves.")); 89 } 90 91 public override IDeepCloneable Clone(Cloner cloner) { 92 return new MultiVRPMoveGenerator(this, cloner); 93 } 94 95 protected MultiVRPMoveGenerator(MultiVRPMoveGenerator original, Cloner cloner) 96 : base(original, cloner) { 88 97 } 89 98 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveMaker.cs
r4370 r4752 28 28 using System.Collections.Generic; 29 29 using HeuristicLab.Problems.VehicleRouting.Variants; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General{ … … 45 46 } 46 47 48 public override IDeepCloneable Clone(Cloner cloner) { 49 return new MultiVRPMoveMaker(this, cloner); 50 } 51 52 protected MultiVRPMoveMaker(MultiVRPMoveMaker original, Cloner cloner) 53 : base(original, cloner) { 54 } 55 47 56 protected override void PerformMove() { 48 57 IVRPMove move = VRPMoveParameter.ActualValue as IVRPMove; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/VRPMoveEvaluator.cs
r4369 r4752 30 30 using HeuristicLab.Parameters; 31 31 using HeuristicLab.Problems.VehicleRouting.Interfaces; 32 using HeuristicLab.Common; 32 33 33 34 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { … … 51 52 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the solution.")); 52 53 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The relative quality of the move.")); 54 } 55 56 protected VRPMoveEvaluator(VRPMoveEvaluator original, Cloner cloner) 57 : base(original, cloner) { 53 58 } 54 59 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/VRPMoveGenerator.cs
r4369 r4752 30 30 using HeuristicLab.Parameters; 31 31 using HeuristicLab.Problems.VehicleRouting.Interfaces; 32 using HeuristicLab.Common; 32 33 33 34 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { … … 42 43 : base() { 43 44 } 45 46 protected VRPMoveGenerator(VRPMoveGenerator original, Cloner cloner) 47 : base(original, cloner) { 48 } 44 49 } 45 50 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/VRPMoveMaker.cs
r4370 r4752 30 30 using HeuristicLab.Parameters; 31 31 using HeuristicLab.Problems.VehicleRouting.Interfaces; 32 using HeuristicLab.Common; 32 33 33 34 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { … … 49 50 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the solution.")); 50 51 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The relative quality of the move.")); 52 } 53 54 protected VRPMoveMaker(VRPMoveMaker original, Cloner cloner) 55 : base(original, cloner) { 51 56 } 52 57 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/VRPMoveOperator.cs
r4370 r4752 28 28 using HeuristicLab.Problems.VehicleRouting.Interfaces; 29 29 using HeuristicLab.Parameters; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { … … 45 46 Parameters.Add(new LookupParameter<IVRPEncoding>("VRPTours", "The VRP tours considered in the move.")); 46 47 } 48 49 protected VRPMoveOperator(VRPMoveOperator original, Cloner cloner) 50 : base(original, cloner) { 51 } 47 52 } 48 53 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/PermutationEncoding.cs
r4365 r4752 40 40 protected IVRPProblemInstance ProblemInstance { get; set; } 41 41 42 public override IDeepCloneable Clone(Cloner cloner) { 43 PermutationEncoding clone = (PermutationEncoding)base.Clone(cloner); 44 45 clone.ProblemInstance = (IVRPProblemInstance)cloner.Clone(ProblemInstance); 46 47 return clone; 42 protected PermutationEncoding(PermutationEncoding original, Cloner cloner) 43 : base(original, cloner) { 44 this.ProblemInstance = (IVRPProblemInstance)cloner.Clone(original.ProblemInstance); 45 this.readOnly = original.readOnly; 48 46 } 49 47 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/TourEncoding.cs
r4376 r4752 82 82 } 83 83 84 protected TourEncoding(TourEncoding original, Cloner cloner) 85 : base(original, cloner) { 86 this.Tours = (ItemList<Tour>)cloner.Clone(original.Tours); 87 this.ProblemInstance = (IVRPProblemInstance)cloner.Clone(original.ProblemInstance); 88 } 89 84 90 public static void ConvertFrom(IVRPEncoding encoding, TourEncoding solution, IVRPProblemInstance problemInstance) { 85 91 solution.Tours = new ItemList<Tour>(encoding.GetTours()); -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinCrossover.cs
r4376 r4752 29 29 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 using HeuristicLab.Common; 31 32 32 33 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { … … 43 44 public PotvinCrossover() { 44 45 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators.")); 46 } 47 48 protected PotvinCrossover(PotvinCrossover original, Cloner cloner) 49 : base(original, cloner) { 45 50 } 46 51 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinRouteBasedCrossover.cs
r4376 r4752 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 26 using HeuristicLab.Data; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { … … 35 36 public PotvinRouteBasedCrossover() 36 37 : base() { } 38 39 public override IDeepCloneable Clone(Cloner cloner) { 40 return new PotvinRouteBasedCrossover(this, cloner); 41 } 42 43 private PotvinRouteBasedCrossover(PotvinRouteBasedCrossover original, Cloner cloner) 44 : base(original, cloner) { 45 } 37 46 38 47 protected override PotvinEncoding Crossover(IRandom random, PotvinEncoding parent1, PotvinEncoding parent2) { -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinSequenceBasedCrossover.cs
r4376 r4752 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 26 using HeuristicLab.Data; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { … … 35 36 public PotvinSequenceBasedCrossover() 36 37 : base() { } 38 39 public override IDeepCloneable Clone(Cloner cloner) { 40 return new PotvinSequenceBasedCrossover(this, cloner); 41 } 42 43 private PotvinSequenceBasedCrossover(PotvinSequenceBasedCrossover original, Cloner cloner) 44 : base(original, cloner) { 45 } 37 46 38 47 protected override PotvinEncoding Crossover(IRandom random, PotvinEncoding parent1, PotvinEncoding parent2) { -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinLocalSearchManipulator.cs
r4376 r4752 26 26 using HeuristicLab.Data; 27 27 using System.Collections.Generic; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { … … 40 41 public PotvinLocalSearchManipulator() : base() { 41 42 Parameters.Add(new ValueParameter<IntValue>("Iterations", "The number of max iterations.", new IntValue(100))); 43 } 44 45 public override IDeepCloneable Clone(Cloner cloner) { 46 return new PotvinLocalSearchManipulator(this, cloner); 47 } 48 49 private PotvinLocalSearchManipulator(PotvinLocalSearchManipulator original, Cloner cloner) 50 : base(original, cloner) { 42 51 } 43 52 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinManipulator.cs
r4376 r4752 28 28 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { … … 42 43 public PotvinManipulator() { 43 44 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators.")); 45 } 46 47 protected PotvinManipulator(PotvinManipulator original, Cloner cloner) 48 : base(original, cloner) { 44 49 } 45 50 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinOneLevelExchangeManipulator.cs
r4376 r4752 26 26 using HeuristicLab.Data; 27 27 using System.Collections.Generic; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { … … 35 36 36 37 public PotvinOneLevelExchangeMainpulator() : base() { } 38 39 public override IDeepCloneable Clone(Cloner cloner) { 40 return new PotvinOneLevelExchangeMainpulator(this, cloner); 41 } 42 43 private PotvinOneLevelExchangeMainpulator(PotvinOneLevelExchangeMainpulator original, Cloner cloner) 44 : base(original, cloner) { 45 } 37 46 38 47 protected override void Manipulate(IRandom random, PotvinEncoding individual) { -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinTwoLevelExchangeManipulator.cs
r4376 r4752 26 26 using HeuristicLab.Data; 27 27 using System.Collections.Generic; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { … … 35 36 36 37 public PotvinTwoLevelExchangeManipulator() : base() { } 38 39 public override IDeepCloneable Clone(Cloner cloner) { 40 return new PotvinTwoLevelExchangeManipulator(this, cloner); 41 } 42 43 private PotvinTwoLevelExchangeManipulator(PotvinTwoLevelExchangeManipulator original, Cloner cloner) 44 : base(original, cloner) { 45 } 37 46 38 47 protected override void Manipulate(IRandom random, PotvinEncoding individual) { -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/PotvinEncoding.cs
r4378 r4752 39 39 public List<int> Unrouted { get; set; } 40 40 41 public override IDeepCloneable Clone(HeuristicLab.Common.Cloner cloner) {42 PotvinEncoding clone = new PotvinEncoding(ProblemInstance);43 cloner.RegisterClonedObject(this, clone);44 clone.Tours = (ItemList<Tour>)cloner.Clone(this.Tours);45 clone.Unrouted = new List<int>(Unrouted);46 return clone;47 }48 49 41 public PotvinEncoding(IVRPProblemInstance instance) 50 42 : base(instance) { … … 55 47 private PotvinEncoding(bool serializing) 56 48 : base(serializing) { 49 } 50 51 public override IDeepCloneable Clone(Cloner cloner) { 52 return new PotvinEncoding(this, cloner); 53 } 54 55 protected PotvinEncoding(PotvinEncoding original, Cloner cloner) 56 : base(original, cloner) { 57 this.Unrouted = new List<int>(original.Unrouted); 57 58 } 58 59 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/Crossovers/PrinsCrossover.cs
r4379 r4752 28 28 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins { … … 44 45 : base() { 45 46 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators.")); 47 } 48 49 protected PrinsCrossover(PrinsCrossover original, Cloner cloner) 50 : base(original, cloner) { 46 51 } 47 52 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/Crossovers/PrinsPermutationCrossover.cs
r4379 r4752 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 26 using HeuristicLab.Data; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins { … … 40 41 : base() { 41 42 Parameters.Add(new ValueLookupParameter<IPermutationCrossover>("InnerCrossover", "The permutation crossover.", new OrderCrossover())); 43 } 44 45 public override IDeepCloneable Clone(Cloner cloner) { 46 return new PrinsPermutationCrossover(this, cloner); 47 } 48 49 private PrinsPermutationCrossover(PrinsPermutationCrossover original, Cloner cloner) 50 : base(original, cloner) { 42 51 } 43 52 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/Manipulators/PrinsExhaustiveLSManipulator.cs
r4379 r4752 26 26 using HeuristicLab.Data; 27 27 using System.Collections.Generic; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins { … … 36 37 public PrinsExhaustiveLSManipulator() 37 38 : base() { 39 } 40 41 public override IDeepCloneable Clone(Cloner cloner) { 42 return new PrinsExhaustiveLSManipulator(this, cloner); 43 } 44 45 private PrinsExhaustiveLSManipulator(PrinsExhaustiveLSManipulator original, Cloner cloner) 46 : base(original, cloner) { 38 47 } 39 48 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/Manipulators/PrinsLSManipulator.cs
r4379 r4752 26 26 using HeuristicLab.Data; 27 27 using System.Collections.Generic; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins { … … 41 42 : base() { 42 43 Parameters.Add(new ValueParameter<IntValue>("Iterations", "The number of max iterations.", new IntValue(5))); 44 } 45 46 protected PrinsLSManipulator(PrinsLSManipulator original, Cloner cloner) 47 : base(original, cloner) { 43 48 } 44 49 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/Manipulators/PrinsManipulator.cs
r4379 r4752 28 28 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins { … … 45 46 } 46 47 48 protected PrinsManipulator(PrinsManipulator original, Cloner cloner) 49 : base(original, cloner) { 50 } 51 47 52 protected abstract void Manipulate(IRandom random, PrinsEncoding individual); 48 53 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/Manipulators/PrinsPermutationManipulator.cs
r4379 r4752 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 26 using HeuristicLab.Data; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins { … … 42 43 } 43 44 45 public override IDeepCloneable Clone(Cloner cloner) { 46 return new PrinsPermutationManipulator(this, cloner); 47 } 48 49 private PrinsPermutationManipulator(PrinsPermutationManipulator original, Cloner cloner) 50 : base(original, cloner) { 51 } 52 44 53 protected override void Manipulate(IRandom random, PrinsEncoding individual) { 45 54 InnerManipulatorParameter.ActualValue.PermutationParameter.ActualName = VRPToursParameter.ActualName; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/Manipulators/PrinsStochasticLSManipulator.cs
r4379 r4752 26 26 using HeuristicLab.Data; 27 27 using System.Collections.Generic; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins { … … 41 42 : base() { 42 43 Parameters.Add(new ValueParameter<IntValue>("SampleSize", "The sample size.", new IntValue(200))); 44 } 45 46 public override IDeepCloneable Clone(Cloner cloner) { 47 return new PrinsStochasticLSManipulator(this, cloner); 48 } 49 50 private PrinsStochasticLSManipulator(PrinsStochasticLSManipulator original, Cloner cloner) 51 : base(original, cloner) { 43 52 } 44 53 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/PrinsEncoding.cs
r4379 r4752 132 132 } 133 133 #endregion 134 135 public override IDeepCloneable Clone(HeuristicLab.Common.Cloner cloner) {136 PrinsEncoding clone = new PrinsEncoding(137 new Permutation(this.PermutationType, this.array), ProblemInstance);138 139 cloner.RegisterClonedObject(this, clone);140 clone.readOnly = readOnly;141 return clone;142 }143 144 134 public PrinsEncoding(Permutation permutation, IVRPProblemInstance problemInstance) 145 135 : base(permutation, problemInstance) { … … 149 139 private PrinsEncoding(bool serializing) 150 140 : base(serializing) { 141 } 142 143 public override IDeepCloneable Clone(Cloner cloner) { 144 return new PrinsEncoding(this, cloner); 145 } 146 147 protected PrinsEncoding(PrinsEncoding original, Cloner cloner) 148 : base(original, cloner) { 151 149 } 152 150 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Tour.cs
r4363 r4752 39 39 40 40 public override IDeepCloneable Clone(Cloner cloner) { 41 Tour clone = base.Clone(cloner) as Tour;42 clone.Stops = new List<int>(Stops);41 return new Tour(this, cloner); 42 } 43 43 44 return clone; 44 protected Tour(Tour original, Cloner cloner) 45 : base(original, cloner) { 46 this.Stops = new List<int>(original.Stops); 45 47 } 46 48 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/VRPOperator.cs
r4365 r4752 29 29 using HeuristicLab.Parameters; 30 30 using HeuristicLab.Operators; 31 using HeuristicLab.Common; 31 32 32 33 namespace HeuristicLab.Problems.VehicleRouting.Encodings { … … 49 50 Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance")); 50 51 } 52 53 protected VRPOperator(VRPOperator original, Cloner cloner) 54 : base(original, cloner) { 55 } 51 56 } 52 57 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Crossovers/ZhuCrossover.cs
r4379 r4752 28 28 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Zhu { … … 43 44 : base() { 44 45 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators.")); 46 } 47 48 protected ZhuCrossover(ZhuCrossover original, Cloner cloner) 49 : base(original, cloner) { 45 50 } 46 51 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Crossovers/ZhuHeuristicCrossover1.cs
r4379 r4752 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 26 using HeuristicLab.Data; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Zhu { … … 35 36 public ZhuHeuristicCrossover1() 36 37 : base() { 38 } 39 40 public override IDeepCloneable Clone(Cloner cloner) { 41 return new ZhuHeuristicCrossover1(this, cloner); 42 } 43 44 private ZhuHeuristicCrossover1(ZhuHeuristicCrossover1 original, Cloner cloner) 45 : base(original, cloner) { 37 46 } 38 47 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Crossovers/ZhuHeuristicCrossover2.cs
r4379 r4752 26 26 using HeuristicLab.Data; 27 27 using System.Collections.Generic; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Zhu { … … 36 37 public ZhuHeuristicCrossover2() 37 38 : base() { 39 } 40 41 public override IDeepCloneable Clone(Cloner cloner) { 42 return new ZhuHeuristicCrossover2(this, cloner); 43 } 44 45 private ZhuHeuristicCrossover2(ZhuHeuristicCrossover2 original, Cloner cloner) 46 : base(original, cloner) { 38 47 } 39 48 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Crossovers/ZhuMergeCrossover1.cs
r4379 r4752 26 26 using HeuristicLab.Data; 27 27 using HeuristicLab.Problems.VehicleRouting.Variants; 28 using HeuristicLab.Common; 28 29 29 30 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Zhu { … … 36 37 public ZhuMergeCrossover1() 37 38 : base() { 39 } 40 41 public override IDeepCloneable Clone(Cloner cloner) { 42 return new ZhuMergeCrossover1(this, cloner); 43 } 44 45 private ZhuMergeCrossover1(ZhuMergeCrossover1 original, Cloner cloner) 46 : base(original, cloner) { 38 47 } 39 48 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Crossovers/ZhuMergeCrossover2.cs
r4379 r4752 27 27 using System.Collections.Generic; 28 28 using HeuristicLab.Problems.VehicleRouting.Variants; 29 using HeuristicLab.Common; 29 30 30 31 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Zhu { … … 37 38 public ZhuMergeCrossover2() 38 39 : base() { 40 } 41 42 public override IDeepCloneable Clone(Cloner cloner) { 43 return new ZhuMergeCrossover2(this, cloner); 44 } 45 46 private ZhuMergeCrossover2(ZhuMergeCrossover2 original, Cloner cloner) 47 : base(original, cloner) { 39 48 } 40 49 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Crossovers/ZhuPermutationCrossover.cs
r4379 r4752 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 26 using HeuristicLab.Data; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Zhu { … … 40 41 : base() { 41 42 Parameters.Add(new ValueLookupParameter<IPermutationCrossover>("InnerCrossover", "The permutation crossover.", new PartiallyMatchedCrossover())); 43 } 44 45 public override IDeepCloneable Clone(Cloner cloner) { 46 return new PrinsPermutationCrossover(this, cloner); 47 } 48 49 private PrinsPermutationCrossover(PrinsPermutationCrossover original, Cloner cloner) 50 : base(original, cloner) { 42 51 } 43 52 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Manipulators/ZhuManipulator.cs
r4379 r4752 28 28 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Zhu { … … 45 46 } 46 47 48 protected ZhuManipulator(ZhuManipulator original, Cloner cloner) 49 : base(original, cloner) { 50 } 51 47 52 protected abstract void Manipulate(IRandom random, ZhuEncoding individual); 48 53 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Manipulators/ZhuPermutationManipulator.cs
r4379 r4752 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 26 using HeuristicLab.Data; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Zhu { … … 42 43 } 43 44 45 public override IDeepCloneable Clone(Cloner cloner) { 46 return new ZhuPermutationManipulator(this, cloner); 47 } 48 49 private ZhuPermutationManipulator(ZhuPermutationManipulator original, Cloner cloner) 50 : base(original, cloner) { 51 } 52 44 53 protected override void Manipulate(IRandom random, ZhuEncoding individual) { 45 54 InnerManipulatorParameter.ActualValue.PermutationParameter.ActualName = VRPToursParameter.ActualName; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/ZhuEncoding.cs
r4379 r4752 93 93 #endregion 94 94 95 public override IDeepCloneable Clone(HeuristicLab.Common.Cloner cloner) { 96 ZhuEncoding clone = new ZhuEncoding( 97 new Permutation(this.PermutationType, this.array), ProblemInstance); 98 99 cloner.RegisterClonedObject(this, clone); 100 clone.readOnly = readOnly; 101 return clone; 95 public ZhuEncoding(Permutation permutation, IVRPProblemInstance problemInstance) 96 : base(permutation, problemInstance) { 102 97 } 103 98 104 public ZhuEncoding(Permutation permutation, IVRPProblemInstance problemInstance) 105 : base(permutation, problemInstance) { 99 public override IDeepCloneable Clone(Cloner cloner) { 100 return new ZhuEncoding(this, cloner); 101 } 102 103 protected ZhuEncoding(ZhuEncoding original, Cloner cloner) 104 : base(original, cloner) { 106 105 } 107 106 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPEvaluator.cs
r4520 r4752 33 33 using HeuristicLab.Problems.VehicleRouting.Variants; 34 34 using HeuristicLab.Problems.VehicleRouting.Encodings; 35 using HeuristicLab.Common; 35 36 36 37 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { … … 105 106 Parameters.Add(new LookupParameter<DoubleValue>("Overload", "The overload.")); 106 107 } 108 109 public override IDeepCloneable Clone(Cloner cloner) { 110 return new CVRPEvaluator(this, cloner); 111 } 112 113 protected CVRPEvaluator(CVRPEvaluator original, Cloner cloner) 114 : base(original, cloner) { 115 } 107 116 } 108 117 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPProblemInstance.cs
r4376 r4752 32 32 using HeuristicLab.PluginInfrastructure; 33 33 using HeuristicLab.Problems.VehicleRouting.Variants; 34 using HeuristicLab.Common; 34 35 35 36 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { … … 77 78 Parameters.Add(new ValueParameter<DoubleValue>("EvalOverloadPenalty", "The overload penalty considered in the evaluation.", new DoubleValue(100))); 78 79 } 80 81 public override IDeepCloneable Clone(Cloner cloner) { 82 return new CVRPProblemInstance(this, cloner); 83 } 84 85 protected CVRPProblemInstance(CVRPProblemInstance original, Cloner cloner) 86 : base(original, cloner) { 87 } 79 88 } 80 89 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWEvaluator.cs
r4520 r4752 33 33 using HeuristicLab.Problems.VehicleRouting.Variants; 34 34 using HeuristicLab.Problems.VehicleRouting.Encodings; 35 using HeuristicLab.Common; 35 36 36 37 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { … … 144 145 Parameters.Add(new LookupParameter<DoubleValue>("TravelTime", "The travel time.")); 145 146 } 147 148 public override IDeepCloneable Clone(Cloner cloner) { 149 return new CVRPTWEvaluator(this, cloner); 150 } 151 152 protected CVRPTWEvaluator(CVRPTWEvaluator original, Cloner cloner) 153 : base(original, cloner) { 154 } 146 155 } 147 156 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWProblemInstance.cs
r4454 r4752 32 32 using HeuristicLab.PluginInfrastructure; 33 33 using HeuristicLab.Problems.VehicleRouting.Variants; 34 using HeuristicLab.Common; 34 35 35 36 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { … … 103 104 Parameters.Add(new ValueParameter<DoubleValue>("EvalTardinessPenalty", "The tardiness penalty considered in the evaluation.", new DoubleValue(100))); 104 105 } 106 107 public override IDeepCloneable Clone(Cloner cloner) { 108 return new CVRPTWProblemInstance(this, cloner); 109 } 110 111 protected CVRPTWProblemInstance(CVRPTWProblemInstance original, Cloner cloner) 112 : base(original, cloner) { 113 } 105 114 } 106 115 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/SingleDepotVRPEvaluator.cs
r4378 r4752 33 33 using HeuristicLab.Problems.VehicleRouting.Variants; 34 34 using HeuristicLab.Problems.VehicleRouting.Encodings; 35 using HeuristicLab.Common; 35 36 36 37 … … 73 74 public SingleDepotVRPEvaluator() { 74 75 } 76 77 public override IDeepCloneable Clone(Cloner cloner) { 78 return new SingleDepotVRPEvaluator(this, cloner); 79 } 80 81 protected SingleDepotVRPEvaluator(SingleDepotVRPEvaluator original, Cloner cloner) 82 : base(original, cloner) { 83 } 75 84 } 76 85 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/SingleDepotVRPProblemInstance.cs
r4374 r4752 32 32 using HeuristicLab.PluginInfrastructure; 33 33 using HeuristicLab.Problems.VehicleRouting.Variants; 34 using HeuristicLab.Common; 34 35 35 36 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { … … 70 71 public SingleDepotVRPProblemInstance() { 71 72 } 73 74 public override IDeepCloneable Clone(Cloner cloner) { 75 return new SingleDepotVRPProblemInstance(this, cloner); 76 } 77 78 protected SingleDepotVRPProblemInstance(SingleDepotVRPProblemInstance original, Cloner cloner) 79 : base(original, cloner) { 80 } 72 81 } 73 82 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPEvaluator.cs
r4520 r4752 33 33 using HeuristicLab.Problems.VehicleRouting.Variants; 34 34 using HeuristicLab.Problems.VehicleRouting.Encodings; 35 using HeuristicLab.Common; 35 36 36 37 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { … … 64 65 Parameters.Add(new LookupParameter<DoubleValue>("Distance", "The distance.")); 65 66 Parameters.Add(new LookupParameter<DoubleValue>("VehiclesUtilized", "The number of vehicles utilized.")); 67 } 68 69 protected VRPEvaluator(VRPEvaluator original, Cloner cloner) 70 : base(original, cloner) { 66 71 } 67 72 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs
r4380 r4752 31 31 using HeuristicLab.Optimization; 32 32 using HeuristicLab.PluginInfrastructure; 33 using HeuristicLab.Common; 33 34 34 35 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { … … 192 193 Parameters.Add(new ValueParameter<IVRPEvaluator>("Evaluator", "The operator which should be used to evaluate VRP solutions.", Evaluator)); 193 194 } 195 196 protected VRPProblemInstance(VRPProblemInstance original, Cloner cloner) 197 : base(original, cloner) { 198 } 194 199 } 195 200 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs
r4444 r4752 122 122 123 123 public override IDeepCloneable Clone(Cloner cloner) { 124 VehicleRoutingProblem clone = (VehicleRoutingProblem)base.Clone(cloner); 125 clone.operators = operators.Select(x => (IOperator)cloner.Clone(x)).ToList(); 126 clone.AttachEventHandlers(); 127 return clone; 124 return new VehicleRoutingProblem(this, cloner); 125 } 126 127 private VehicleRoutingProblem(VehicleRoutingProblem original, Cloner cloner) 128 : base(original, cloner) { 129 this.operators = original.operators.Select(x => (IOperator)cloner.Clone(x)).ToList(); 130 this.AttachEventHandlers(); 128 131 } 129 132
Note: See TracChangeset
for help on using the changeset viewer.