cz.cuni.amis.pogamut.ut2004.agent.navigation
Class UT2004GetBackToNavGraph

Package class diagram package UT2004GetBackToNavGraph
java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004GetBackToNavGraph
All Implemented Interfaces:
IUT2004GetBackToNavGraph

public class UT2004GetBackToNavGraph
extends Object
implements IUT2004GetBackToNavGraph

This class is meant to provide easy "get-back-to-navigation-graph-in-order-I-can-safely-navigate-through-map" implementation. Automatically uses UT2004TimeStuckDetector, UT2004PositionStuckDetector and UT2004DistanceStuckDetector.

Author:
Jimmy

Field Summary
protected  UT2004Bot bot
           
static int CLOSE_ENOUGH
           
protected  IWorldEventListener<EndMessage> endListener
           
protected  boolean executing
           
protected  ILocated focus
           
protected  AgentInfo info
           
protected  Location initialLocation
           
protected  LogCategory log
           
static double MAX_ANGLE
           
protected  int randomMoveDirection
           
protected  IUT2004PathRunner runner
           
protected  List<IStuckDetector> stuckDetectors
           
protected  TabooSet<NavPoint> tried
           
protected  NavPoint tryingNav
           
 
Constructor Summary
UT2004GetBackToNavGraph(UT2004Bot bot, AgentInfo info, AdvancedLocomotion move)
           
 
Method Summary
 void addStuckDetector(IStuckDetector stuckDetector)
          Adds another stuck detector to be used for stuck detection :)
 void backToNavGraph()
          Start the class, let it take the bot back to navigation graph.
 void clearStuckDetectors()
          Removes ALL stuck detectors.
protected  void getBackOnNavGraph()
           
 NavPoint getNearestNavPoint()
          Returns nearest NavPoint to current bot's location.
 boolean isExecuting()
          Whether the class is executing (== working == trying to get the bot back on NavGraph == to make isOnNavGraph() true).
 boolean isOnNavGraph()
          Whether the bot is currently on some NavPoint.
 void removeStuckDetector(IStuckDetector stuckDetector)
          Removes stuck detector.
protected  void reset()
           
protected  void runFailed()
           
protected  void runSomewhere()
          Last resort - keep trying random points 200 UT units from bot location - 90 degrees left, right and backwards.
protected  boolean runToNavPoint()
           
 void setFocus(ILocated located)
          Sets focus of the bot when navigating (when using this object to run to some location target)! To reset focus call this method with null parameter.
 void stop()
          Stop the class.
 
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
See Also:
Constant Field Values

MAX_ANGLE

public static final double MAX_ANGLE
See Also:
Constant Field Values

bot

protected UT2004Bot bot

info

protected AgentInfo info

runner

protected IUT2004PathRunner runner

executing

protected boolean executing

log

protected LogCategory log

randomMoveDirection

protected int randomMoveDirection

endListener

protected IWorldEventListener<EndMessage> endListener

stuckDetectors

protected List<IStuckDetector> stuckDetectors

focus

protected ILocated focus

tried

protected TabooSet<NavPoint> tried

tryingNav

protected NavPoint tryingNav

initialLocation

protected Location initialLocation
Constructor Detail

UT2004GetBackToNavGraph

public UT2004GetBackToNavGraph(UT2004Bot bot,
                               AgentInfo info,
                               AdvancedLocomotion move)
Method Detail

addStuckDetector

public void addStuckDetector(IStuckDetector stuckDetector)
Description copied from interface: IUT2004GetBackToNavGraph
Adds another stuck detector to be used for stuck detection :)

Specified by:
addStuckDetector in interface IUT2004GetBackToNavGraph

removeStuckDetector

public void removeStuckDetector(IStuckDetector stuckDetector)
Description copied from interface: IUT2004GetBackToNavGraph
Removes stuck detector.

Specified by:
removeStuckDetector in interface IUT2004GetBackToNavGraph

clearStuckDetectors

public void clearStuckDetectors()
Description copied from interface: IUT2004GetBackToNavGraph
Removes ALL stuck detectors.

Specified by:
clearStuckDetectors in interface IUT2004GetBackToNavGraph

getNearestNavPoint

public NavPoint getNearestNavPoint()
Description copied from interface: IUT2004GetBackToNavGraph
Returns nearest NavPoint to current bot's location.

Specified by:
getNearestNavPoint in interface IUT2004GetBackToNavGraph
Returns:

isOnNavGraph

public boolean isOnNavGraph()
Description copied from interface: IUT2004GetBackToNavGraph
Whether the bot is currently on some NavPoint.

Specified by:
isOnNavGraph in interface IUT2004GetBackToNavGraph

isExecuting

public boolean isExecuting()
Description copied from interface: IUT2004GetBackToNavGraph
Whether the class is executing (== working == trying to get the bot back on NavGraph == to make isOnNavGraph() true).

Specified by:
isExecuting in interface IUT2004GetBackToNavGraph
Returns:

setFocus

public void setFocus(ILocated located)
Description copied from interface: IUT2004GetBackToNavGraph
Sets focus of the bot when navigating (when using this object to run to some location target)! To reset focus call this method with null parameter.

Specified by:
setFocus in interface IUT2004GetBackToNavGraph

backToNavGraph

public void backToNavGraph()
Description copied from interface: IUT2004GetBackToNavGraph
Start the class, let it take the bot back to navigation graph.

Specified by:
backToNavGraph in interface IUT2004GetBackToNavGraph

stop

public void stop()
Description copied from interface: IUT2004GetBackToNavGraph
Stop the class.

Specified by:
stop in interface IUT2004GetBackToNavGraph

reset

protected void reset()

getBackOnNavGraph

protected void getBackOnNavGraph()

runSomewhere

protected void runSomewhere()
Last resort - keep trying random points 200 UT units from bot location - 90 degrees left, right and backwards. :-)


runToNavPoint

protected boolean runToNavPoint()

runFailed

protected void runFailed()


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