cz.cuni.amis.pogamut.ut2004.agent.navigation
Class AbstractUT2004PathNavigator<PATH_ELEMENT extends ILocated>

java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.agent.navigation.AbstractUT2004PathNavigator<PATH_ELEMENT>
Type Parameters:
PATH_ELEMENT -
All Implemented Interfaces:
IUT2004PathNavigator<PATH_ELEMENT>
Direct Known Subclasses:
LoqueNavigator

public abstract class AbstractUT2004PathNavigator<PATH_ELEMENT extends ILocated>
extends java.lang.Object
implements IUT2004PathNavigator<PATH_ELEMENT>

Simple stub of the IUT2004PathNavigator that implements setBot(UT2004Bot) and AbstractUT2004PathNavigator#setExecutor(IPathExecutorHelper).


Field Summary
protected  UT2004Bot bot
          Bot, the navigator is navigating.
protected  boolean botWaiting
           
protected  IUT2004PathExecutorHelper<PATH_ELEMENT> executor
          Executor who is using the navigator.
protected  Self self
          Self object that is lazy-initialized inside self.
 
Constructor Summary
AbstractUT2004PathNavigator()
           
 
Method Summary
 void navigate(ILocated focus)
          This method is regularly called by UT2004PathExecutor to continue the navigation of the bot inside the UT2004.
protected abstract  void navigate(ILocated focus, int pathElementIndex)
          Does the actual navigation of the bot, it should steer it towards path element of the index 'pathElementIndex'.
 void setBot(UT2004Bot bot)
          Sets the UT2004Bot instance that the navigator should navigate.
protected  void setBotWaiting(boolean state)
           
 void setExecutor(IUT2004PathExecutorHelper<PATH_ELEMENT> owner)
          Sets the IPathExecutorHelper who is using the navigator, i.e., are calling its IUT2004PathNavigator#navigate(Self) and IUT2004PathNavigator.reset() methods.
 
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.ut2004.agent.navigation.IUT2004PathNavigator
newPath, reset
 

Field Detail

bot

protected UT2004Bot bot
Bot, the navigator is navigating. Set by setBot(UT2004Bot). See IUT2004PathNavigator.setBot(UT2004Bot).


executor

protected IUT2004PathExecutorHelper<PATH_ELEMENT extends ILocated> executor
Executor who is using the navigator. See IUT2004PathNavigator#setExecutor(IPathExecutorHelper) for more info.


self

protected Self self
Self object that is lazy-initialized inside self.


botWaiting

protected boolean botWaiting
Constructor Detail

AbstractUT2004PathNavigator

public AbstractUT2004PathNavigator()
Method Detail

setBotWaiting

protected void setBotWaiting(boolean state)

setBot

public void setBot(UT2004Bot bot)
Description copied from interface: IUT2004PathNavigator
Sets the UT2004Bot instance that the navigator should navigate. Use its AbstractEmbodiedAgent.getAct() to pass commands to the bot.

Specified by:
setBot in interface IUT2004PathNavigator<PATH_ELEMENT extends ILocated>

setExecutor

public void setExecutor(IUT2004PathExecutorHelper<PATH_ELEMENT> owner)
Description copied from interface: IUT2004PathNavigator
Sets the IPathExecutorHelper who is using the navigator, i.e., are calling its IUT2004PathNavigator#navigate(Self) and IUT2004PathNavigator.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().

Specified by:
setExecutor in interface IUT2004PathNavigator<PATH_ELEMENT extends ILocated>

navigate

public void navigate(ILocated focus)
Description copied from interface: IUT2004PathNavigator
This method is regularly called by UT2004PathExecutor to continue the navigation of the bot inside the UT2004.

Specified by:
navigate in interface IUT2004PathNavigator<PATH_ELEMENT extends ILocated>
Parameters:
focus - where the bot should have its focus

navigate

protected abstract void navigate(ILocated focus,
                                 int pathElementIndex)
Does the actual navigation of the bot, it should steer it towards path element of the index 'pathElementIndex'. Called (after several checks) from AbstractUT2004PathNavigator#navigate().

Parameters:
pathElementIndex -