Пример #1
0
 /** @param botId */
 public void stopPathPlanning(final BotID botId) {
   PathFinderThread thread = pathFinderThreads.get(botId);
   if (thread != null) {
     thread.stop();
   }
   clearPath(botId);
 }
Пример #2
0
  /**
   * 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);
  }
Пример #3
0
 /** 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();
 }