mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
add handler jobs to be ruined exceeds available jobs
This commit is contained in:
parent
48dc694fca
commit
6f1d65e2e9
1 changed files with 1 additions and 0 deletions
|
|
@ -94,6 +94,7 @@ public final class RuinRandom extends AbstractRuinStrategy {
|
|||
private void ruin(Collection<VehicleRoute> vehicleRoutes, int nOfJobs2BeRemoved, List<Job> unassignedJobs) {
|
||||
LinkedList<Job> availableJobs = new LinkedList<Job>(vrp.getJobs().values());
|
||||
for (int i = 0; i < nOfJobs2BeRemoved; i++) {
|
||||
if(availableJobs.isEmpty()) break;
|
||||
Job job = pickRandomJob(availableJobs);
|
||||
unassignedJobs.add(job);
|
||||
availableJobs.remove(job);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue