cz.cuni.amis.pogamut.ut2004.agent.navigation
Interface IUT2004PathNavigator<PATH_ELEMENT extends ILocated>

Package class diagram package IUT2004PathNavigator
Type Parameters:
PATH_ELEMENT -
All Known Implementing Classes:
AbstractUT2004PathNavigator, LoqueNavigator, NavMeshNavigator

public interface IUT2004PathNavigator<PATH_ELEMENT extends ILocated>

Navigator purpose is to actually move the bot through the UT2004 environment - if you did not read IPathExecutor and UT2004PathExecutor documentation, do it now. If you did, read on.

The IUT2004PathNavigator navigator is the easiest-to-implement piece of UT2004PathExecutor in terms that it has only two methods to implement. On the other hand - it is acrually very hard to navigate the bot through UT2004 environment. But! If you need to actually change the way how bot is running inside the UT2004, implementing own IUT2004PathNavigator is the best thing to do (you should probably start by copy-pasting the code from UT2004PathExecutorNavigator into your new class and experiment with it a bit).

This navigator interface is actually used by UT2004PathExecutor that covers the tricky part when and how to call its methods IUT2004PathNavigator#navigate() and reset().

Author:
Jimmy

Method Summary
 NavPointNeighbourLink getCurrentLink()
          Returns current link the bot is following (if such link exist...
 Logger getLog()
           
 void navigate(ILocated focus)
          This method is regularly called by UT2004PathExecutor to continue the navigation of the bot inside the UT2004.
 void newPath(List<PATH_ELEMENT> path)
          UT2004PathExecutor reports that new path has been received and the IUT2004PathNavigator#navigate() is about to be called in near future.
 void pathExtended(List<PATH_ELEMENT> path, int currentPathIndex)
          Path has been prolonged ...
 void reset()
          UT2004PathExecutor reports that execution of current path has been terminated - clean up your internal data structure and prepare to navigate the bot along the new path in the future.
 void setBot(UT2004Bot bot)
          Sets the UT2004Bot instance that the navigator should navigate.
 void setExecutor(IUT2004PathExecutorHelper<PATH_ELEMENT> owner)
          Sets the IPathExecutorHelper who is using the navigator, i.e., are calling its IUT2004PathNavigator#navigate(Self) and reset() methods.
 

Method Detail

setBot

void setBot(UT2004Bot bot)
Sets the UT2004Bot instance that the navigator should navigate. Use its AbstractEmbodiedAgent.getAct() to pass commands to the bot.

Parameters:
bot -

setExecutor

void setExecutor(IUT2004PathExecutorHelper<PATH_ELEMENT> owner)
Sets the IPathExecutorHelper who is using the navigator, i.e., are calling its IUT2004PathNavigator#navigate(Self) and reset() methods.

Used by IPathExecutorHelper implementation to inject its instance into the navigator, so the navigator may call methods such as IPathExecutorHelper.checkStuckDetectors(), IPathExecutorHelper.switchToAnotherPathElement(int), IPathExecutorHelper.stuck() and IPathExecutorHelper.targetReached().

Parameters:
owner -

navigate

void navigate(ILocated focus)
This method is regularly called by UT2004PathExecutor to continue the navigation of the bot inside the UT2004.

Parameters:
focus - where the bot should have its focus

getCurrentLink

NavPointNeighbourLink getCurrentLink()
Returns current link the bot is following (if such link exist... may return null).

Returns:

reset

void reset()
UT2004PathExecutor reports that execution of current path has been terminated - clean up your internal data structure and prepare to navigate the bot along the new path in the future.


newPath

void newPath(List<PATH_ELEMENT> path)
UT2004PathExecutor reports that new path has been received and the IUT2004PathNavigator#navigate() is about to be called in near future. The new path is passed as a parameter.

Parameters:
path -

pathExtended

void pathExtended(List<PATH_ELEMENT> path,
                  int currentPathIndex)
Path has been prolonged ... some elements (already passed) has been removed, some added.

Parameters:
path -
currentPathIndex - path index into new path (points to the same element as in previous path)

getLog

Logger getLog()


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