cz.cuni.amis.pogamut.ut2004.agent.navigation.navmesh.pathfollowing
Class UT2004AcceleratedPathExecutor<PATH_ELEMENT extends ILocated>

Package class diagram package UT2004AcceleratedPathExecutor
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.agent.navigation.impl.AbstractPathExecutor<PATH_ELEMENT>
      extended by cz.cuni.amis.pogamut.base.agent.navigation.impl.BasePathExecutor<PATH_ELEMENT>
          extended by cz.cuni.amis.pogamut.ut2004.agent.navigation.navmesh.pathfollowing.UT2004AcceleratedPathExecutor<PATH_ELEMENT>
Type Parameters:
PATH_ELEMENT -
All Implemented Interfaces:
IPathExecutor<PATH_ELEMENT>, IPathExecutorHelper<PATH_ELEMENT>, IUnrealPathExecutor<PATH_ELEMENT>, IUT2004PathExecutor<PATH_ELEMENT>, IUT2004PathExecutorHelper<PATH_ELEMENT>

public class UT2004AcceleratedPathExecutor<PATH_ELEMENT extends ILocated>
extends BasePathExecutor<PATH_ELEMENT>
implements IUT2004PathExecutor<PATH_ELEMENT>, IUT2004PathExecutorHelper<PATH_ELEMENT>

Accelerated version of UT2004Pathexecutor. Uses LocationUpdate as impulse for navigation logic cycle. Should be used with accelerated versions of the stuck detectors.

Author:
Bogo

Field Summary
static int PATH_MERGE_CUTOFF
          When doing UT2004PathExecutor#extendPath(List), how many OLD (already passed by elements) should be left in the merged path.
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.navigation.impl.BasePathExecutor
mutex, pathElementIndex, pathFuture, previousPathElementIndex
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.navigation.impl.AbstractPathExecutor
log, state, stuckDetectors
 
Constructor Summary
UT2004AcceleratedPathExecutor(UT2004Bot bot, AgentInfo info, AdvancedLocomotion body, IUT2004PathNavigator<PATH_ELEMENT> navigator)
           
UT2004AcceleratedPathExecutor(UT2004Bot bot, AgentInfo info, AdvancedLocomotion move, IUT2004PathNavigator<PATH_ELEMENT> navigator, Logger log)
           
 
Method Summary
protected  void calculateTimeout()
           
protected  IPathExecutorState createState(PathExecutorState state)
           
protected  void eventLocationUpdateMessage()
           
 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)
           
 UT2004AcceleratedPathExecutor<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()
           
 
Methods inherited from class cz.cuni.amis.pogamut.base.agent.navigation.impl.BasePathExecutor
checkStuckDetectors, followPath, getPathElementIndex, getPathFrom, getPathFuture, getPathTo, pathComputationFailed, pathComputed, preFollowPathImpl, prePathComputationFailed, prePathComputedImpl, preSwitchToAnotherPathElementImpl, stop, stuck, switchToAnotherPathElement, targetReached
 
Methods inherited from class cz.cuni.amis.pogamut.base.agent.navigation.impl.AbstractPathExecutor
addStuckDetector, getLog, getPath, getPathElement, getState, inState, isExecuting, isPathUnavailable, isStuck, isTargetReached, notInState, removeAllStuckDetectors, removeStuckDetector, setLog, switchState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cz.cuni.amis.pogamut.base.agent.navigation.IPathExecutorHelper
checkStuckDetectors, stuck, switchToAnotherPathElement, targetReached
 
Methods inherited from interface cz.cuni.amis.pogamut.base.agent.navigation.IPathExecutor
addStuckDetector, followPath, getLog, getPath, getPathElement, getPathElementIndex, getPathFrom, getPathFuture, getPathTo, getState, inState, isExecuting, isPathUnavailable, isStuck, isTargetReached, notInState, removeAllStuckDetectors, removeStuckDetector, stop
 

Field Detail

PATH_MERGE_CUTOFF

public static final int PATH_MERGE_CUTOFF
When doing UT2004PathExecutor#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!

See Also:
Constant Field Values
Constructor Detail

UT2004AcceleratedPathExecutor

public UT2004AcceleratedPathExecutor(UT2004Bot bot,
                                     AgentInfo info,
                                     AdvancedLocomotion body,
                                     IUT2004PathNavigator<PATH_ELEMENT> navigator)

UT2004AcceleratedPathExecutor

public UT2004AcceleratedPathExecutor(UT2004Bot bot,
                                     AgentInfo info,
                                     AdvancedLocomotion move,
                                     IUT2004PathNavigator<PATH_ELEMENT> navigator,
                                     Logger log)
Method Detail

setTimeoutEstimator

public UT2004AcceleratedPathExecutor<PATH_ELEMENT> setTimeoutEstimator(IPathExecutionEstimator<PATH_ELEMENT> timeoutEstimator)

createState

protected IPathExecutorState createState(PathExecutorState state)
Overrides:
createState in class BasePathExecutor<PATH_ELEMENT extends ILocated>

extendPath

public void extendPath(List<PATH_ELEMENT> morePath)
Description copied from interface: IUT2004PathExecutor
Merges current followed path with "morePath", i.e., it cuts off already passed elements and adds "morePath" to current path.

Specified by:
extendPath in interface IUT2004PathExecutor<PATH_ELEMENT extends ILocated>

mergePath

protected cz.cuni.amis.utils.Tuple2<List<PATH_ELEMENT>,Integer> mergePath(List<PATH_ELEMENT> currPath,
                                                                          int currIndex,
                                                                          List<PATH_ELEMENT> morePath)
Merges path together.

Parameters:
currPath -
currIndex -
morePath -
Returns:

getCurrentLink

public NavPointNeighbourLink getCurrentLink()
Description copied from interface: IUT2004PathExecutor
Returns NavPointNeighbourLink the bot is currently running over. Might be null if the link is unknown.

Specified by:
getCurrentLink in interface IUT2004PathExecutor<PATH_ELEMENT extends ILocated>
Returns:

stopped

protected void stopped()
Specified by:
stopped in class BasePathExecutor<PATH_ELEMENT extends ILocated>

followPathImpl

protected void followPathImpl()
Specified by:
followPathImpl in class BasePathExecutor<PATH_ELEMENT extends ILocated>

pathComputedImpl

protected void pathComputedImpl()
If the path is not zero-length, recalls IUT2004PathNavigator.newPath(List) and set the path into the GB2004 via SetRoute.

Specified by:
pathComputedImpl in class BasePathExecutor<PATH_ELEMENT extends ILocated>

pathComputationFailedImpl

protected void pathComputationFailedImpl()
Specified by:
pathComputationFailedImpl in class BasePathExecutor<PATH_ELEMENT extends ILocated>

switchToAnotherPathElementImpl

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.

Specified by:
switchToAnotherPathElementImpl in class BasePathExecutor<PATH_ELEMENT extends ILocated>

calculateTimeout

protected void calculateTimeout()

eventLocationUpdateMessage

protected void eventLocationUpdateMessage()

navigate

protected void navigate()

getRemainingDistance

public double getRemainingDistance()
Description copied from interface: IUT2004PathExecutor
Returns how far is our target (path-distance).

Specified by:
getRemainingDistance in interface IUT2004PathExecutor<PATH_ELEMENT extends ILocated>
Returns:

getFocus

public ILocated getFocus()
Specified by:
getFocus in interface IUnrealPathExecutor<PATH_ELEMENT extends ILocated>

setFocus

public void setFocus(ILocated located)
Specified by:
setFocus in interface IUnrealPathExecutor<PATH_ELEMENT extends ILocated>

getStuckDetectors

public List<IStuckDetector> getStuckDetectors()
Description copied from interface: IUT2004PathExecutorHelper
Returns list of all stuck detectors registered inside the executor.

Specified by:
getStuckDetectors in interface IUT2004PathExecutorHelper<PATH_ELEMENT extends ILocated>
Returns:

preStuckImpl

protected void preStuckImpl()
Overrides:
preStuckImpl in class BasePathExecutor<PATH_ELEMENT extends ILocated>

stuckImpl

protected void stuckImpl()
Specified by:
stuckImpl in class BasePathExecutor<PATH_ELEMENT extends ILocated>

stopImpl

protected void stopImpl()
Overrides:
stopImpl in class BasePathExecutor<PATH_ELEMENT extends ILocated>

preTargetReachedImpl

protected void preTargetReachedImpl()
Overrides:
preTargetReachedImpl in class BasePathExecutor<PATH_ELEMENT extends ILocated>

targetReachedImpl

protected void targetReachedImpl()
Specified by:
targetReachedImpl in class BasePathExecutor<PATH_ELEMENT extends ILocated>

getNavigator

public IUT2004PathNavigator<PATH_ELEMENT> getNavigator()


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.