public class UT2004PathExecutor<PATH_ELEMENT extends ILocated> extends BasePathExecutor<PATH_ELEMENT> implements IUT2004PathExecutor<PATH_ELEMENT>, IUT2004PathExecutorHelper<PATH_ELEMENT>
| Modifier and Type | Field and Description |
|---|---|
static int |
PATH_MERGE_CUTOFF
When doing
extendPath(List), how many OLD (already passed by elements) should be left in the merged path. |
mutex, pathElementIndex, pathFuture, previousPathElementIndexlog, state, stuckDetectors| Constructor and Description |
|---|
UT2004PathExecutor(UT2004Bot bot) |
UT2004PathExecutor(UT2004Bot bot,
IUT2004PathNavigator<PATH_ELEMENT> navigator) |
UT2004PathExecutor(UT2004Bot bot,
IUT2004PathNavigator<PATH_ELEMENT> navigator,
Logger log) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
calculateTimeout() |
protected void |
eventEndMessage() |
void |
extendPath(List<PATH_ELEMENT> morePath)
Merges current followed path with "morePath", i.e., it cuts off already passed elements and adds "morePath"
to current path.
|
protected void |
followPathImpl() |
NavPointNeighbourLink |
getCurrentLink()
Returns
NavPointNeighbourLink the bot is currently running over. |
ILocated |
getFocus() |
IUT2004PathNavigator<PATH_ELEMENT> |
getNavigator() |
double |
getRemainingDistance()
Returns how far is our target (path-distance).
|
List<IStuckDetector> |
getStuckDetectors()
Returns list of all stuck detectors registered inside the executor.
|
protected cz.cuni.amis.utils.Tuple2<List<PATH_ELEMENT>,Integer> |
mergePath(List<PATH_ELEMENT> currPath,
int currIndex,
List<PATH_ELEMENT> morePath)
Merges path together.
|
protected void |
navigate() |
protected void |
pathComputationFailedImpl() |
protected void |
pathComputedImpl()
If the path is not zero-length, recalls
IUT2004PathNavigator.newPath(List)
and set the path into the GB2004 via SetRoute. |
protected void |
preStuckImpl() |
protected void |
preTargetReachedImpl() |
void |
setFocus(ILocated located) |
UT2004PathExecutor<PATH_ELEMENT> |
setTimeoutEstimator(IPathExecutionEstimator<PATH_ELEMENT> timeoutEstimator) |
protected void |
stopImpl() |
protected void |
stopped() |
protected void |
stuckImpl() |
protected void |
switchToAnotherPathElementImpl()
Sets the path into the GB2004 via
SetRoute whenever switch occurs and the rest of the path is greater than
32 path elements. |
protected void |
targetReachedImpl() |
checkStuckDetectors, createState, followPath, getPathElementIndex, getPathFrom, getPathFuture, getPathTo, pathComputationFailed, pathComputed, preFollowPathImpl, prePathComputationFailed, prePathComputedImpl, preSwitchToAnotherPathElementImpl, stop, stuck, switchToAnotherPathElement, targetReachedaddStuckDetector, getLog, getPath, getPathElement, getState, inState, isExecuting, isPathUnavailable, isStuck, isTargetReached, notInState, removeAllStuckDetectors, removeStuckDetector, setLog, switchStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckStuckDetectors, stuck, switchToAnotherPathElement, targetReachedaddStuckDetector, followPath, getLog, getPath, getPathElement, getPathElementIndex, getPathFrom, getPathFuture, getPathTo, getState, inState, isExecuting, isPathUnavailable, isStuck, isTargetReached, notInState, removeAllStuckDetectors, removeStuckDetector, stoppublic static final int PATH_MERGE_CUTOFF
extendPath(List), how many OLD (already passed by elements) should be left in the merged path.
Some nodes are needed due to lift/teleport navigation!public UT2004PathExecutor(UT2004Bot bot)
public UT2004PathExecutor(UT2004Bot bot, IUT2004PathNavigator<PATH_ELEMENT> navigator)
public UT2004PathExecutor(UT2004Bot bot, IUT2004PathNavigator<PATH_ELEMENT> navigator, Logger log)
public UT2004PathExecutor<PATH_ELEMENT> setTimeoutEstimator(IPathExecutionEstimator<PATH_ELEMENT> timeoutEstimator)
public void extendPath(List<PATH_ELEMENT> morePath)
IUT2004PathExecutorextendPath in interface IUT2004PathExecutor<PATH_ELEMENT extends ILocated>protected cz.cuni.amis.utils.Tuple2<List<PATH_ELEMENT>,Integer> mergePath(List<PATH_ELEMENT> currPath, int currIndex, List<PATH_ELEMENT> morePath)
currPath - currIndex - morePath - public NavPointNeighbourLink getCurrentLink()
IUT2004PathExecutorNavPointNeighbourLink the bot is currently running over.
Might be null if the link is unknown.getCurrentLink in interface IUT2004PathExecutor<PATH_ELEMENT extends ILocated>protected void stopped()
stopped in class BasePathExecutor<PATH_ELEMENT extends ILocated>protected void followPathImpl()
followPathImpl in class BasePathExecutor<PATH_ELEMENT extends ILocated>protected void pathComputedImpl()
IUT2004PathNavigator.newPath(List)
and set the path into the GB2004 via SetRoute.pathComputedImpl in class BasePathExecutor<PATH_ELEMENT extends ILocated>protected void pathComputationFailedImpl()
pathComputationFailedImpl in class BasePathExecutor<PATH_ELEMENT extends ILocated>protected void switchToAnotherPathElementImpl()
SetRoute whenever switch occurs and the rest of the path is greater than
32 path elements.switchToAnotherPathElementImpl in class BasePathExecutor<PATH_ELEMENT extends ILocated>protected void calculateTimeout()
protected void eventEndMessage()
protected void navigate()
public double getRemainingDistance()
IUT2004PathExecutorgetRemainingDistance in interface IUT2004PathExecutor<PATH_ELEMENT extends ILocated>public ILocated getFocus()
getFocus in interface IUnrealPathExecutor<PATH_ELEMENT extends ILocated>public void setFocus(ILocated located)
setFocus in interface IUnrealPathExecutor<PATH_ELEMENT extends ILocated>public List<IStuckDetector> getStuckDetectors()
IUT2004PathExecutorHelpergetStuckDetectors in interface IUT2004PathExecutorHelper<PATH_ELEMENT extends ILocated>protected void preStuckImpl()
preStuckImpl in class BasePathExecutor<PATH_ELEMENT extends ILocated>protected void stuckImpl()
stuckImpl in class BasePathExecutor<PATH_ELEMENT extends ILocated>protected void stopImpl()
stopImpl in class BasePathExecutor<PATH_ELEMENT extends ILocated>protected void preTargetReachedImpl()
preTargetReachedImpl in class BasePathExecutor<PATH_ELEMENT extends ILocated>protected void targetReachedImpl()
targetReachedImpl in class BasePathExecutor<PATH_ELEMENT extends ILocated>public IUT2004PathNavigator<PATH_ELEMENT> getNavigator()
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.