Skip to content

Commit

Permalink
fix LNS OutOfBoundsException for very few agents
Browse files Browse the repository at this point in the history
  • Loading branch information
J-morag committed Nov 24, 2023
1 parent a63f771 commit 81a156c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ protected Solution solveLNS(MAPF_Instance instance, ConstraintSet initialConstra
// select neighborhood (destroy heuristic)
int destroyHeuristicIndex = selectDestroyHeuristicIndex();
I_DestroyHeuristic destroyHeuristic = this.destroyHeuristics.get(destroyHeuristicIndex);
Set<Agent> agentsSubset = new HashSet<>(destroyHeuristic.selectNeighborhood(bestSolution, Math.min(neighborhoodSize, agents.size()), random, instance.map));
Set<Agent> agentsSubset = new HashSet<>(destroyHeuristic.selectNeighborhood(bestSolution, Math.min(neighborhoodSize, agents.size()-1), random, instance.map));

// get solution without selected agents
Solution destroyedSolution = new Solution();
Expand Down

0 comments on commit 81a156c

Please sign in to comment.