Changeset 6851 for branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP
- Timestamp:
- 09/29/11 15:51:56 (13 years ago)
- Location:
- branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPEvaluator.cs
r6838 r6851 38 38 [Item("CVRPEvaluator", "Represents a single depot CVRP evaluator.")] 39 39 [StorableClass] 40 public class CVRPEvaluator: SingleDepotVRPEvaluator {40 public class CVRPEvaluator: VRPEvaluator { 41 41 public ILookupParameter<DoubleValue> OverloadParameter { 42 42 get { return (ILookupParameter<DoubleValue>)Parameters["Overload"]; } … … 79 79 80 80 //drive there 81 double currentDistace = instance.GetDistance(start, end );81 double currentDistace = instance.GetDistance(start, end, solution); 82 82 distance += currentDistace; 83 83 … … 103 103 } 104 104 105 protected override double GetTourInsertionCosts(IVRPProblemInstance instance, TourInsertionInfo tourInsertionInfo, int index, int customer,105 protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncoding solution, TourInsertionInfo tourInsertionInfo, int index, int customer, 106 106 out bool feasible) { 107 107 CVRPInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPInsertionInfo; … … 113 113 double overloadPenalty = cvrp.OverloadPenalty.Value; 114 114 115 double distance = instance.GetDistance(insertionInfo.Start, insertionInfo.End );115 double distance = instance.GetDistance(insertionInfo.Start, insertionInfo.End, solution); 116 116 double newDistance = 117 instance.GetDistance(insertionInfo.Start, customer ) +118 instance.GetDistance(customer, insertionInfo.End );117 instance.GetDistance(insertionInfo.Start, customer, solution) + 118 instance.GetDistance(customer, insertionInfo.End, solution); 119 119 costs += instance.DistanceFactor.Value * (newDistance - distance); 120 120 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWEvaluator.cs
r6838 r6851 85 85 86 86 //drive there 87 double currentDistace = vrptw.GetDistance(start, end );87 double currentDistace = vrptw.GetDistance(start, end, solution); 88 88 time += currentDistace; 89 89 distance += currentDistace; … … 166 166 } 167 167 168 protected override double GetTourInsertionCosts(IVRPProblemInstance instance, TourInsertionInfo tourInsertionInfo, int index, int customer,168 protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncoding solution, TourInsertionInfo tourInsertionInfo, int index, int customer, 169 169 out bool feasible) { 170 170 CVRPPDTWInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPPDTWInsertionInfo; … … 187 187 double pickupPenalty = pdp.PickupViolationPenalty.Value; 188 188 189 double distance = instance.GetDistance(insertionInfo.Start, insertionInfo.End );189 double distance = instance.GetDistance(insertionInfo.Start, insertionInfo.End, solution); 190 190 double newDistance = 191 instance.GetDistance(insertionInfo.Start, customer ) +192 instance.GetDistance(customer, insertionInfo.End );191 instance.GetDistance(insertionInfo.Start, customer, solution) + 192 instance.GetDistance(customer, insertionInfo.End, solution); 193 193 costs += instance.DistanceFactor.Value * (newDistance - distance); 194 194 … … 215 215 if (index > 0) 216 216 time = (tourInsertionInfo.GetStopInsertionInfo(index - 1) as CVRPTWInsertionInfo).LeaveTime; 217 time += instance.GetDistance(insertionInfo.Start, customer );217 time += instance.GetDistance(insertionInfo.Start, customer, solution); 218 218 if (time > dueTime[customer]) { 219 219 tardiness += time - dueTime[customer]; … … 222 222 time += readyTime[customer] - time; 223 223 time += serviceTimes[customer]; 224 time += instance.GetDistance(customer, insertionInfo.End );224 time += instance.GetDistance(customer, insertionInfo.End, solution); 225 225 226 226 double additionalTime = time - (tourInsertionInfo.GetStopInsertionInfo(index) as CVRPTWInsertionInfo).ArrivalTime; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWEvaluator.cs
r6838 r6851 92 92 93 93 //drive there 94 double currentDistace = vrptw.GetDistance(start, end );94 double currentDistace = vrptw.GetDistance(start, end, solution); 95 95 time += currentDistace; 96 96 distance += currentDistace; … … 150 150 } 151 151 152 protected override double GetTourInsertionCosts(IVRPProblemInstance instance, TourInsertionInfo tourInsertionInfo, int index, int customer,152 protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncoding solution, TourInsertionInfo tourInsertionInfo, int index, int customer, 153 153 out bool feasible) { 154 154 CVRPTWInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPTWInsertionInfo; … … 166 166 double tardinessPenalty = vrptw.TardinessPenalty.Value; 167 167 168 double distance = instance.GetDistance(insertionInfo.Start, insertionInfo.End );168 double distance = instance.GetDistance(insertionInfo.Start, insertionInfo.End, solution); 169 169 double newDistance = 170 instance.GetDistance(insertionInfo.Start, customer ) +171 instance.GetDistance(customer, insertionInfo.End );170 instance.GetDistance(insertionInfo.Start, customer, solution) + 171 instance.GetDistance(customer, insertionInfo.End, solution); 172 172 costs += instance.DistanceFactor.Value * (newDistance - distance); 173 173 … … 186 186 if (index > 0) 187 187 time = (tourInsertionInfo.GetStopInsertionInfo(index - 1) as CVRPTWInsertionInfo).LeaveTime; 188 time += instance.GetDistance(insertionInfo.Start, customer );188 time += instance.GetDistance(insertionInfo.Start, customer, solution); 189 189 if (time > dueTime[customer]) { 190 190 tardiness += time - dueTime[customer]; … … 193 193 time += readyTime[customer] - time; 194 194 time += serviceTimes[customer]; 195 time += instance.GetDistance(customer, insertionInfo.End );195 time += instance.GetDistance(customer, insertionInfo.End, solution); 196 196 197 197 double additionalTime = time - (tourInsertionInfo.GetStopInsertionInfo(index) as CVRPTWInsertionInfo).ArrivalTime; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/SingleDepotVRPEvaluator.cs
r6838 r6851 57 57 58 58 //drive there 59 double currentDistace = instance.GetDistance(start, end );59 double currentDistace = instance.GetDistance(start, end, solution); 60 60 distance += currentDistace; 61 61 … … 75 75 } 76 76 77 protected override double GetTourInsertionCosts(IVRPProblemInstance instance, TourInsertionInfo tourInsertionInfo, int index, int customer,77 protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncoding solution, TourInsertionInfo tourInsertionInfo, int index, int customer, 78 78 out bool feasible) { 79 79 StopInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index); … … 82 82 feasible = true; 83 83 84 double distance = instance.GetDistance(insertionInfo.Start, insertionInfo.End );84 double distance = instance.GetDistance(insertionInfo.Start, insertionInfo.End, solution); 85 85 double newDistance = 86 instance.GetDistance(insertionInfo.Start, customer ) +87 instance.GetDistance(customer, insertionInfo.End );86 instance.GetDistance(insertionInfo.Start, customer, solution) + 87 instance.GetDistance(customer, insertionInfo.End, solution); 88 88 89 89 costs += instance.DistanceFactor.Value * (newDistance - distance);
Note: See TracChangeset
for help on using the changeset viewer.