cz.cuni.amis.pogamut.ut2004.examples.botobserver
Class BotObserver

Package class diagram package BotObserver
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.ut2004.observer.impl.AbstractUT2004Observer<UT2004WorldView,cz.cuni.amis.pogamut.base.communication.command.IAct>
                  extended by cz.cuni.amis.pogamut.ut2004.observer.impl.UT2004Observer
                      extended by cz.cuni.amis.pogamut.ut2004.examples.botobserver.BotObserver
All Implemented Interfaces:
cz.cuni.amis.pogamut.base.agent.IAgent, cz.cuni.amis.pogamut.base.agent.IGhostAgent, cz.cuni.amis.pogamut.base.agent.IObservingAgent, cz.cuni.amis.pogamut.base.component.IComponent, cz.cuni.amis.pogamut.base.component.IComponentAware, cz.cuni.amis.pogamut.base.component.IControllable, IUT2004Observer

public class BotObserver
extends UT2004Observer

This simple example will show you how to use Observers. Observers are very nice as that can collect information about arbitrary bots running in UT2004 game. E.g. you can sense on SELF message of the bot, what it can see, whether it is getting damaged, etc...

Author:
Jakub Gemrot aka Jimmy

Field Summary
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.impl.AbstractAgent
events, INTROSPECTION_ROOT_NAME, log, LOG_CATEGORY_NAME
 
Constructor Summary
BotObserver(UT2004AgentParameters params, cz.cuni.amis.pogamut.base.component.bus.IComponentBus bus, cz.cuni.amis.pogamut.base.utils.logging.IAgentLogger agentLogger, UT2004WorldView worldView, cz.cuni.amis.pogamut.base.communication.command.IAct act)
           
 
Method Summary
 BotObserverParams getParams()
          We're going to instantiate BotObserver only with BotObserverParams (see constructor that enforces that).
static void main(String[] args)
           
 void playerEvent(cz.cuni.amis.pogamut.base.communication.worldview.object.event.WorldObjectUpdatedEvent<Player> event)
           
 void selfEvent(cz.cuni.amis.pogamut.base.communication.worldview.object.event.WorldObjectUpdatedEvent<Self> event)
           
static void startObserver()
          In case you starting this observer manually, use this method.
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.observer.impl.AbstractUT2004Observer
createPasswordReply, getPasswordReply, getWorldView, killAgent, readyCommandRequested, reset, resetAgent, setPassword, startAgent, startPausedAgent, stopAgent
 
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

BotObserver

@Inject
public BotObserver(UT2004AgentParameters params,
                          cz.cuni.amis.pogamut.base.component.bus.IComponentBus bus,
                          cz.cuni.amis.pogamut.base.utils.logging.IAgentLogger agentLogger,
                          UT2004WorldView worldView,
                          cz.cuni.amis.pogamut.base.communication.command.IAct act)
Method Detail

getParams

public BotObserverParams getParams()
We're going to instantiate BotObserver only with BotObserverParams (see constructor that enforces that).

Overrides:
getParams in class UT2004Observer

playerEvent

public void playerEvent(cz.cuni.amis.pogamut.base.communication.worldview.object.event.WorldObjectUpdatedEvent<Player> event)

selfEvent

public void selfEvent(cz.cuni.amis.pogamut.base.communication.worldview.object.event.WorldObjectUpdatedEvent<Self> event)

startObserver

public static void startObserver()
In case you starting this observer manually, use this method. Just configures the NAME of the bot to observe. NOTE THAT THE OBSERVER MUST BE STARTED AFTER THE OBSERVED BOT!

Parameters:
args -

main

public static void main(String[] args)
                 throws cz.cuni.amis.utils.exception.PogamutException
Throws:
cz.cuni.amis.utils.exception.PogamutException


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