1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

account for more prio levels in scorer and obj function

This commit is contained in:
oblonski 2017-01-30 20:05:49 +01:00
parent 7d2881f4c1
commit d7b4122e10
No known key found for this signature in database
GPG key ID: 179DE487285680D1
2 changed files with 3 additions and 3 deletions

View file

@ -720,7 +720,7 @@ public class Jsprit {
} }
} }
for(Job j : solution.getUnassignedJobs()){ for(Job j : solution.getUnassignedJobs()){
costs += maxCosts * 2 * (4 - j.getPriority()); costs += maxCosts * 2 * (11 - j.getPriority());
} }
return costs; return costs;
} }

View file

@ -33,9 +33,9 @@ class Scorer {
if (secondBest == null) { //either there is only one vehicle or there are more vehicles, but they cannot load unassignedJob if (secondBest == null) { //either there is only one vehicle or there are more vehicles, but they cannot load unassignedJob
//if only one vehicle, I want the job to be inserted with min iCosts //if only one vehicle, I want the job to be inserted with min iCosts
//if there are more vehicles, I want this job to be prioritized since there are no alternatives //if there are more vehicles, I want this job to be prioritized since there are no alternatives
score = (4 - unassignedJob.getPriority()) * (Integer.MAX_VALUE - best.getInsertionCost()) + scoringFunction.score(best, unassignedJob); score = (11 - unassignedJob.getPriority()) * (Integer.MAX_VALUE - best.getInsertionCost()) + scoringFunction.score(best, unassignedJob);
} else { } else {
score = (4 - unassignedJob.getPriority()) * (secondBest.getInsertionCost() - best.getInsertionCost()) + scoringFunction.score(best, unassignedJob); score = (11 - unassignedJob.getPriority()) * (secondBest.getInsertionCost() - best.getInsertionCost()) + scoringFunction.score(best, unassignedJob);
} }
return score; return score;
} }