|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.base.agent.impl.AbstractAgent cz.cuni.amis.pogamut.base.agent.impl.AbstractObservingAgent<WORLD_VIEW> cz.cuni.amis.pogamut.base.agent.impl.AbstractGhostAgent<WORLD_VIEW,ACT> cz.cuni.amis.pogamut.ut2004.observer.impl.AbstractUT2004Observer<WORLD_VIEW,ACT>
public abstract class AbstractUT2004Observer<WORLD_VIEW extends IVisionWorldView,ACT extends IAct>
Abstract class - ancestor of all UT2004 observer controls.
It counts with GameBots2004 protocol therefore taking care of:
You may use setPassword() method to specify the password before starting the agent.
Field Summary |
---|
Fields inherited from class cz.cuni.amis.pogamut.base.agent.impl.AbstractAgent |
---|
events, INTROSPECTION_ROOT_NAME, log |
Constructor Summary | |
---|---|
AbstractUT2004Observer(IAgentId agentId,
IComponentBus bus,
IAgentLogger agentLogger,
WORLD_VIEW worldView,
ACT act)
|
Method Summary | |
---|---|
protected PasswordReply |
createPasswordReply()
This method is called whenever the Password event is caught telling us the world is locked and is requiring a password. |
PasswordReply |
getPasswordReply()
Instance of the password reply command that was sent upon receivieng request for the password (the world is locked). |
WORLD_VIEW |
getWorldView()
Returns abstraction for the agent's world. |
protected void |
killAgent()
Called during kill() method - override to provide custom ruthless stopping (killing) behavior of the agent. |
protected void |
readyCommandRequested()
This method is called whenever HelloBot message is parsed - the GameBots2004 is awaiting the bot to reply with Ready command to begin the handshake. |
protected void |
reset()
Called during stop/kill/reset events. |
protected void |
resetAgent()
Called whenever the IComponentBus broadcast IResetEvent to reset all agent's components as well
as an agent. |
void |
setPassword(java.lang.String password)
Specify the password that should be used if required by the world. |
protected void |
startAgent()
Called during start() method - override to provide custom starting behavior of the agent. |
protected void |
startPausedAgent()
Called during startPaused() method - override to provide custom starting-paused behavior of the agent. |
protected void |
stopAgent()
Called during stop() method - override to provide custom stopping behavior of the agent. |
Methods inherited from class cz.cuni.amis.pogamut.base.agent.impl.AbstractGhostAgent |
---|
getAct |
Methods inherited from class cz.cuni.amis.pogamut.base.agent.impl.AbstractAgent |
---|
addDependency, addDependency, addDependency, addJMXComponents, awaitState, awaitState, componentFatalError, componentStarted, componentStarted, componentStopped, componentStopping, createAgentJMX, createIntrospection, equals, getComponentId, getEventBus, getIntrospection, getJMX, getLog, getLogger, getName, getState, hashCode, inState, kill, notInState, pause, pauseAgent, preKillAgent, preStopAgent, resetEvent, resume, resumeAgent, setState, start, startPaused, stop, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface cz.cuni.amis.pogamut.base.agent.IGhostAgent |
---|
getAct |
Methods inherited from interface cz.cuni.amis.pogamut.base.agent.IAgent |
---|
getComponentId, getIntrospection, getLogger, getName, getState, kill, pause, resume, start, startPaused, stop |
Methods inherited from interface cz.cuni.amis.pogamut.base.component.IComponentAware |
---|
getEventBus |
Constructor Detail |
---|
@Inject public AbstractUT2004Observer(IAgentId agentId, IComponentBus bus, IAgentLogger agentLogger, WORLD_VIEW worldView, ACT act)
Method Detail |
---|
public void setPassword(java.lang.String password)
password
- protected void readyCommandRequested()
public PasswordReply getPasswordReply()
If null the password was not required by the time the bot connected to the world.
protected PasswordReply createPasswordReply()
May return null - in that case an empty password is sent to the server (which will probably result in closing the connection and termination of the agent).
This message is then saved to private field passwordReply and is accessible via getPasswordReply() method if required to be probed during the bot's runtime.
Note that if setPassword() method is called before this one it will use provided password via that method.
public WORLD_VIEW getWorldView()
AbstractObservingAgent
getWorldView
in interface IObservingAgent
getWorldView
in class AbstractObservingAgent<WORLD_VIEW extends IVisionWorldView>
protected void reset()
protected void startAgent()
AbstractAgent
WARNING: DO NOT CALL ON YOUR OWN, ALWAYS USE PUBLIC INTERFACE (start()), but that should not be needed!
If you override this method don't forget to call super.startAgent() as the first method.
startAgent
in class AbstractAgent
protected void startPausedAgent()
AbstractAgent
WARNING: DO NOT CALL ON YOUR OWN, ALWAYS USE PUBLIC INTERFACE (startPaused()), but that should not be needed!
If you override this method don't forget to call super.startPausedAgent() as the first method.
startPausedAgent
in class AbstractAgent
protected void resetAgent()
AbstractAgent
IComponentBus
broadcast IResetEvent
to reset all agent's components as well
as an agent. Clean up your private data structure, get ready to be started again.
WARNING: DO NOT CALL ON YOUR OWN, CALLED FROM THE AbstractAgent.resetEvent(IResetEvent)
AUTOMATICALLY.
If you override this method don't forget to call super.resetAgent() as the first method.
resetAgent
in class AbstractAgent
protected void stopAgent()
AbstractAgent
WARNING: DO NOT CALL ON YOUR OWN, ALWAYS USE PUBLIC INTERFACE (stop()).
If you override this method don't forget to call super.stopAgent() as the first method.
stopAgent
in class AbstractAgent
protected void killAgent()
AbstractAgent
WARNING: DO NOT CALL ON YOUR OWN, ALWAYS USE PUBLIC INTERFACE (kill()).
If you override this method don't forget to call super.killAgent() as the first method.
killAgent
in class AbstractAgent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |