Class AbstractPathFinder.StopConditionTimeout<E>

java.lang.Object
megamek.common.pathfinder.AbstractPathFinder.StopConditionTimeout<E>
All Implemented Interfaces:
AbstractPathFinder.StopCondition<E>
Enclosing class:
AbstractPathFinder<N,C,E>

public static class AbstractPathFinder.StopConditionTimeout<E> extends Object implements AbstractPathFinder.StopCondition<E>
A timeout stop condition. The shouldStop() returns answer based on time elapsed since initialisation or last restart() call.
  • Field Details

    • timeoutEngaged

      public boolean timeoutEngaged
  • Constructor Details

    • StopConditionTimeout

      public StopConditionTimeout(int timeoutMillis)
  • Method Details

    • getLastEdge

      public E getLastEdge()
    • getTimeout

      public int getTimeout()
    • restart

      public void restart()
    • shouldStop

      public boolean shouldStop(E e)
      Specified by:
      shouldStop in interface AbstractPathFinder.StopCondition<E>
      Parameters:
      e - the last edge that was successfully relaxed
      Returns:
      true iff algorithm should stop searching for new paths