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

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

public class UT2004RunStraight
extends Object
implements IUT2004RunStraight

Run straight class is meant to provide "straight running" combined with "stuck detection". Automatically uses UT2004TimeStuckDetector, UT2004PositionStuckDetector and UT2004DistanceStuckDetector.

Author:
Jimmy

Field Summary
static double AT_NAVPOINT
           
static double AT_PLAYER
           
protected  UT2004Bot bot
           
static int CLOSE_ENOUGH
           
protected  ILocated currentTarget
           
protected  IWorldEventListener<EndMessage> endListener
           
protected  boolean executing
           
protected  boolean failed
           
protected  ILocated focus
           
protected  AgentInfo info
           
protected  Location initialLocation
           
protected  ILocated lastTarget
           
protected  LogCategory log
           
static double MAX_ANGLE
           
protected  IUT2004PathRunner runner
           
protected  List<IStuckDetector> stuckDetectors
           
protected  boolean success
           
 
Constructor Summary
UT2004RunStraight(UT2004Bot bot, AgentInfo info, AdvancedLocomotion move)
           
 
Method Summary
 void addStuckDetector(IStuckDetector stuckDetector)
          Adds another stuck detector to be used for stuck detection :)
 void clearStuckDetectors()
          Removes ALL stuck detectors.
 ILocated getCurrentTarget()
          Get current target of the straight-run.
 ILocated getLastTarget()
          Get previous target of the straight-run.
 Logger getLog()
          Returns component's logger.
 boolean isExecuting()
          Whether the object is executing the running.
 boolean isFailed()
          Whether our run has failed.
 boolean isSuccess()
          Whether our run has succeeded (once we get to our target, this returns true).
 void removeStuckDetector(IStuckDetector stuckDetector)
          Removes stuck detector.
protected  void reset()
           
protected  void runStraight()
           
 void runStraight(ILocated target)
          Run along straight-line to some target.
 void setFocus(ILocated focus)
          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(boolean stopMovement)
          Stop the running.
protected  void stuck()
           
protected  void success()
           
 
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

AT_PLAYER

public static final double AT_PLAYER
See Also:
Constant Field Values

AT_NAVPOINT

public static final double AT_NAVPOINT
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

endListener

protected IWorldEventListener<EndMessage> endListener

stuckDetectors

protected List<IStuckDetector> stuckDetectors

initialLocation

protected Location initialLocation

currentTarget

protected ILocated currentTarget

success

protected boolean success

failed

protected boolean failed

lastTarget

protected ILocated lastTarget

focus

protected ILocated focus
Constructor Detail

UT2004RunStraight

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

getLog

public Logger getLog()
Description copied from interface: IUT2004RunStraight
Returns component's logger.

Specified by:
getLog in interface IUT2004RunStraight
Returns:

addStuckDetector

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

Specified by:
addStuckDetector in interface IUT2004RunStraight

removeStuckDetector

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

Specified by:
removeStuckDetector in interface IUT2004RunStraight

clearStuckDetectors

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

Specified by:
clearStuckDetectors in interface IUT2004RunStraight

isExecuting

public boolean isExecuting()
Description copied from interface: IUT2004RunStraight
Whether the object is executing the running.

Specified by:
isExecuting in interface IUT2004RunStraight
Returns:

isSuccess

public boolean isSuccess()
Description copied from interface: IUT2004RunStraight
Whether our run has succeeded (once we get to our target, this returns true).

Specified by:
isSuccess in interface IUT2004RunStraight
Returns:

isFailed

public boolean isFailed()
Description copied from interface: IUT2004RunStraight
Whether our run has failed.

Specified by:
isFailed in interface IUT2004RunStraight
Returns:

getLastTarget

public ILocated getLastTarget()
Description copied from interface: IUT2004RunStraight
Get previous target of the straight-run.

Specified by:
getLastTarget in interface IUT2004RunStraight
Returns:

getCurrentTarget

public ILocated getCurrentTarget()
Description copied from interface: IUT2004RunStraight
Get current target of the straight-run.

Specified by:
getCurrentTarget in interface IUT2004RunStraight
Returns:

setFocus

public void setFocus(ILocated focus)
Description copied from interface: IUT2004RunStraight
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 IUT2004RunStraight

runStraight

public void runStraight(ILocated target)
Description copied from interface: IUT2004RunStraight
Run along straight-line to some target.

Specified by:
runStraight in interface IUT2004RunStraight

stop

public void stop(boolean stopMovement)
Description copied from interface: IUT2004RunStraight
Stop the running.

Specified by:
stop in interface IUT2004RunStraight

reset

protected void reset()

runStraight

protected void runStraight()

success

protected void success()

stuck

protected void stuck()


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