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

Type Parameters:
PATH_ELEMENT -
All Known Implementing Classes:
AbstractUT2004PathNavigator, LoqueNavigator

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().


Method Summary
 void navigate(ILocated focus)
          This method is regularly called by UT2004PathExecutor to continue the navigation of the bot inside the UT2004.
 void newPath(java.util.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 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

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(java.util.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 -