Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
also sum up jspritScore of auxiliary carriers
Browse files Browse the repository at this point in the history
  • Loading branch information
kt86 committed Aug 7, 2024
1 parent 8848007 commit 21c23bd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,19 @@ public static Double sumUpScore(List<CarrierPlan> scheduledPlans) {
}
return score;
}

/**
* Sum up the jsprit score of the given list of CarrierPlans.
* As a consequence this is not from the one and only jsprit run, but from all jsprit runs af the different auxiliary carriers.
* @param scheduledPlans
* @return the summ of the scores coming from jsprit
*/
public static Double sumUpJspritScore(List<CarrierPlan> scheduledPlans) {
double jspritScore = 0;
for (CarrierPlan scheduledPlan : scheduledPlans) {
if (scheduledPlan.getJspritScore() != null) {
jspritScore = jspritScore + scheduledPlan.getJspritScore(); }
}
return jspritScore;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ protected void scheduleResource() {

CarrierPlan plan = new CarrierPlan(carrier, unifyTourIds(scheduledPlans));
plan.setScore(CarrierSchedulerUtils.sumUpScore(scheduledPlans));
plan.setJspritScore(CarrierSchedulerUtils.sumUpJspritScore(scheduledPlans));
carrier.setSelectedPlan(plan);
}

Expand Down

0 comments on commit 21c23bd

Please sign in to comment.