Package megamek.common.pathfinder
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
timeoutEngaged
public boolean timeoutEngaged
-
-
Constructor Details
-
StopConditionTimeout
public StopConditionTimeout(int timeoutMillis)
-
-
Method Details
-
getLastEdge
-
getTimeout
public int getTimeout() -
restart
public void restart() -
shouldStop
- Specified by:
shouldStop
in interfaceAbstractPathFinder.StopCondition<E>
- Parameters:
e
- the last edge that was successfully relaxed- Returns:
- true iff algorithm should stop searching for new paths
-