public class LoqueNavigator<PATH_ELEMENT extends ILocated> extends AbstractUT2004PathNavigator<PATH_ELEMENT>
This class navigates the agent along path. Silently handles all casual trouble with preparing next nodes, running along current nodes, switching between nodes at appropriate distances, etc. In other words, give me a destination and a path and you'll be there in no time.
KefikRunner
beneath about possible troubles along the way.
Thus, we rely completely on navigation points. Since the mover navigation points (LiftCenter ones) always travel with the associated mover, we do not try to look for movers at all. We simply compare navigation point location to agent's location and wait or move accordingly.
Modifier and Type | Class and Description |
---|---|
static class |
LoqueNavigator.Stage
All stages the navigation can come to.
|
Modifier and Type | Field and Description |
---|---|
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.
|
bot, botWaiting, executor, self
Constructor and Description |
---|
LoqueNavigator(UT2004Bot bot,
IUT2004PathRunner runner,
Logger log)
Constructor.
|
LoqueNavigator(UT2004Bot bot,
Logger log)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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 LoqueNavigator.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. |
navigate, setBot, setBotWaiting, setExecutor
public static final int CLOSE_ENOUGH
protected UT2004Bot main
protected AgentInfo memory
protected AdvancedLocomotion body
protected Logger log
public LoqueNavigator(UT2004Bot bot, Logger log)
main
- Agent's main.memory
- Loque memory.public LoqueNavigator(UT2004Bot bot, IUT2004PathRunner runner, Logger log)
main
- Agent's main.memory
- Loque memory.protected void navigate(ILocated focus, int pathElementIndex)
AbstractUT2004PathNavigator
AbstractUT2004PathNavigator#navigate()
.navigate
in class AbstractUT2004PathNavigator<PATH_ELEMENT extends ILocated>
public void reset()
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.public void newPath(List<PATH_ELEMENT> path)
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.public void pathExtended(List<PATH_ELEMENT> path, int currentPathIndex)
IUT2004PathNavigator
public NavPointNeighbourLink getCurrentLink()
IUT2004PathNavigator
protected void initDirectNavigation(Location dest)
dest
- Destination of the navigation.timeout
- Maximum timeout of the navigation. Use 0 to auto-timeout.protected void initPathNavigation(Location dest, List<PATH_ELEMENT> path)
dest
- Destination of the navigation.path
- Navigation path to the destination.protected LoqueNavigator.Stage keepNavigating()
protected NavPoint getNavPoint(ILocated location)
NavPoint
instance for a given location. If there is no navpoint in the vicinity of CLOSE_ENOUGH
null is returned.location
- protected boolean isReachable(NavPoint node)
public Logger getLog()
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.