- Timestamp:
- 09/27/11 13:29:56 (13 years ago)
- Location:
- branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPEvaluator.cs
r6752 r6838 47 47 } 48 48 49 protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour ) {49 protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncoding solution) { 50 50 TourInsertionInfo tourInfo = new TourInsertionInfo(); 51 51 eval.InsertionInfo.AddTourInsertionInfo(tourInfo); -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWEvaluator.cs
r6752 r6838 47 47 } 48 48 49 protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour ) {49 protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncoding solution) { 50 50 TourInsertionInfo tourInfo = new TourInsertionInfo(); 51 51 eval.InsertionInfo.AddTourInsertionInfo(tourInfo); -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWEvaluator.cs
r6752 r6838 51 51 } 52 52 53 protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour ) {53 protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncoding solution) { 54 54 TourInsertionInfo tourInfo = new TourInsertionInfo(); 55 55 eval.InsertionInfo.AddTourInsertionInfo(tourInfo); -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/SingleDepotVRPEvaluator.cs
r6752 r6838 40 40 [StorableClass] 41 41 public class SingleDepotVRPEvaluator: VRPEvaluator { 42 protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour ) {42 protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncoding solution) { 43 43 TourInsertionInfo tourInfo = new TourInsertionInfo(); 44 44 eval.InsertionInfo.AddTourInsertionInfo(tourInfo); -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPEvaluator.cs
r6752 r6838 81 81 } 82 82 83 protected abstract void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour );83 protected abstract void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncoding solution); 84 84 85 85 protected virtual void InitResultParameters() { … … 95 95 DistanceParameter.ActualValue.Value = tourEvaluation.Distance; 96 96 PenaltyParameter.ActualValue.Value = tourEvaluation.Penalty; 97 }98 99 private VRPEvaluation EvaluateTour(IVRPProblemInstance instance, Tour tour) {100 VRPEvaluation evaluation = CreateTourEvaluation();101 EvaluateTour(evaluation, instance, tour);102 return evaluation;103 97 } 104 98 … … 123 117 } 124 118 119 public VRPEvaluation EvaluateTour(IVRPProblemInstance instance, Tour tour, IVRPEncoding solution) { 120 VRPEvaluation evaluation = CreateTourEvaluation(); 121 EvaluateTour(evaluation, instance, tour, solution); 122 return evaluation; 123 } 124 125 125 public VRPEvaluation Evaluate(IVRPProblemInstance instance, IVRPEncoding solution) { 126 126 VRPEvaluation evaluation = CreateTourEvaluation(); 127 127 128 128 foreach (Tour tour in solution.GetTours()) { 129 EvaluateTour(evaluation, instance, tour );129 EvaluateTour(evaluation, instance, tour, solution); 130 130 } 131 131 132 132 return evaluation; 133 }134 135 public VRPEvaluation Evaluate(IVRPProblemInstance instance, Tour tour) {136 return EvaluateTour(instance, tour);137 133 } 138 134 … … 141 137 142 138 VRPEvaluation evaluation = CreateTourEvaluation(); 143 foreach (Tour tour in VRPToursParameter.ActualValue.GetTours()) { 144 EvaluateTour(evaluation, ProblemInstance, tour); 139 IVRPEncoding solution = VRPToursParameter.ActualValue; 140 foreach (Tour tour in solution.GetTours()) { 141 EvaluateTour(evaluation, ProblemInstance, tour, solution); 145 142 } 146 143 SetResultParameters(evaluation); -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs
r6752 r6838 212 212 } 213 213 214 public bool Feasible(Tour tour) {214 public bool TourFeasible(Tour tour, IVRPEncoding solution) { 215 215 return evaluator.Feasible( 216 evaluator.Evaluate (217 this, tour ));216 evaluator.EvaluateTour( 217 this, tour, solution)); 218 218 } 219 219 … … 222 222 } 223 223 224 public VRPEvaluation Evaluate (Tour tour) {225 return evaluator.Evaluate (this, tour);224 public VRPEvaluation EvaluateTour(Tour tour, IVRPEncoding solution) { 225 return evaluator.EvaluateTour(this, tour, solution); 226 226 } 227 227
Note: See TracChangeset
for help on using the changeset viewer.