/** @param botId */ public void stopPathPlanning(final BotID botId) { PathFinderThread thread = pathFinderThreads.get(botId); if (thread != null) { thread.stop(); } clearPath(botId); }
/** * Start the PP thread with given input * * @param botId * @param moveCon * @return */ public Path startPathPlanning(final BotID botId, final MovementCon moveCon) { assureBotInit(botId); newPathCounter.put(botId, 0); PathFinderInput pathFinderInput = new PathFinderInput(botId, currentPaths, 0, moveCon); PathFinderThread thread = pathFinderThreads.get(botId); thread.start(pathFinderInput); return currentPaths.get(botId); }
/** stops all threads */ public final void stopAllPathPlanning() { for (PathFinderThread thread : pathFinderThreads.values()) { thread.stop(); thread.onTermination(); } for (ScheduledExecutorService scheduler : schedulers.values()) { scheduler.shutdown(); } schedulers.clear(); pathFinderThreads.clear(); }