cz.cuni.amis.pogamut.ut2004.agent.navigation
Interface IUT2004Navigation

Package class diagram package IUT2004Navigation
All Known Implementing Classes:
UT2004Navigation

public interface IUT2004Navigation

Facade for navigation in UT2004. Method navigate() can be called both synchronously and asynchronously. Uses IUT2004PathExecutor, FloydWarshallMap, IUT2004RunStraight and IUT2004GetBackToNavGraph to handle all possible navigation cases.

Author:
Jimmy

Method Summary
 void addStrongNavigationListener(cz.cuni.amis.utils.flag.FlagListener<NavigationState> listener)
          Use this to register listeners to various states the navigation - stuck, target reached, etc.
 IUT2004GetBackToNavGraph getBackToNavGraph()
          Returns underlying IUT2004GetBackToNavGraph object that is being used by this IUT2004Navigation.
 ILocated getContinueTo()
          Returns where the bot will continue to, for more info see setContinueTo(ILocated).
 List<ILocated> getCurrentPathCopy()
          Returns COPY of current path in list.
 List<ILocated> getCurrentPathDirect()
          Returns current path as in IPathFuture object that is used by ut2004pathExecutor to navigate.
 ILocated getCurrentTarget()
          Current POINT where the navigation is trying to get to.
 Item getCurrentTargetItem()
          If navigation is trying to get to some item, otherwise returns null.
 NavPoint getCurrentTargetNavPoint()
          If navigation is trying to get to some navpoint, otherwise returns null.
 Player getCurrentTargetPlayer()
          If navigation is trying to get to some player, otherwise returns null.
 ILocated getFocus()
          Returns current focus of the bots, may be null (== no focus).
 ILocated getLastTarget()
          Returns previous location we tried to get to (i.e., what was UT2004Navigation.getCurrentTarget() before another UT2004Navigation.navigate(ILocated) or UT2004Navigation.navigate(Player) was called.
 Item getLastTargetItem()
          If previous target was an item, returns non-null Item we previously tried to get to.
 Player getLastTargetPlayer()
          If previous target was a player, returns non-null player we previously tried to get to (i.e., what was UT2004Navigation.getCurrentTargetPlayer() before another UT2004Navigation.navigate(ILocated) or UT2004Navigation.navigate(Player) was called.
 Logger getLog()
          Returns logger used by the object.
 NavPoint getNearestNavPoint(ILocated location)
          Returns nearest navigation point to input location.
 IUT2004PathExecutor<ILocated> getPathExecutor()
          Returns underlying IUT2004PathExecutor object that is being used by this IUT2004Navigation.
 double getRemainingDistance()
          Returns how far is our target (path-distance == real-distance).
 IUT2004RunStraight getRunStraight()
          Returns underlying IUT2004RunStraight object that is being used by this IUT2004Navigation.
 cz.cuni.amis.utils.flag.Flag<NavigationState> getState()
          Returns an immutable flag with the current state of the navigation.
 boolean isNavigating()
          True if navigating, e.g., trying to get somewhere using either IUT2004PathExecutor, IUT2004GetBackToNavGraph or IUT2004RunStraight.
 boolean isNavigatingToItem()
          Whether we're currently navigating to item (final target).
 boolean isNavigatingToNavPoint()
          Whether we're currently navigating to navpoint (final target).
 boolean isNavigatingToPlayer()
          Whether we're currently navigating to player (final target).
 boolean isPathExecuting()
          Whether UT2004Navigation is currently using IUT2004PathExecutor to follow the path.
 boolean isRunningStraight()
          Whether UT2004Navigation is currently using UT2004Navigation.runStraight to get to player by running straight to it/him/her.
 boolean isTryingToGetBackToNav()
          Whether UT2004Navigation is currently trying to get back to nav using IUT2004GetBackToNavGraph.
 void navigate(ILocated target)
          This method can be called periodically or asynchronously.
 void navigate(IPathFuture<ILocated> pathHandle)
          Let the bot to follow this path.
 void navigate(Player player)
          This method can be called periodically or asynchronously.
 void removeStrongNavigationListener(cz.cuni.amis.utils.flag.FlagListener<NavigationState> listener)
          Removes path state listener.
 void setContinueTo(ILocated target)
          When the bot is about to reach its target, it will prolong his path to continue to 'target'.
 void setFocus(ILocated located)
          Sets focus of the bot when navigating (when using this object to run to some location target)!
 void stopNavigation()
          Stops navigation and resets the class.
 

Method Detail

addStrongNavigationListener

void addStrongNavigationListener(cz.cuni.amis.utils.flag.FlagListener<NavigationState> listener)
Use this to register listeners to various states the navigation - stuck, target reached, etc. See NavigationState.

Parameters:
listener -

removeStrongNavigationListener

void removeStrongNavigationListener(cz.cuni.amis.utils.flag.FlagListener<NavigationState> listener)
Removes path state listener.

Parameters:
listener -

getPathExecutor

IUT2004PathExecutor<ILocated> getPathExecutor()
Returns underlying IUT2004PathExecutor object that is being used by this IUT2004Navigation.

Returns:

getBackToNavGraph

IUT2004GetBackToNavGraph getBackToNavGraph()
Returns underlying IUT2004GetBackToNavGraph object that is being used by this IUT2004Navigation.

Returns:

getRunStraight

IUT2004RunStraight getRunStraight()
Returns underlying IUT2004RunStraight object that is being used by this IUT2004Navigation.

Returns:

isNavigating

boolean isNavigating()
True if navigating, e.g., trying to get somewhere using either IUT2004PathExecutor, IUT2004GetBackToNavGraph or IUT2004RunStraight.

Returns:

isNavigatingToNavPoint

boolean isNavigatingToNavPoint()
Whether we're currently navigating to navpoint (final target).

Returns:

isNavigatingToItem

boolean isNavigatingToItem()
Whether we're currently navigating to item (final target).

Returns:

isNavigatingToPlayer

boolean isNavigatingToPlayer()
Whether we're currently navigating to player (final target).

Returns:

isTryingToGetBackToNav

boolean isTryingToGetBackToNav()
Whether UT2004Navigation is currently trying to get back to nav using IUT2004GetBackToNavGraph.

Returns:

isPathExecuting

boolean isPathExecuting()
Whether UT2004Navigation is currently using IUT2004PathExecutor to follow the path.

Returns:

isRunningStraight

boolean isRunningStraight()
Whether UT2004Navigation is currently using UT2004Navigation.runStraight to get to player by running straight to it/him/her.

Returns:

getFocus

ILocated getFocus()
Returns current focus of the bots, may be null (== no focus).

Parameters:
located -

setFocus

void setFocus(ILocated located)
Sets focus of the bot when navigating (when using this object to run to some location target)! To reset focus call this method with null parameter.

Parameters:
located -

stopNavigation

void stopNavigation()
Stops navigation and resets the class. Does NOT reset focus!


navigate

void navigate(ILocated target)
This method can be called periodically or asynchronously. Will move bot to 'target'. The bot will stop on bad input (location == null).

Parameters:
target - target location

navigate

void navigate(Player player)
This method can be called periodically or asynchronously. Will move bot to input location. Uses UT2004PathExecutor and FloydWarshallMap. The bot will stop on bad input (location null).

Parameters:
location - target location

navigate

void navigate(IPathFuture<ILocated> pathHandle)
Let the bot to follow this path.

Parameters:
pathHandle -

setContinueTo

void setContinueTo(ILocated target)
When the bot is about to reach its target, it will prolong his path to continue to 'target'. DOES NOT WORK WITH navigate(Player). WARNING: continueTo is reset when bot stop navigating / stuck, etc. WARNING: continueTo is also "nullified" when the bot actually prolongs its path to reach the 'target'.

Parameters:
target - cannot be Player

getContinueTo

ILocated getContinueTo()
Returns where the bot will continue to, for more info see setContinueTo(ILocated). WARNING: continueTo is reset when bot stop navigating / stuck, etc. WARNING: continueTo is also "nullified" when the bot actually prolongs its path to reach the 'target'.

Returns:

getNearestNavPoint

NavPoint getNearestNavPoint(ILocated location)
Returns nearest navigation point to input location. FloydWarshallMap works only on NavPoints.

Parameters:
location -
Returns:

getCurrentPathCopy

List<ILocated> getCurrentPathCopy()
Returns COPY of current path in list. May take some time to fill up. Returns empty list if path not computed.

Returns:

getCurrentPathDirect

List<ILocated> getCurrentPathDirect()
Returns current path as in IPathFuture object that is used by ut2004pathExecutor to navigate. Can be altered. May return null if path not computed! Be carefull when altering this during UT2004PathExecutor run - it may cause undesirable behavior.

Returns:

getCurrentTarget

ILocated getCurrentTarget()
Current POINT where the navigation is trying to get to.

Returns:

getCurrentTargetPlayer

Player getCurrentTargetPlayer()
If navigation is trying to get to some player, otherwise returns null.

Returns:

getCurrentTargetItem

Item getCurrentTargetItem()
If navigation is trying to get to some item, otherwise returns null.

Returns:

getCurrentTargetNavPoint

NavPoint getCurrentTargetNavPoint()
If navigation is trying to get to some navpoint, otherwise returns null.

Returns:

getLastTarget

ILocated getLastTarget()
Returns previous location we tried to get to (i.e., what was UT2004Navigation.getCurrentTarget() before another UT2004Navigation.navigate(ILocated) or UT2004Navigation.navigate(Player) was called.

Returns:

getLastTargetPlayer

Player getLastTargetPlayer()
If previous target was a player, returns non-null player we previously tried to get to (i.e., what was UT2004Navigation.getCurrentTargetPlayer() before another UT2004Navigation.navigate(ILocated) or UT2004Navigation.navigate(Player) was called.

Returns:

getLastTargetItem

Item getLastTargetItem()
If previous target was an item, returns non-null Item we previously tried to get to. (i.e., what was UT2004Navigation.getCurrentTargetItem() before another UT2004Navigation.navigate(ILocated) or UT2004Navigation.navigate(Player) was called.

Returns:

getState

cz.cuni.amis.utils.flag.Flag<NavigationState> getState()
Returns an immutable flag with the current state of the navigation.

Returns:
an immutable flag with the current state of the navigation.

getRemainingDistance

double getRemainingDistance()
Returns how far is our target (path-distance == real-distance). May return -1 if it cannot be computed.

Returns:

getLog

Logger getLog()
Returns logger used by the object.

Returns:


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