File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
jsprit-core/src/main/java/com/graphhopper/jsprit/core/algorithm/ruin Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,8 @@ public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) {
95
95
noStrings = Math .min (noStrings , vehicleRoutes .size ());
96
96
Set <Job > unassignedJobs = new HashSet <>();
97
97
Set <VehicleRoute > ruinedRoutes = new HashSet <>();
98
- Job prevJob = RandomUtils .nextJob (vrp .getJobs ().values (), random );
98
+ Collection <Job > filteredJobs = filterJobs (vrp .getJobs ().values ());
99
+ Job prevJob = RandomUtils .nextJob (filteredJobs , random );
99
100
Iterator <Job > neighborhoodIterator = jobNeighborhoods .getNearestNeighborsIterator (kMax * lMax , prevJob );
100
101
while (neighborhoodIterator .hasNext () && ruinedRoutes .size () <= noStrings ) {
101
102
if (!unassignedJobs .contains (prevJob )) {
You can’t perform that action at this time.
0 commit comments