From d241647f34e35e59bd223c781a9d637d5010ae80 Mon Sep 17 00:00:00 2001 From: oblonski Date: Wed, 25 May 2016 10:05:14 +0200 Subject: [PATCH] align default cost func --- .../com/graphhopper/jsprit/core/algorithm/box/Jsprit.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/jsprit-core/src/main/java/com/graphhopper/jsprit/core/algorithm/box/Jsprit.java b/jsprit-core/src/main/java/com/graphhopper/jsprit/core/algorithm/box/Jsprit.java index 2fc20cf0..fce66c3d 100644 --- a/jsprit-core/src/main/java/com/graphhopper/jsprit/core/algorithm/box/Jsprit.java +++ b/jsprit-core/src/main/java/com/graphhopper/jsprit/core/algorithm/box/Jsprit.java @@ -638,15 +638,13 @@ public class Jsprit { if (!hasBreak) { //break defined and required but not assigned penalty if (route.getEnd().getArrTime() > route.getVehicle().getBreak().getTimeWindow().getEnd()) { - costs += maxCosts * 1 + route.getVehicle().getBreak().getServiceDuration() * route.getVehicle().getType().getVehicleCostParams().perServiceTimeUnit; - } else { -// costs -= maxCosts * 2; + costs += 4 * (maxCosts * 2 + route.getVehicle().getBreak().getServiceDuration() * route.getVehicle().getType().getVehicleCostParams().perServiceTimeUnit); } } } } for(Job j : solution.getUnassignedJobs()){ - costs += maxCosts * (4 - j.getPriority()); + costs += maxCosts * 2 * (4 - j.getPriority()); } return costs; }