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

java.lang.Object
  extended by cz.cuni.amis.utils.future.FutureWithListeners<RESULT>
      extended by cz.cuni.amis.pogamut.base.utils.future.ComponentFuture<java.util.List<PATH_ELEMENT>>
          extended by cz.cuni.amis.pogamut.base.agent.navigation.impl.PathFuture<ILocated>
              extended by cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004AStarPathFuture
All Implemented Interfaces:
IPathFuture<ILocated>, java.util.concurrent.Future<java.util.List<ILocated>>

public class UT2004AStarPathFuture
extends PathFuture<ILocated>

IPathFuture implementation that is using UT2004 inner AStar algorithm for finding the path inside UT2004 environment.

WARNING: UT2004 has a limition set on the path length. It will return only the first 16 navpoints that are leading to the path's target. Whenever path executor happens to tell you, that the target is reached, you should compare your bot current location with PathFuture.getPathTo().

Note that the path that is produced by this future contains mix of NavPoint and Location objects. Usually Location objects are only the first and last elements of the path and the rest are NavPoints.


Field Summary
 
Fields inherited from class cz.cuni.amis.utils.future.FutureWithListeners
latch, listeners, mutex
 
Constructor Summary
UT2004AStarPathFuture(UT2004Bot bot, ILocated pathFrom, ILocated pathTo)
           
 
Method Summary
protected  boolean cancelComputation(boolean mayInterruptIfRunning)
          This should cancel the computation of the future.
protected  void eventEndMessage(EndMessage event)
           
protected  void eventPath(Path event)
           
 
Methods inherited from class cz.cuni.amis.pogamut.base.agent.navigation.impl.PathFuture
getPathFrom, getPathTo
 
Methods inherited from class cz.cuni.amis.pogamut.base.utils.future.ComponentFuture
createLatch, get, get
 
Methods inherited from class cz.cuni.amis.utils.future.FutureWithListeners
addFutureListener, cancel, computationException, getException, getStatus, isCancelled, isDone, isListening, removeFutureListener, setResult, switchStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cz.cuni.amis.pogamut.base.agent.navigation.IPathFuture
addFutureListener, get, get, getStatus, isListening, removeFutureListener
 
Methods inherited from interface java.util.concurrent.Future
cancel, isCancelled, isDone
 

Constructor Detail

UT2004AStarPathFuture

public UT2004AStarPathFuture(UT2004Bot bot,
                             ILocated pathFrom,
                             ILocated pathTo)
Method Detail

cancelComputation

protected boolean cancelComputation(boolean mayInterruptIfRunning)
Description copied from class: FutureWithListeners
This should cancel the computation of the future. Current implementation returns always false. Override the method to provide correct behavior for particular future.

Overrides:
cancelComputation in class FutureWithListeners<java.util.List<ILocated>>
Returns:

eventEndMessage

protected void eventEndMessage(EndMessage event)

eventPath

protected void eventPath(Path event)