Changeset 17698 for branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar
- Timestamp:
- 07/24/20 00:58:42 (4 years ago)
- Location:
- branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.