cz.cuni.amis.pogamut.udk.agent.navigation
Interface IUDKPathNavigator<PATH_ELEMENT extends ILocated>

Package class diagram package IUDKPathNavigator
Type Parameters:
PATH_ELEMENT -
All Known Implementing Classes:
AbstractUDKPathNavigator, LoqueNavigator, MartinNavigator

public interface IUDKPathNavigator<PATH_ELEMENT extends ILocated>

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

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

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

Author:
Jimmy

Method Summary
 double getPrecision()
          Returns maximum distance, that the bot will have from path target, if the navigator succeeds.
 void navigate()
          This method is regularly called by UDKPathExecutor to continue the navigation of the bot inside the UDK.
 void newPath(List<PATH_ELEMENT> path)
          UDKPathExecutor reports that new path has been received and the navigate() is about to be called in near future.
 void reset()
          UDKPathExecutor 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(UDKBot bot)
          Sets the UDKBot instance that the navigator should navigate.
 void setExecutor(IPathExecutorHelper<PATH_ELEMENT> owner)
          Sets the IPathExecutorHelper who is using the navigator, i.e., are calling its IUDKPathNavigator#navigate(Self) and reset() methods.
 

Method Detail

setBot

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

Parameters:
bot -

setExecutor

void setExecutor(IPathExecutorHelper<PATH_ELEMENT> owner)
Sets the IPathExecutorHelper who is using the navigator, i.e., are calling its IUDKPathNavigator#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()
This method is regularly called by UDKPathExecutor to continue the navigation of the bot inside the UDK.

Parameters:
bot - instance of the bot we're navigating
self - Self object of the bot the navigator should move

reset

void reset()
UDKPathExecutor 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)
UDKPathExecutor reports that new path has been received and the navigate() is about to be called in near future. The new path is passed as a parameter.

Parameters:
path -

getPrecision

double getPrecision()
Returns maximum distance, that the bot will have from path target, if the navigator succeeds. This is primarily designed for checking for some less obvious failures in path execution.

Returns:


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