cz.cuni.amis.pogamut.defcon.agent
Class DefConAgent<CONTROLLER extends IDefConAgentLogicController<DefConAgent<?>,?>>

Package class diagram package DefConAgent
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.agent.impl.AbstractAgent
      extended by cz.cuni.amis.pogamut.base.agent.impl.AbstractObservingAgent<WORLD_VIEW>
          extended by cz.cuni.amis.pogamut.base.agent.impl.AbstractGhostAgent<WORLD_VIEW,ACT>
              extended by cz.cuni.amis.pogamut.base.agent.impl.AbstractEmbodiedAgent<DefConWorldView,IJNIAct>
                  extended by cz.cuni.amis.pogamut.defcon.agent.DefConAgent<CONTROLLER>
Type Parameters:
CONTROLLER -
All Implemented Interfaces:
IAgent, IEmbodiedAgent, IGhostAgent, IObservingAgent, IComponent, IComponentAware, IControllable, IDefConAgent

public class DefConAgent<CONTROLLER extends IDefConAgentLogicController<DefConAgent<?>,?>>
extends AbstractEmbodiedAgent<DefConWorldView,IJNIAct>
implements IDefConAgent

Basic defcon agent implementation.

Author:
Radek 'Black_Hand' Pibil

Field Summary
protected  DefConWorldView worldview
           
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.impl.AbstractAgent
events, INTROSPECTION_ROOT_NAME, log, LOG_CATEGORY_NAME
 
Constructor Summary
DefConAgent(IAgentId agentId, IComponentBus eventBus, IAgentLogger logger, DefConWorldView worldView, DefConAct act, IDefConAgentLogicController logic)
          Inits a DefConAgent instance
 
Method Summary
 void act(DefConCommand command)
          Simplifies access to IAct.
protected  boolean gameHasStarted()
           
protected  void gameStarted()
           
 Map<String,String> getArguments()
          Returns a set of arguments passed to defcon.
 DefConWorldView getWorldView()
           
protected  void killAgent()
           
 void setOptions(Map<String,String> arguments)
          Used by PogamutJBotSupport to assign arguments.
protected  void startAgent()
           
protected  void stopAgent()
           
 
Methods inherited from class cz.cuni.amis.pogamut.base.agent.impl.AbstractEmbodiedAgent
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, resetAgent, resetEvent, resume, resumeAgent, setState, start, startPaused, startPausedAgent, 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.IEmbodiedAgent
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
 

Field Detail

worldview

protected DefConWorldView worldview
Constructor Detail

DefConAgent

@Inject
public DefConAgent(IAgentId agentId,
                          IComponentBus eventBus,
                          IAgentLogger logger,
                          DefConWorldView worldView,
                          DefConAct act,
                          IDefConAgentLogicController logic)
Inits a DefConAgent instance

Parameters:
agentId -
eventBus -
logger -
worldView -
act -
logic -
Method Detail

getArguments

public Map<String,String> getArguments()
Returns a set of arguments passed to defcon.

Specified by:
getArguments in interface IDefConAgent
Returns:

setOptions

public void setOptions(Map<String,String> arguments)
Used by PogamutJBotSupport to assign arguments.

Specified by:
setOptions in interface IDefConAgent

getWorldView

public DefConWorldView getWorldView()
Specified by:
getWorldView in interface IObservingAgent
Overrides:
getWorldView in class AbstractObservingAgent<DefConWorldView>

startAgent

protected void startAgent()
Overrides:
startAgent in class AbstractAgent

stopAgent

protected void stopAgent()
Overrides:
stopAgent in class AbstractAgent

killAgent

protected void killAgent()
Overrides:
killAgent in class AbstractAgent

gameStarted

protected void gameStarted()

gameHasStarted

protected boolean gameHasStarted()

act

public void act(DefConCommand command)
Description copied from interface: IDefConAgent
Simplifies access to IAct. No need to use getAct().act().

Specified by:
act in interface IDefConAgent


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