Changeset 17698 for branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves
- Timestamp:
- 07/24/20 00:58:42 (4 years ago)
- Location:
- branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves
- Files:
-
- 55 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation/PotvinCustomerRelocationExhaustiveMoveGenerator.cs
r17226 r17698 46 46 } 47 47 48 protected override PotvinCustomerRelocationMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance) {48 protected override PotvinCustomerRelocationMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) { 49 49 List<PotvinCustomerRelocationMove> result = new List<PotvinCustomerRelocationMove>(); 50 50 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation/PotvinCustomerRelocationMove.cs
r17226 r17698 32 32 public class PotvinCustomerRelocationMove : Item, IVRPMove { 33 33 [Storable] 34 public IVRPEncod ingIndividual { get; protected set; }34 public IVRPEncodedSolution Individual { get; protected set; } 35 35 36 36 [Storable] … … 51 51 } 52 52 53 public PotvinCustomerRelocationMove(int city, int oldTour, int tour, PotvinEncod ingindividual) {53 public PotvinCustomerRelocationMove(int city, int oldTour, int tour, PotvinEncodedSolution individual) { 54 54 City = city; 55 55 OldTour = oldTour; 56 56 Tour = tour; 57 57 58 this.Individual = individual.Clone() as PotvinEncod ing;58 this.Individual = individual.Clone() as PotvinEncodedSolution; 59 59 } 60 60 … … 69 69 this.Tour = original.Tour; 70 70 71 this.Individual = cloner.Clone(Individual) as PotvinEncod ing;71 this.Individual = cloner.Clone(Individual) as PotvinEncodedSolution; 72 72 } 73 73 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation/PotvinCustomerRelocationMoveEvaluator.cs
r17226 r17698 73 73 PotvinCustomerRelocationMove move = CustomerRelocationMoveParameter.ActualValue; 74 74 75 PotvinEncod ing newSolution = CustomerRelocationMoveParameter.ActualValue.Individual.Clone() as PotvinEncoding;75 PotvinEncodedSolution newSolution = CustomerRelocationMoveParameter.ActualValue.Individual.Clone() as PotvinEncodedSolution; 76 76 PotvinCustomerRelocationMoveMaker.Apply(newSolution, move, ProblemInstance); 77 77 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation/PotvinCustomerRelocationMoveGenerator.cs
r17226 r17698 55 55 } 56 56 57 protected abstract PotvinCustomerRelocationMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance);57 protected abstract PotvinCustomerRelocationMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance); 58 58 59 59 public override IOperation InstrumentedApply() { 60 60 IOperation next = base.InstrumentedApply(); 61 61 62 PotvinEncod ing individual = VRPToursParameter.ActualValue as PotvinEncoding;62 PotvinEncodedSolution individual = VRPToursParameter.ActualValue as PotvinEncodedSolution; 63 63 PotvinCustomerRelocationMove[] moves = GenerateMoves(individual, ProblemInstance); 64 64 Scope[] moveScopes = new Scope[moves.Length]; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation/PotvinCustomerRelocationMoveMaker.cs
r17226 r17698 68 68 } 69 69 70 public static void Apply(PotvinEncod ingsolution, PotvinCustomerRelocationMove move, IVRPProblemInstance problemInstance) {70 public static void Apply(PotvinEncodedSolution solution, PotvinCustomerRelocationMove move, IVRPProblemInstance problemInstance) { 71 71 if (move.Tour >= solution.Tours.Count) 72 72 solution.Tours.Add(new Tour()); … … 87 87 PotvinCustomerRelocationMove move = CustomerRelocationMoveParameter.ActualValue; 88 88 89 PotvinEncod ing newSolution = move.Individual.Clone() as PotvinEncoding;89 PotvinEncodedSolution newSolution = move.Individual.Clone() as PotvinEncodedSolution; 90 90 Apply(newSolution, move, ProblemInstance); 91 91 newSolution.Repair(); -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation/PotvinCustomerRelocationMoveTabuCriterion.cs
r17226 r17698 44 44 get { return CustomerRelocationMoveParameter; } 45 45 } 46 public ILookupParameter<IVRPEncod ing> VRPToursParameter {47 get { return (ILookupParameter<IVRPEncod ing>)Parameters["VRPTours"]; }46 public ILookupParameter<IVRPEncodedSolution> VRPToursParameter { 47 get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["VRPTours"]; } 48 48 } 49 49 public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter { … … 78 78 : base() { 79 79 Parameters.Add(new LookupParameter<PotvinCustomerRelocationMove>("PotvinCustomerRelocationMove", "The moves that should be made.")); 80 Parameters.Add(new LookupParameter<IVRPEncod ing>("VRPTours", "The VRP tours considered in the move."));80 Parameters.Add(new LookupParameter<IVRPEncodedSolution>("VRPTours", "The VRP tours considered in the move.")); 81 81 Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance")); 82 82 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation/PotvinCustomerRelocationMoveTabuMaker.cs
r17226 r17698 37 37 get { return CustomerRelocationMoveParameter; } 38 38 } 39 public ILookupParameter<IVRPEncod ing> VRPToursParameter {40 get { return (ILookupParameter<IVRPEncod ing>)Parameters["VRPTours"]; }39 public ILookupParameter<IVRPEncodedSolution> VRPToursParameter { 40 get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["VRPTours"]; } 41 41 } 42 42 public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter { … … 50 50 : base() { 51 51 Parameters.Add(new LookupParameter<PotvinCustomerRelocationMove>("PotvinCustomerRelocationMove", "The moves that should be made.")); 52 Parameters.Add(new LookupParameter<IVRPEncod ing>("VRPTours", "The VRP tours considered in the move."));52 Parameters.Add(new LookupParameter<IVRPEncodedSolution>("VRPTours", "The VRP tours considered in the move.")); 53 53 Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance")); 54 54 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation/PotvinCustomerRelocationMultiMoveGenerator.cs
r17226 r17698 59 59 } 60 60 61 protected override PotvinCustomerRelocationMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance) {61 protected override PotvinCustomerRelocationMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) { 62 62 List<PotvinCustomerRelocationMove> result = new List<PotvinCustomerRelocationMove>(); 63 63 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation/PotvinCustomerRelocationSingleMoveGenerator.cs
r17226 r17698 61 61 } 62 62 63 public static PotvinCustomerRelocationMove Apply(PotvinEncod ingindividual, IVRPProblemInstance problemInstance, IRandom rand) {63 public static PotvinCustomerRelocationMove Apply(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance, IRandom rand) { 64 64 int city = 1 + rand.Next(individual.Cities); 65 65 Tour oldTour = individual.Tours.Find(t => t.Stops.Contains(city)); … … 77 77 } 78 78 79 protected override PotvinCustomerRelocationMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance) {79 protected override PotvinCustomerRelocationMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) { 80 80 List<PotvinCustomerRelocationMove> result = new List<PotvinCustomerRelocationMove>(); 81 81 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/PotvinPDExchangeExhaustiveMoveGenerator.cs
r17226 r17698 47 47 } 48 48 49 protected override PotvinPDExchangeMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance) {49 protected override PotvinPDExchangeMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) { 50 50 List<PotvinPDExchangeMove> result = new List<PotvinPDExchangeMove>(); 51 51 IPickupAndDeliveryProblemInstance pdp = problemInstance as IPickupAndDeliveryProblemInstance; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/PotvinPDExchangeMove.cs
r17226 r17698 33 33 public class PotvinPDExchangeMove : Item, IVRPMove { 34 34 [Storable] 35 public IVRPEncod ingIndividual { get; protected set; }35 public IVRPEncodedSolution Individual { get; protected set; } 36 36 37 37 [Storable] … … 55 55 } 56 56 57 public PotvinPDExchangeMove(int city, int oldTour, int tour, int replaced, PotvinEncod ingindividual) {57 public PotvinPDExchangeMove(int city, int oldTour, int tour, int replaced, PotvinEncodedSolution individual) { 58 58 City = city; 59 59 OldTour = oldTour; … … 61 61 Replaced = replaced; 62 62 63 this.Individual = individual.Clone() as PotvinEncod ing;63 this.Individual = individual.Clone() as PotvinEncodedSolution; 64 64 } 65 65 … … 78 78 this.Replaced = original.Replaced; 79 79 80 this.Individual = cloner.Clone(Individual) as PotvinEncod ing;80 this.Individual = cloner.Clone(Individual) as PotvinEncodedSolution; 81 81 } 82 82 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/PotvinPDExchangeMoveEvaluator.cs
r17226 r17698 73 73 PotvinPDExchangeMove move = PDExchangeMoveParameter.ActualValue; 74 74 75 PotvinEncod ing newSolution = PDExchangeMoveParameter.ActualValue.Individual.Clone() as PotvinEncoding;75 PotvinEncodedSolution newSolution = PDExchangeMoveParameter.ActualValue.Individual.Clone() as PotvinEncodedSolution; 76 76 PotvinPDExchangeMoveMaker.Apply(newSolution, move, ProblemInstance); 77 77 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/PotvinPDExchangeMoveGenerator.cs
r17226 r17698 55 55 } 56 56 57 protected abstract PotvinPDExchangeMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance);57 protected abstract PotvinPDExchangeMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance); 58 58 59 59 public override IOperation InstrumentedApply() { 60 60 IOperation next = base.InstrumentedApply(); 61 61 62 PotvinEncod ing individual = VRPToursParameter.ActualValue as PotvinEncoding;62 PotvinEncodedSolution individual = VRPToursParameter.ActualValue as PotvinEncodedSolution; 63 63 PotvinPDExchangeMove[] moves = GenerateMoves(individual, ProblemInstance); 64 64 Scope[] moveScopes = new Scope[moves.Length]; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/PotvinPDExchangeMoveMaker.cs
r17226 r17698 56 56 } 57 57 58 public static void Apply(PotvinEncod ingsolution, PotvinPDExchangeMove move, IVRPProblemInstance problemInstance) {58 public static void Apply(PotvinEncodedSolution solution, PotvinPDExchangeMove move, IVRPProblemInstance problemInstance) { 59 59 if (move.Tour >= solution.Tours.Count) 60 60 solution.Tours.Add(new Tour()); … … 95 95 PotvinPDExchangeMove move = PDExchangeMoveParameter.ActualValue; 96 96 97 PotvinEncod ing newSolution = move.Individual.Clone() as PotvinEncoding;97 PotvinEncodedSolution newSolution = move.Individual.Clone() as PotvinEncodedSolution; 98 98 Apply(newSolution, move, ProblemInstance); 99 99 VRPToursParameter.ActualValue = newSolution; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/PotvinPDExchangeMoveTabuCriterion.cs
r17226 r17698 44 44 get { return PDExchangeMoveParameter; } 45 45 } 46 public ILookupParameter<IVRPEncod ing> VRPToursParameter {47 get { return (ILookupParameter<IVRPEncod ing>)Parameters["VRPTours"]; }46 public ILookupParameter<IVRPEncodedSolution> VRPToursParameter { 47 get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["VRPTours"]; } 48 48 } 49 49 public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter { … … 88 88 : base() { 89 89 Parameters.Add(new LookupParameter<PotvinPDExchangeMove>("PotvinPDExchangeMove", "The moves that should be made.")); 90 Parameters.Add(new LookupParameter<IVRPEncod ing>("VRPTours", "The VRP tours considered in the move."));90 Parameters.Add(new LookupParameter<IVRPEncodedSolution>("VRPTours", "The VRP tours considered in the move.")); 91 91 Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance")); 92 92 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/PotvinPDExchangeMoveTabuMaker.cs
r17226 r17698 56 56 get { return PDExchangeMoveParameter; } 57 57 } 58 public ILookupParameter<IVRPEncod ing> VRPToursParameter {59 get { return (ILookupParameter<IVRPEncod ing>)Parameters["VRPTours"]; }58 public ILookupParameter<IVRPEncodedSolution> VRPToursParameter { 59 get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["VRPTours"]; } 60 60 } 61 61 public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter { … … 88 88 89 89 Parameters.Add(new LookupParameter<PotvinPDExchangeMove>("PotvinPDExchangeMove", "The moves that should be made.")); 90 Parameters.Add(new LookupParameter<IVRPEncod ing>("VRPTours", "The VRP tours considered in the move."));90 Parameters.Add(new LookupParameter<IVRPEncodedSolution>("VRPTours", "The VRP tours considered in the move.")); 91 91 Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance")); 92 92 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/PotvinPDExchangeMultiMoveGenerator.cs
r17226 r17698 59 59 } 60 60 61 protected override PotvinPDExchangeMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance) {61 protected override PotvinPDExchangeMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) { 62 62 List<PotvinPDExchangeMove> result = new List<PotvinPDExchangeMove>(); 63 63 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/PotvinPDExchangeSingleMoveGenerator.cs
r17226 r17698 54 54 } 55 55 56 public static PotvinPDExchangeMove Apply(PotvinEncod ingindividual, IVRPProblemInstance problemInstance, IRandom rand) {56 public static PotvinPDExchangeMove Apply(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance, IRandom rand) { 57 57 List<int> cities = new List<int>(); 58 58 … … 99 99 } 100 100 101 protected override PotvinPDExchangeMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance) {101 protected override PotvinPDExchangeMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) { 102 102 List<PotvinPDExchangeMove> result = new List<PotvinPDExchangeMove>(); 103 103 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/PotvinPDRearrangeExhaustiveMoveGenerator.cs
r17226 r17698 47 47 } 48 48 49 protected override PotvinPDRearrangeMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance) {49 protected override PotvinPDRearrangeMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) { 50 50 List<PotvinPDRearrangeMove> result = new List<PotvinPDRearrangeMove>(); 51 51 IPickupAndDeliveryProblemInstance pdp = problemInstance as IPickupAndDeliveryProblemInstance; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/PotvinPDRearrangeMove.cs
r17226 r17698 33 33 public class PotvinPDRearrangeMove : Item, IVRPMove { 34 34 [Storable] 35 public IVRPEncod ingIndividual { get; protected set; }35 public IVRPEncodedSolution Individual { get; protected set; } 36 36 37 37 [Storable] … … 49 49 } 50 50 51 public PotvinPDRearrangeMove(int city, int tour, PotvinEncod ingindividual) {51 public PotvinPDRearrangeMove(int city, int tour, PotvinEncodedSolution individual) { 52 52 City = city; 53 53 Tour = tour; 54 54 55 this.Individual = individual.Clone() as PotvinEncod ing;55 this.Individual = individual.Clone() as PotvinEncodedSolution; 56 56 } 57 57 … … 65 65 this.Tour = original.Tour; 66 66 67 this.Individual = cloner.Clone(Individual) as PotvinEncod ing;67 this.Individual = cloner.Clone(Individual) as PotvinEncodedSolution; 68 68 } 69 69 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/PotvinPDRearrangeMoveEvaluator.cs
r17226 r17698 73 73 PotvinPDRearrangeMove move = PDRearrangeMoveParameter.ActualValue; 74 74 75 PotvinEncod ing newSolution = PDRearrangeMoveParameter.ActualValue.Individual.Clone() as PotvinEncoding;75 PotvinEncodedSolution newSolution = PDRearrangeMoveParameter.ActualValue.Individual.Clone() as PotvinEncodedSolution; 76 76 PotvinPDRearrangeMoveMaker.Apply(newSolution, move, ProblemInstance); 77 77 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/PotvinPDRearrangeMoveGenerator.cs
r17226 r17698 55 55 } 56 56 57 protected abstract PotvinPDRearrangeMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance);57 protected abstract PotvinPDRearrangeMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance); 58 58 59 59 public override IOperation InstrumentedApply() { 60 60 IOperation next = base.InstrumentedApply(); 61 61 62 PotvinEncod ing individual = VRPToursParameter.ActualValue as PotvinEncoding;62 PotvinEncodedSolution individual = VRPToursParameter.ActualValue as PotvinEncodedSolution; 63 63 PotvinPDRearrangeMove[] moves = GenerateMoves(individual, ProblemInstance); 64 64 Scope[] moveScopes = new Scope[moves.Length]; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/PotvinPDRearrangeMoveMaker.cs
r17226 r17698 56 56 } 57 57 58 public static void Apply(PotvinEncod ingsolution, PotvinPDRearrangeMove move, IVRPProblemInstance problemInstance) {58 public static void Apply(PotvinEncodedSolution solution, PotvinPDRearrangeMove move, IVRPProblemInstance problemInstance) { 59 59 Tour tour = solution.Tours[move.Tour]; 60 60 int position = tour.Stops.IndexOf(move.City); … … 82 82 PotvinPDRearrangeMove move = PDRearrangeMoveParameter.ActualValue; 83 83 84 PotvinEncod ing newSolution = move.Individual.Clone() as PotvinEncoding;84 PotvinEncodedSolution newSolution = move.Individual.Clone() as PotvinEncodedSolution; 85 85 Apply(newSolution, move, ProblemInstance); 86 86 VRPToursParameter.ActualValue = newSolution; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/PotvinPDRearrangeMoveTabuCriterion.cs
r17226 r17698 44 44 get { return PDRearrangeMoveParameter; } 45 45 } 46 public ILookupParameter<IVRPEncod ing> VRPToursParameter {47 get { return (ILookupParameter<IVRPEncod ing>)Parameters["VRPTours"]; }46 public ILookupParameter<IVRPEncodedSolution> VRPToursParameter { 47 get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["VRPTours"]; } 48 48 } 49 49 public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter { … … 88 88 : base() { 89 89 Parameters.Add(new LookupParameter<PotvinPDRearrangeMove>("PotvinPDRearrangeMove", "The moves that should be made.")); 90 Parameters.Add(new LookupParameter<IVRPEncod ing>("VRPTours", "The VRP tours considered in the move."));90 Parameters.Add(new LookupParameter<IVRPEncodedSolution>("VRPTours", "The VRP tours considered in the move.")); 91 91 Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance")); 92 92 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/PotvinPDRearrangeMoveTabuMaker.cs
r17226 r17698 38 38 get { return PDRearrangeMoveParameter; } 39 39 } 40 public ILookupParameter<IVRPEncod ing> VRPToursParameter {41 get { return (ILookupParameter<IVRPEncod ing>)Parameters["VRPTours"]; }40 public ILookupParameter<IVRPEncodedSolution> VRPToursParameter { 41 get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["VRPTours"]; } 42 42 } 43 43 public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter { … … 64 64 : base() { 65 65 Parameters.Add(new LookupParameter<PotvinPDRearrangeMove>("PotvinPDRearrangeMove", "The moves that should be made.")); 66 Parameters.Add(new LookupParameter<IVRPEncod ing>("VRPTours", "The VRP tours considered in the move."));66 Parameters.Add(new LookupParameter<IVRPEncodedSolution>("VRPTours", "The VRP tours considered in the move.")); 67 67 Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance")); 68 68 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/PotvinPDRearrangeMultiMoveGenerator.cs
r17226 r17698 59 59 } 60 60 61 protected override PotvinPDRearrangeMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance) {61 protected override PotvinPDRearrangeMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) { 62 62 List<PotvinPDRearrangeMove> result = new List<PotvinPDRearrangeMove>(); 63 63 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/PotvinPDRearrangeSingleMoveGenerator.cs
r17226 r17698 54 54 } 55 55 56 public static PotvinPDRearrangeMove Apply(PotvinEncod ingindividual, IVRPProblemInstance problemInstance, IRandom rand) {56 public static PotvinPDRearrangeMove Apply(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance, IRandom rand) { 57 57 List<int> cities = new List<int>(); 58 58 … … 72 72 } 73 73 74 protected override PotvinPDRearrangeMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance) {74 protected override PotvinPDRearrangeMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) { 75 75 List<PotvinPDRearrangeMove> result = new List<PotvinPDRearrangeMove>(); 76 76 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDShift/PotvinPDShiftExhaustiveMoveGenerator.cs
r17226 r17698 47 47 } 48 48 49 protected override PotvinPDShiftMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance) {49 protected override PotvinPDShiftMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) { 50 50 List<PotvinPDShiftMove> result = new List<PotvinPDShiftMove>(); 51 51 IPickupAndDeliveryProblemInstance pdp = problemInstance as IPickupAndDeliveryProblemInstance; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDShift/PotvinPDShiftMove.cs
r17226 r17698 33 33 public class PotvinPDShiftMove : Item, IVRPMove { 34 34 [Storable] 35 public IVRPEncod ingIndividual { get; protected set; }35 public IVRPEncodedSolution Individual { get; protected set; } 36 36 37 37 [Storable] … … 52 52 } 53 53 54 public PotvinPDShiftMove(int city, int oldTour, int tour, PotvinEncod ingindividual) {54 public PotvinPDShiftMove(int city, int oldTour, int tour, PotvinEncodedSolution individual) { 55 55 City = city; 56 56 OldTour = oldTour; 57 57 Tour = tour; 58 58 59 this.Individual = individual.Clone() as PotvinEncod ing;59 this.Individual = individual.Clone() as PotvinEncodedSolution; 60 60 } 61 61 … … 70 70 this.Tour = original.Tour; 71 71 72 this.Individual = cloner.Clone(Individual) as PotvinEncod ing;72 this.Individual = cloner.Clone(Individual) as PotvinEncodedSolution; 73 73 } 74 74 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDShift/PotvinPDShiftMoveEvaluator.cs
r17226 r17698 73 73 PotvinPDShiftMove move = PDShiftMoveParameter.ActualValue; 74 74 75 PotvinEncod ing newSolution = PDShiftMoveParameter.ActualValue.Individual.Clone() as PotvinEncoding;75 PotvinEncodedSolution newSolution = PDShiftMoveParameter.ActualValue.Individual.Clone() as PotvinEncodedSolution; 76 76 PotvinPDShiftMoveMaker.Apply(newSolution, move, ProblemInstance); 77 77 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDShift/PotvinPDShiftMoveGenerator.cs
r17226 r17698 55 55 } 56 56 57 protected abstract PotvinPDShiftMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance);57 protected abstract PotvinPDShiftMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance); 58 58 59 59 public override IOperation InstrumentedApply() { 60 60 IOperation next = base.InstrumentedApply(); 61 61 62 PotvinEncod ing individual = VRPToursParameter.ActualValue as PotvinEncoding;62 PotvinEncodedSolution individual = VRPToursParameter.ActualValue as PotvinEncodedSolution; 63 63 PotvinPDShiftMove[] moves = GenerateMoves(individual, ProblemInstance); 64 64 Scope[] moveScopes = new Scope[moves.Length]; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDShift/PotvinPDShiftMoveMaker.cs
r17226 r17698 57 57 } 58 58 59 public static void Apply(PotvinEncod ingsolution, PotvinPDShiftMove move, IVRPProblemInstance problemInstance) {59 public static void Apply(PotvinEncodedSolution solution, PotvinPDShiftMove move, IVRPProblemInstance problemInstance) { 60 60 bool newTour = false; 61 61 … … 121 121 PotvinPDShiftMove move = PDShiftMoveParameter.ActualValue; 122 122 123 PotvinEncod ing newSolution = move.Individual.Clone() as PotvinEncoding;123 PotvinEncodedSolution newSolution = move.Individual.Clone() as PotvinEncodedSolution; 124 124 Apply(newSolution, move, ProblemInstance); 125 125 VRPToursParameter.ActualValue = newSolution; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDShift/PotvinPDShiftMoveTabuCriterion.cs
r17226 r17698 44 44 get { return PDShiftMoveParameter; } 45 45 } 46 public ILookupParameter<IVRPEncod ing> VRPToursParameter {47 get { return (ILookupParameter<IVRPEncod ing>)Parameters["VRPTours"]; }46 public ILookupParameter<IVRPEncodedSolution> VRPToursParameter { 47 get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["VRPTours"]; } 48 48 } 49 49 public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter { … … 88 88 : base() { 89 89 Parameters.Add(new LookupParameter<PotvinPDShiftMove>("PotvinPDShiftMove", "The moves that should be made.")); 90 Parameters.Add(new LookupParameter<IVRPEncod ing>("VRPTours", "The VRP tours considered in the move."));90 Parameters.Add(new LookupParameter<IVRPEncodedSolution>("VRPTours", "The VRP tours considered in the move.")); 91 91 Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance")); 92 92 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDShift/PotvinPDShiftMoveTabuMaker.cs
r17226 r17698 38 38 get { return PDShiftMoveParameter; } 39 39 } 40 public ILookupParameter<IVRPEncod ing> VRPToursParameter {41 get { return (ILookupParameter<IVRPEncod ing>)Parameters["VRPTours"]; }40 public ILookupParameter<IVRPEncodedSolution> VRPToursParameter { 41 get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["VRPTours"]; } 42 42 } 43 43 public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter { … … 64 64 : base() { 65 65 Parameters.Add(new LookupParameter<PotvinPDShiftMove>("PotvinPDShiftMove", "The moves that should be made.")); 66 Parameters.Add(new LookupParameter<IVRPEncod ing>("VRPTours", "The VRP tours considered in the move."));66 Parameters.Add(new LookupParameter<IVRPEncodedSolution>("VRPTours", "The VRP tours considered in the move.")); 67 67 Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance")); 68 68 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDShift/PotvinPDShiftMultiMoveGenerator.cs
r17226 r17698 59 59 } 60 60 61 protected override PotvinPDShiftMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance) {61 protected override PotvinPDShiftMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) { 62 62 List<PotvinPDShiftMove> result = new List<PotvinPDShiftMove>(); 63 63 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDShift/PotvinPDShiftSingleMoveGenerator.cs
r17226 r17698 54 54 } 55 55 56 public static PotvinPDShiftMove Apply(PotvinEncod ingindividual, IVRPProblemInstance problemInstance, IRandom rand) {56 public static PotvinPDShiftMove Apply(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance, IRandom rand) { 57 57 List<int> cities = new List<int>(); 58 58 … … 82 82 } 83 83 84 protected override PotvinPDShiftMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance) {84 protected override PotvinPDShiftMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) { 85 85 List<PotvinPDShiftMove> result = new List<PotvinPDShiftMove>(); 86 86 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PotvinMoveGenerator.cs
r17226 r17698 42 42 43 43 public override IOperation InstrumentedApply() { 44 IVRPEncod ingsolution = VRPToursParameter.ActualValue;45 if (!(solution is PotvinEncod ing)) {46 VRPToursParameter.ActualValue = PotvinEncod ing.ConvertFrom(solution, ProblemInstance);44 IVRPEncodedSolution solution = VRPToursParameter.ActualValue; 45 if (!(solution is PotvinEncodedSolution)) { 46 VRPToursParameter.ActualValue = PotvinEncodedSolution.ConvertFrom(solution, ProblemInstance); 47 47 } 48 48 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/PotvinTwoOptStarExhaustiveMoveGenerator.cs
r17226 r17698 46 46 } 47 47 48 protected override PotvinTwoOptStarMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance) {48 protected override PotvinTwoOptStarMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) { 49 49 List<PotvinTwoOptStarMove> result = new List<PotvinTwoOptStarMove>(); 50 50 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/PotvinTwoOptStarMove.cs
r17226 r17698 32 32 public class PotvinTwoOptStarMove : Item, IVRPMove { 33 33 [Storable] 34 public IVRPEncod ingIndividual { get; protected set; }34 public IVRPEncodedSolution Individual { get; protected set; } 35 35 36 36 [Storable] … … 56 56 } 57 57 58 public PotvinTwoOptStarMove(int tour1, int x1, int tour2, int x2, PotvinEncod ingindividual) {58 public PotvinTwoOptStarMove(int tour1, int x1, int tour2, int x2, PotvinEncodedSolution individual) { 59 59 Tour1 = tour1; 60 60 X1 = x1; … … 62 62 X2 = x2; 63 63 64 this.Individual = individual.Clone() as PotvinEncod ing;64 this.Individual = individual.Clone() as PotvinEncodedSolution; 65 65 } 66 66 … … 76 76 this.X2 = original.X2; 77 77 78 this.Individual = cloner.Clone(Individual) as PotvinEncod ing;78 this.Individual = cloner.Clone(Individual) as PotvinEncodedSolution; 79 79 } 80 80 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/PotvinTwoOptStarMoveEvaluator.cs
r17226 r17698 55 55 PotvinTwoOptStarMove move = TwoOptStarMoveParameter.ActualValue; 56 56 57 PotvinEncod ing newSolution = TwoOptStarMoveParameter.ActualValue.Individual.Clone() as PotvinEncoding;57 PotvinEncodedSolution newSolution = TwoOptStarMoveParameter.ActualValue.Individual.Clone() as PotvinEncodedSolution; 58 58 PotvinTwoOptStarMoveMaker.Apply(newSolution, move, ProblemInstance); 59 59 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/PotvinTwoOptStarMoveGenerator.cs
r17226 r17698 55 55 } 56 56 57 protected abstract PotvinTwoOptStarMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance);57 protected abstract PotvinTwoOptStarMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance); 58 58 59 59 public override IOperation InstrumentedApply() { 60 60 IOperation next = base.InstrumentedApply(); 61 61 62 PotvinEncod ing individual = VRPToursParameter.ActualValue as PotvinEncoding;62 PotvinEncodedSolution individual = VRPToursParameter.ActualValue as PotvinEncodedSolution; 63 63 PotvinTwoOptStarMove[] moves = GenerateMoves(individual, ProblemInstance); 64 64 Scope[] moveScopes = new Scope[moves.Length]; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/PotvinTwoOptStarMoveMaker.cs
r17226 r17698 57 57 58 58 public static void GetSegments(PotvinTwoOptStarMove move, out List<int> segmentX1, out List<int> segmentX2) { 59 PotvinEncod ing solution = move.Individual as PotvinEncoding;59 PotvinEncodedSolution solution = move.Individual as PotvinEncodedSolution; 60 60 61 61 Tour route1 = solution.Tours[move.Tour1]; … … 78 78 } 79 79 80 public static void Apply(PotvinEncod ingsolution, PotvinTwoOptStarMove move, IVRPProblemInstance problemInstance) {80 public static void Apply(PotvinEncodedSolution solution, PotvinTwoOptStarMove move, IVRPProblemInstance problemInstance) { 81 81 List<int> segmentX1; 82 82 List<int> segmentX2; … … 98 98 PotvinTwoOptStarMove move = TwoOptStarMoveParameter.ActualValue; 99 99 100 PotvinEncod ing newSolution = move.Individual.Clone() as PotvinEncoding;100 PotvinEncodedSolution newSolution = move.Individual.Clone() as PotvinEncodedSolution; 101 101 Apply(newSolution, move, ProblemInstance); 102 102 newSolution.Repair(); -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/PotvinTwoOptStarMoveTabuCriterion.cs
r17226 r17698 45 45 get { return TwoOptStarMoveParameter; } 46 46 } 47 public ILookupParameter<IVRPEncod ing> VRPToursParameter {48 get { return (ILookupParameter<IVRPEncod ing>)Parameters["VRPTours"]; }47 public ILookupParameter<IVRPEncodedSolution> VRPToursParameter { 48 get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["VRPTours"]; } 49 49 } 50 50 public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter { … … 89 89 : base() { 90 90 Parameters.Add(new LookupParameter<PotvinTwoOptStarMove>("PotvinTwoOptStarMove", "The moves that should be made.")); 91 Parameters.Add(new LookupParameter<IVRPEncod ing>("VRPTours", "The VRP tours considered in the move."));91 Parameters.Add(new LookupParameter<IVRPEncodedSolution>("VRPTours", "The VRP tours considered in the move.")); 92 92 Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance")); 93 93 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/PotvinTwoOptStarMoveTabuMaker.cs
r17226 r17698 57 57 get { return TwoOptStarMoveParameter; } 58 58 } 59 public ILookupParameter<IVRPEncod ing> VRPToursParameter {60 get { return (ILookupParameter<IVRPEncod ing>)Parameters["VRPTours"]; }59 public ILookupParameter<IVRPEncodedSolution> VRPToursParameter { 60 get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["VRPTours"]; } 61 61 } 62 62 public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter { … … 86 86 87 87 Parameters.Add(new LookupParameter<PotvinTwoOptStarMove>("PotvinTwoOptStarMove", "The moves that should be made.")); 88 Parameters.Add(new LookupParameter<IVRPEncod ing>("VRPTours", "The VRP tours considered in the move."));88 Parameters.Add(new LookupParameter<IVRPEncodedSolution>("VRPTours", "The VRP tours considered in the move.")); 89 89 Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance")); 90 90 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/PotvinTwoOptStarMultiMoveGenerator.cs
r17226 r17698 59 59 } 60 60 61 protected override PotvinTwoOptStarMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance) {61 protected override PotvinTwoOptStarMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) { 62 62 List<PotvinTwoOptStarMove> result = new List<PotvinTwoOptStarMove>(); 63 63 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/PotvinTwoOptStarSingleMoveGenerator.cs
r17226 r17698 61 61 } 62 62 63 public static PotvinTwoOptStarMove Apply(PotvinEncod ingindividual, IVRPProblemInstance problemInstance, IRandom rand) {63 public static PotvinTwoOptStarMove Apply(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance, IRandom rand) { 64 64 int route1Idx = rand.Next(individual.Tours.Count); 65 65 int route2Idx = rand.Next(individual.Tours.Count - 1); … … 76 76 } 77 77 78 protected override PotvinTwoOptStarMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance) {78 protected override PotvinTwoOptStarMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) { 79 79 List<PotvinTwoOptStarMove> result = new List<PotvinTwoOptStarMove>(); 80 80 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/VehicleAssignment/PotvinVehicleAssignmentExhaustiveMoveGenerator.cs
r17226 r17698 46 46 } 47 47 48 protected override PotvinVehicleAssignmentMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance) {48 protected override PotvinVehicleAssignmentMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) { 49 49 List<PotvinVehicleAssignmentMove> result = new List<PotvinVehicleAssignmentMove>(); 50 50 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/VehicleAssignment/PotvinVehicleAssignmentMove.cs
r17226 r17698 32 32 public class PotvinVehicleAssignmentMove : Item, IVRPMove { 33 33 [Storable] 34 public IVRPEncod ingIndividual { get; protected set; }34 public IVRPEncodedSolution Individual { get; protected set; } 35 35 36 36 [Storable] … … 49 49 } 50 50 51 public PotvinVehicleAssignmentMove(int tour1, int tour2, PotvinEncod ingindividual) {51 public PotvinVehicleAssignmentMove(int tour1, int tour2, PotvinEncodedSolution individual) { 52 52 Tour1 = tour1; 53 53 Tour2 = tour2; 54 54 55 this.Individual = individual.Clone() as PotvinEncod ing;55 this.Individual = individual.Clone() as PotvinEncodedSolution; 56 56 } 57 57 … … 65 65 this.Tour2 = original.Tour2; 66 66 67 this.Individual = cloner.Clone(Individual) as PotvinEncod ing;67 this.Individual = cloner.Clone(Individual) as PotvinEncodedSolution; 68 68 } 69 69 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/VehicleAssignment/PotvinVehicleAssignmentMoveEvaluator.cs
r17226 r17698 56 56 PotvinVehicleAssignmentMove move = VehicleAssignmentMoveParameter.ActualValue; 57 57 58 PotvinEncod ing newSolution = VehicleAssignmentMoveParameter.ActualValue.Individual.Clone() as PotvinEncoding;58 PotvinEncodedSolution newSolution = VehicleAssignmentMoveParameter.ActualValue.Individual.Clone() as PotvinEncodedSolution; 59 59 PotvinVehicleAssignmentMoveMaker.Apply(newSolution, move, ProblemInstance); 60 60 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/VehicleAssignment/PotvinVehicleAssignmentMoveGenerator.cs
r17226 r17698 55 55 } 56 56 57 protected abstract PotvinVehicleAssignmentMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance);57 protected abstract PotvinVehicleAssignmentMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance); 58 58 59 59 public override IOperation InstrumentedApply() { 60 60 IOperation next = base.InstrumentedApply(); 61 61 62 PotvinEncod ing individual = VRPToursParameter.ActualValue as PotvinEncoding;62 PotvinEncodedSolution individual = VRPToursParameter.ActualValue as PotvinEncodedSolution; 63 63 PotvinVehicleAssignmentMove[] moves = GenerateMoves(individual, ProblemInstance); 64 64 Scope[] moveScopes = new Scope[moves.Length]; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/VehicleAssignment/PotvinVehicleAssignmentMoveMaker.cs
r17226 r17698 67 67 } 68 68 69 public static void Apply(PotvinEncod ingsolution, PotvinVehicleAssignmentMove move, IVRPProblemInstance problemInstance) {69 public static void Apply(PotvinEncodedSolution solution, PotvinVehicleAssignmentMove move, IVRPProblemInstance problemInstance) { 70 70 int vehicle1 = solution.VehicleAssignment[move.Tour1]; 71 71 int vehicle2 = solution.VehicleAssignment[move.Tour2]; … … 78 78 PotvinVehicleAssignmentMove move = VehicleAssignmentMoveParameter.ActualValue; 79 79 80 PotvinEncod ing newSolution = move.Individual.Clone() as PotvinEncoding;80 PotvinEncodedSolution newSolution = move.Individual.Clone() as PotvinEncodedSolution; 81 81 Apply(newSolution, move, ProblemInstance); 82 82 newSolution.Repair(); -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/VehicleAssignment/PotvinVehicleAssignmentMoveTabuCriterion.cs
r17226 r17698 44 44 get { return VehicleAssignmentMoveParameter; } 45 45 } 46 public ILookupParameter<IVRPEncod ing> VRPToursParameter {47 get { return (ILookupParameter<IVRPEncod ing>)Parameters["VRPTours"]; }46 public ILookupParameter<IVRPEncodedSolution> VRPToursParameter { 47 get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["VRPTours"]; } 48 48 } 49 49 public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter { … … 88 88 : base() { 89 89 Parameters.Add(new LookupParameter<PotvinVehicleAssignmentMove>("PotvinVehicleAssignmentMove", "The moves that should be made.")); 90 Parameters.Add(new LookupParameter<IVRPEncod ing>("VRPTours", "The VRP tours considered in the move."));90 Parameters.Add(new LookupParameter<IVRPEncodedSolution>("VRPTours", "The VRP tours considered in the move.")); 91 91 Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance")); 92 92 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/VehicleAssignment/PotvinVehicleAssignmentMoveTabuMaker.cs
r17226 r17698 56 56 get { return VehicleAssignmentMoveParameter; } 57 57 } 58 public ILookupParameter<IVRPEncod ing> VRPToursParameter {59 get { return (ILookupParameter<IVRPEncod ing>)Parameters["VRPTours"]; }58 public ILookupParameter<IVRPEncodedSolution> VRPToursParameter { 59 get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["VRPTours"]; } 60 60 } 61 61 public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter { … … 85 85 86 86 Parameters.Add(new LookupParameter<PotvinVehicleAssignmentMove>("PotvinVehicleAssignmentMove", "The moves that should be made.")); 87 Parameters.Add(new LookupParameter<IVRPEncod ing>("VRPTours", "The VRP tours considered in the move."));87 Parameters.Add(new LookupParameter<IVRPEncodedSolution>("VRPTours", "The VRP tours considered in the move.")); 88 88 Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance")); 89 89 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/VehicleAssignment/PotvinVehicleAssignmentMultiMoveGenerator.cs
r17226 r17698 59 59 } 60 60 61 protected override PotvinVehicleAssignmentMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance) {61 protected override PotvinVehicleAssignmentMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) { 62 62 List<PotvinVehicleAssignmentMove> result = new List<PotvinVehicleAssignmentMove>(); 63 63 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/VehicleAssignment/PotvinVehicleAssignmentSingleMoveGenerator.cs
r17226 r17698 61 61 } 62 62 63 public static PotvinVehicleAssignmentMove Apply(PotvinEncod ingindividual, IVRPProblemInstance problemInstance, IRandom rand) {63 public static PotvinVehicleAssignmentMove Apply(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance, IRandom rand) { 64 64 if (individual.Tours.Count > 1) { 65 65 int tour1 = rand.Next(individual.Tours.Count); … … 75 75 } 76 76 77 protected override PotvinVehicleAssignmentMove[] GenerateMoves(PotvinEncod ingindividual, IVRPProblemInstance problemInstance) {77 protected override PotvinVehicleAssignmentMove[] GenerateMoves(PotvinEncodedSolution individual, IVRPProblemInstance problemInstance) { 78 78 List<PotvinVehicleAssignmentMove> result = new List<PotvinVehicleAssignmentMove>(); 79 79
Note: See TracChangeset
for help on using the changeset viewer.