cz.cuni.amis.pogamut.udk.agent.navigation.martinnavigator
Class MartinNavigator<PATH_ELEMENT extends ILocated>

Package class diagram package MartinNavigator
java.lang.Object
  extended by cz.cuni.amis.pogamut.udk.agent.navigation.AbstractUDKPathNavigator<PATH_ELEMENT>
      extended by cz.cuni.amis.pogamut.udk.agent.navigation.martinnavigator.MartinNavigator<PATH_ELEMENT>
All Implemented Interfaces:
IUDKPathNavigator<PATH_ELEMENT>

public class MartinNavigator<PATH_ELEMENT extends ILocated>
extends AbstractUDKPathNavigator<PATH_ELEMENT>

Responsible for navigation to location.

Author:
Jimmy

Nested Class Summary
static class MartinNavigator.Stage
          All stages the navigation can come to.
 
Field Summary
protected  AdvancedLocomotion body
          Agent's body.
static int CLOSE_ENOUGH
          Distance, which is considered as close enough..
protected  Logger log
          Agent's log.
protected  UDKBot main
          Agent's main.
protected  AgentInfo memory
          Loque memory.
static int PRECISION
           
 
Fields inherited from class cz.cuni.amis.pogamut.udk.agent.navigation.AbstractUDKPathNavigator
bot, executor, self
 
Constructor Summary
MartinNavigator(UDKBot bot, IUDKPathRunner runner, Logger log)
          Constructor.
MartinNavigator(UDKBot bot, Logger log)
          Constructor.
 
Method Summary
protected  NavPoint getNavPoint(ILocated location)
          Returns NavPoint instance for a given location.
 double getPrecision()
          Returns maximum distance, that the bot will have from path target, if the navigator succeeds.
protected  boolean initAlongPath(Location dest, List<PATH_ELEMENT> path)
          Initializes navigation along path.
protected  MartinNavigator.Stage initDirectly(Location dest)
          Initializes direct navigation to given destination.
protected  void initDirectNavigation(Location dest)
          Initializes direct navigation to the specified destination.
protected  void initPathNavigation(Location destination, List<PATH_ELEMENT> path)
          Initializes navigation to the specified destination along specified path.
protected  MartinNavigator.Stage keepNavigating()
          Navigates with the current navigation request.
protected  void navigate(int pathElementIndex)
          Does the actual navigation of the bot, it should steer it towards path element of the index 'pathElementIndex'.
 void newPath(List<PATH_ELEMENT> path)
          UDKPathExecutor reports that new path has been received and the IUDKPathNavigator.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.
 
Methods inherited from class cz.cuni.amis.pogamut.udk.agent.navigation.AbstractUDKPathNavigator
navigate, setBot, setExecutor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLOSE_ENOUGH

public static final int CLOSE_ENOUGH
Distance, which is considered as close enough..

See Also:
Constant Field Values

PRECISION

public static final int PRECISION
See Also:
Constant Field Values

main

protected UDKBot main
Agent's main.


memory

protected AgentInfo memory
Loque memory.


body

protected AdvancedLocomotion body
Agent's body.


log

protected Logger log
Agent's log.

Constructor Detail

MartinNavigator

public MartinNavigator(UDKBot bot,
                       Logger log)
Constructor.

Parameters:
main - Agent's main.
memory - Loque memory.

MartinNavigator

public MartinNavigator(UDKBot bot,
                       IUDKPathRunner runner,
                       Logger log)
Constructor.

Parameters:
main - Agent's main.
memory - Loque memory.
Method Detail

getPrecision

public double getPrecision()
Description copied from interface: IUDKPathNavigator
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:

navigate

protected void navigate(int pathElementIndex)
Description copied from class: AbstractUDKPathNavigator
Does the actual navigation of the bot, it should steer it towards path element of the index 'pathElementIndex'. Called (after several checks) from AbstractUDKPathNavigator.navigate().

Specified by:
navigate in class AbstractUDKPathNavigator<PATH_ELEMENT extends ILocated>

reset

public void reset()
Description copied from interface: IUDKPathNavigator
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

public void newPath(List<PATH_ELEMENT> path)
Description copied from interface: IUDKPathNavigator
UDKPathExecutor reports that new path has been received and the IUDKPathNavigator.navigate() is about to be called in near future. The new path is passed as a parameter.


initPathNavigation

protected void initPathNavigation(Location destination,
                                  List<PATH_ELEMENT> path)
Initializes navigation to the specified destination along specified path.

Parameters:
destination - Destination of the navigation.
path - Navigation path to the destination.

initAlongPath

protected boolean initAlongPath(Location dest,
                                List<PATH_ELEMENT> path)
Initializes navigation along path.

Parameters:
dest - Destination of the navigation.
path - Path of the navigation.
Returns:
True, if the navigation is successfuly initialized.

initDirectNavigation

protected void initDirectNavigation(Location dest)
Initializes direct navigation to the specified destination.

Parameters:
dest - Destination of the navigation.
timeout - Maximum timeout of the navigation. Use 0 to auto-timeout.

initDirectly

protected MartinNavigator.Stage initDirectly(Location dest)
Initializes direct navigation to given destination.

Parameters:
dest - Destination of the navigation.
Returns:
Next stage of the navigation progress.

keepNavigating

protected MartinNavigator.Stage keepNavigating()
Navigates with the current navigation request.

Returns:
Stage of the navigation progress.

getNavPoint

protected NavPoint getNavPoint(ILocated location)
Returns NavPoint instance for a given location. If there is no navpoint in the vicinity of CLOSE_ENOUGH null is returned.

Parameters:
location -
Returns:


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