From 3dd92ccd7ebc2e28c7d341d7b194276a8ddbcf7f Mon Sep 17 00:00:00 2001 From: oblonski Date: Fri, 24 Jun 2016 08:52:17 +0200 Subject: [PATCH] skip exception for services --- .../problem/solution/route/activity/TourActivities.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/jsprit-core/src/main/java/com/graphhopper/jsprit/core/problem/solution/route/activity/TourActivities.java b/jsprit-core/src/main/java/com/graphhopper/jsprit/core/problem/solution/route/activity/TourActivities.java index 7097818a..54df64ef 100644 --- a/jsprit-core/src/main/java/com/graphhopper/jsprit/core/problem/solution/route/activity/TourActivities.java +++ b/jsprit-core/src/main/java/com/graphhopper/jsprit/core/problem/solution/route/activity/TourActivities.java @@ -115,7 +115,9 @@ public class TourActivities { } /** - * Removes job AND belonging activity from tour. + * Removes job AND belonging activity from tour. Note that if job is a Service, it is assumed that there is only one belonging activity, + * thus, it stops trying to remove activities once the first is found. + * If you want to always look for belonging activities to be removed in the entire route, use removeJob(Job job, boolean enforceEntireRoute) * * @param job to be removed * @return true if job has been removed, otherwise false. @@ -136,9 +138,6 @@ public class TourActivities { if (job.equals(underlyingJob)) { iterator.remove(); activityRemoved = true; - if (underlyingJob instanceof Service) { - break; - } } } } @@ -146,6 +145,8 @@ public class TourActivities { return activityRemoved; } + + /** * Removes activity from this activity sequence. Removes its corresponding job as well, if there are no other activities * related to this job.