cz.cuni.amis.pogamut.ut2004.agent.navigation.stuckdetector
Class UT2004TimeStuckDetector

java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.agent.navigation.stuckdetector.UT2004TimeStuckDetector
All Implemented Interfaces:
IStuckDetector

public class UT2004TimeStuckDetector
extends java.lang.Object
implements IStuckDetector

Simple IStuckDetector that watches whether the bot moves at all.

You may define a period of time (timeout) in which the bot should move on, i.e., if the bot won't move a bit in a specified amount of time, it will report a stuck.


Constructor Summary
UT2004TimeStuckDetector(UT2004Bot bot)
           
UT2004TimeStuckDetector(UT2004Bot bot, double timeout, double waitingTimeout)
           
 
Method Summary
 void eventSelf(IWorldObjectEvent<Self> event)
           
 boolean isStuck()
          Tells whether the detector has detected a stuck.
 void reset()
          Restarts the detector - this method is called just before the executor starts to follow the path.
 void setBotWaiting(boolean state)
          Tells the stuck detector, that the bot is waiting for something, thus the detector should not detect stuck!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UT2004TimeStuckDetector

public UT2004TimeStuckDetector(UT2004Bot bot)

UT2004TimeStuckDetector

public UT2004TimeStuckDetector(UT2004Bot bot,
                               double timeout,
                               double waitingTimeout)
Method Detail

eventSelf

public void eventSelf(IWorldObjectEvent<Self> event)

setBotWaiting

public void setBotWaiting(boolean state)
Description copied from interface: IStuckDetector
Tells the stuck detector, that the bot is waiting for something, thus the detector should not detect stuck!

Specified by:
setBotWaiting in interface IStuckDetector

isStuck

public boolean isStuck()
Description copied from interface: IStuckDetector
Tells whether the detector has detected a stuck.

Specified by:
isStuck in interface IStuckDetector
Returns:

reset

public void reset()
Description copied from interface: IStuckDetector
Restarts the detector - this method is called just before the executor starts to follow the path.

If IStuckDetector.isStuck() was reporting true, it should report 'false' after the reset (until next stuck is detected).

Specified by:
reset in interface IStuckDetector