cz.cuni.amis.pogamut.ut2004.agent.navigation.navmesh.pathfollowing
Class NavMeshNavigator<PATH_ELEMENT extends ILocated>

Package class diagram package NavMeshNavigator
java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.agent.navigation.AbstractUT2004PathNavigator<PATH_ELEMENT>
      extended by cz.cuni.amis.pogamut.ut2004.agent.navigation.navmesh.pathfollowing.NavMeshNavigator<PATH_ELEMENT>
Type Parameters:
PATH_ELEMENT -
All Implemented Interfaces:
IUT2004PathNavigator<PATH_ELEMENT>

public class NavMeshNavigator<PATH_ELEMENT extends ILocated>
extends AbstractUT2004PathNavigator<PATH_ELEMENT>

Runner for navigation with navigation mesh. Evolved from LoqueNavigator. Is suited for accelerated navigation logic cycle, has finer switching conditions.

Author:
Bogo

Nested Class Summary
static class NavMeshNavigator.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 for considering the bot to be AT LOCATION/NAV POINT.
protected  Logger log
          Agent's log.
protected  UT2004Bot main
          Agent's main.
protected  AgentInfo memory
          Loque memory.
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.agent.navigation.AbstractUT2004PathNavigator
bot, botWaiting, executor, self
 
Constructor Summary
NavMeshNavigator(UT2004Bot bot, AgentInfo info, AdvancedLocomotion move, IUT2004PathRunner runner, Logger log)
          Constructor.
 
Method Summary
 NavPointNeighbourLink getCurrentLink()
          Returns current link the bot is following (if such link exist...
 Logger getLog()
           
protected  NavPoint getNavPoint(ILocated location)
          Returns NavPoint instance for a given location.
protected  void initDirectNavigation(Location dest)
          Initializes direct navigation to the specified destination.
protected  void initPathNavigation(Location dest, List<PATH_ELEMENT> path)
          Initializes navigation to the specified destination along specified path.
protected  boolean isReachable(NavPoint node)
           
protected  NavMeshNavigator.Stage keepNavigating()
          Navigates with the current navigation request.
protected  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 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.
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.agent.navigation.AbstractUT2004PathNavigator
navigate, setBot, setBotWaiting, 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 for considering the bot to be AT LOCATION/NAV POINT. If greater than 50, navigation will failed on DM-Flux2 when navigating between health vials in one of map corers.

See Also:
Constant Field Values

main

protected UT2004Bot 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

NavMeshNavigator

public NavMeshNavigator(UT2004Bot bot,
                        AgentInfo info,
                        AdvancedLocomotion move,
                        IUT2004PathRunner runner,
                        Logger log)
Constructor.

Parameters:
bot -
move -
info -
runner -
log -
Method Detail

navigate

protected void navigate(ILocated focus,
                        int pathElementIndex)
Description copied from class: AbstractUT2004PathNavigator
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().

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

reset

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

public void newPath(List<PATH_ELEMENT> path)
Description copied from interface: IUT2004PathNavigator
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.


pathExtended

public void pathExtended(List<PATH_ELEMENT> path,
                         int currentPathIndex)
Description copied from interface: IUT2004PathNavigator
Path has been prolonged ... some elements (already passed) has been removed, some added.

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

getCurrentLink

public NavPointNeighbourLink getCurrentLink()
Description copied from interface: IUT2004PathNavigator
Returns current link the bot is following (if such link exist... may return null).

Returns:

initDirectNavigation

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

Parameters:
dest - Destination of the navigation.

initPathNavigation

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

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

keepNavigating

protected NavMeshNavigator.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:

isReachable

protected boolean isReachable(NavPoint node)

getLog

public Logger getLog()


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