mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
bugfix: all jobs in initial routes are included into VRP.allJobs
This commit is contained in:
parent
36d0b644a0
commit
1967430c40
1 changed files with 5 additions and 5 deletions
|
|
@ -81,7 +81,7 @@ public class VehicleRoutingProblem {
|
|||
|
||||
private Map<String, Job> tentativeJobs = new LinkedHashMap<String, Job>();
|
||||
|
||||
private Set<String> jobsInInitialRoutes = new HashSet<String>();
|
||||
private Set<Job> jobsInInitialRoutes = new HashSet<>();
|
||||
|
||||
private Map<String, Coordinate> tentative_coordinates = new HashMap<String, Coordinate>();
|
||||
|
||||
|
|
@ -308,7 +308,7 @@ public class VehicleRoutingProblem {
|
|||
incActivityIndexCounter();
|
||||
if (act instanceof TourActivity.JobActivity) {
|
||||
Job job = ((TourActivity.JobActivity) act).getJob();
|
||||
jobsInInitialRoutes.add(job.getId());
|
||||
jobsInInitialRoutes.add(job);
|
||||
addLocationToTentativeLocations(job);
|
||||
registerJobAndActivity(abstractAct, job);
|
||||
}
|
||||
|
|
@ -429,7 +429,7 @@ public class VehicleRoutingProblem {
|
|||
transportCosts = new CrowFlyCosts(getLocations());
|
||||
}
|
||||
for (Job job : tentativeJobs.values()) {
|
||||
if (!jobsInInitialRoutes.contains(job.getId())) {
|
||||
if (!jobsInInitialRoutes.contains(job)) {
|
||||
addJobToFinalJobMapAndCreateActivities(job);
|
||||
}
|
||||
}
|
||||
|
|
@ -438,8 +438,8 @@ public class VehicleRoutingProblem {
|
|||
for (Job job : jobs.values()) {
|
||||
((AbstractJob)job).setIndex(jobIndexCounter++);
|
||||
}
|
||||
for (String jobId : jobsInInitialRoutes) {
|
||||
((AbstractJob)tentativeJobs.get(jobId)).setIndex(jobIndexCounter++);
|
||||
for (Job job : jobsInInitialRoutes) {
|
||||
((AbstractJob)job).setIndex(jobIndexCounter++);
|
||||
}
|
||||
|
||||
boolean hasBreaks = addBreaksToActivityMap();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue