- Timestamp:
- 11/09/10 09:55:31 (14 years ago)
- Location:
- branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba
- Files:
-
- 39 edited
Legend:
- Unmodified
- Added
- Removed
-
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();
Note: See TracChangeset
for help on using the changeset viewer.