cz.cuni.pogamut.Client
Class TestBot

java.lang.Object
  extended by cz.cuni.pogamut.Client.Agent
      extended by cz.cuni.pogamut.Client.TestBot
All Implemented Interfaces:
RcvMsgListener, Introspectable, java.lang.Runnable, java.util.EventListener

public class TestBot
extends Agent

Good old Kheppera robots, who doesn't know them? Well this bot doesn't look like the Kheppera at all and certainly doesn't have all the sensors the Kheppera has. But it resembles it somehow. This bot doesn't use the information about the navigation points that is provided by the UT2004 and GB2004 rather it uses the AutoTrace feature of the GB2004 and walks according them.


Field Summary
 int bigTurn
          Big rotation (degrees).
(package private)  boolean first
           
static int FRONT_SENSOR
           
static int LEFT_SENSOR
           
 float moveSpeed
          How fast should we move?
 boolean moving
          Whether the bot is moving.
static int RIGHT_SENSOR
           
 boolean sensor
          Whether any of the sensor signalize the collision.
static double SENSOR_LENGTH
           
 boolean sensorFront
          Whether the front sensor signalize the collision.
 boolean sensorLeft
          Whether the left sensor signalize the collision.
 boolean sensorRight
          Whether the right sensor signalize the collision.
 int smallTurn
          Small rotation (degrees).
(package private)  boolean traceRun
           
(package private)  java.util.ArrayList<AutoTraceRay> traces
           
 int turnSleep
          How much time should we wait for the rotation to finish (milliseconds).
 
Fields inherited from class cz.cuni.pogamut.Client.Agent
bindedParserType, body, flagLogicTemporalyStopped, gameBotConnection, gameMap, GARBAGE_COLLECTOR_FREQUENCY, instancesAlive, iterationEndListeners, log, logicFrequency, logicFrequencyChanged, memory, oldLogicFrequency, parserLogger, pauseHolders, platformLog, random, rawGBLog
 
Constructor Summary
TestBot()
          Creates a new instance of agent.
 
Method Summary
protected  void doLogic()
          There you are supposed to connect any external tool for decision making or you can write there some script, that will control the agent.
static void main(java.lang.String[] args)
          NOTE: this method MUST REMAIN DEFINED + MUST REMAIN EMPTY, due to technical reasons.
protected  void postPrepareAgent()
          prepare logic according to information from gathered from startCommunication like choosing plan/parameters according to game type note that you still can't send any messages to gamebots (like CONF etc.)
protected  void prePrepareAgent()
          prepares agent logic to run - like initializing neural networks etc.
protected  void shutdownAgent()
          clean - up after the end of simulation of agent
 
Methods inherited from class cz.cuni.pogamut.Client.Agent
addIterationEndListener, bindLocalParser, bindRemoteParser, clearListeners, disconnect, finalize, getBindedParserType, getBody, getCommunicationState, getFlagLogicTemporalyStopped, getIntrospectableProxy, getLogger, getLogicThread, getMap, getMediator, getMemory, getMilisecToSleep, getName, getPlatformLog, getRawDataLog, initBody, initGameMap, initLogging, initMemory, isRunning, logicReady, pauseLogic, receiveMessage, removeIterationEndListener, resumeLogic, run, sendMessageToGB, setFlagLogicTemporalyStopped, setLogicStartLatch, startAgent, startAgent, stopAgentSoft
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT_SENSOR

public static final int LEFT_SENSOR
See Also:
Constant Field Values

FRONT_SENSOR

public static final int FRONT_SENSOR
See Also:
Constant Field Values

RIGHT_SENSOR

public static final int RIGHT_SENSOR
See Also:
Constant Field Values

SENSOR_LENGTH

public static final double SENSOR_LENGTH
See Also:
Constant Field Values

sensorLeft

public boolean sensorLeft
Whether the left sensor signalize the collision. (Computed in the doLogic())


sensorRight

public boolean sensorRight
Whether the right sensor signalize the collision. (Computed in the doLogic())


sensorFront

public boolean sensorFront
Whether the front sensor signalize the collision. (Computed in the doLogic())


moving

public boolean moving
Whether the bot is moving. (Computed in the doLogic())


sensor

public boolean sensor
Whether any of the sensor signalize the collision. (Computed in the doLogic())


turnSleep

public int turnSleep
How much time should we wait for the rotation to finish (milliseconds).


moveSpeed

public float moveSpeed
How fast should we move? Iterval <0, 1>.


smallTurn

public int smallTurn
Small rotation (degrees).


bigTurn

public int bigTurn
Big rotation (degrees).


traceRun

boolean traceRun

traces

java.util.ArrayList<AutoTraceRay> traces

first

boolean first
Constructor Detail

TestBot

public TestBot()
Creates a new instance of agent.

Method Detail

doLogic

protected void doLogic()
Description copied from class: Agent
There you are supposed to connect any external tool for decision making or you can write there some script, that will control the agent.

Note: it's not good practice to have infinite loop in doLogic() because stopAgentSoft() won't work. But it's OK if you rewrite the stopAgentSoft()

Overrides:
doLogic in class Agent

prePrepareAgent

protected void prePrepareAgent()
                        throws PogamutException
Description copied from class: Agent
prepares agent logic to run - like initializing neural networks etc. not for establishing communication!

Overrides:
prePrepareAgent in class Agent
Throws:
PogamutException

postPrepareAgent

protected void postPrepareAgent()
                         throws PogamutException
Description copied from class: Agent
prepare logic according to information from gathered from startCommunication like choosing plan/parameters according to game type note that you still can't send any messages to gamebots (like CONF etc.)

Overrides:
postPrepareAgent in class Agent
Throws:
PogamutException

shutdownAgent

protected void shutdownAgent()
                      throws PogamutException
Description copied from class: Agent
clean - up after the end of simulation of agent

Overrides:
shutdownAgent in class Agent
Throws:
PogamutException

main

public static void main(java.lang.String[] args)
                 throws java.net.URISyntaxException
NOTE: this method MUST REMAIN DEFINED + MUST REMAIN EMPTY, due to technical reasons.

Throws:
java.net.URISyntaxException