cz.cuni.amis.pogamut.ut2004.analyzer
Class UT2004Analyzer

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.server.AbstractWorldServer<WORLD_VIEW,ACT,IUT2004Bot>
                  extended by cz.cuni.amis.pogamut.ut2004.server.impl.AbstractUT2004Server<UT2004WorldView,IAct>
                      extended by cz.cuni.amis.pogamut.ut2004.server.impl.UT2004Server
                          extended by cz.cuni.amis.pogamut.ut2004.analyzer.UT2004Analyzer
All Implemented Interfaces:
IAgent, IGhostAgent, IObservingAgent, IComponent, IComponentAware, IControllable, IWorldAgentsObserver<IUT2004Bot>, IWorldServer<IUT2004Bot>, IUnrealServer<IUT2004Bot>, IUT2004Analyzer, IUT2004Server

public class UT2004Analyzer
extends UT2004Server
implements IUT2004Analyzer

UT2004Analyzer can be used to automatically observe all bots/players in the game sniff their messages.

It creates and launches IUT2004AnalyzerObserver that is constructed according to the UT2004AnalyzerParameters.getObserverModule().


Nested Class Summary
 
Nested classes/interfaces inherited from class cz.cuni.amis.pogamut.ut2004.server.impl.UT2004Server
UT2004Server.MapChangeFuture
 
Field Summary
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.server.impl.UT2004Server
changingMap, changingMapAttempt, changingMapMutex, MAP_CHANGE_CONNECT_INTERVAL_MILLIS, mapChangeFuture, mapListListener, MAX_CHANGING_MAP_ATTEMPTS, playerJoinsListener, targetMap
 
Fields inherited from class cz.cuni.amis.pogamut.base.server.AbstractWorldServer
worldAddress
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.impl.AbstractAgent
events, INTROSPECTION_ROOT_NAME, log
 
Constructor Summary
UT2004Analyzer(UT2004AnalyzerParameters params, IAgentLogger agentLogger, IComponentBus bus, SocketConnection connection, UT2004WorldView worldView, IAct act)
           
 
Method Summary
 void addListener(IAnalyzerObserverListener listener)
          Hooks a listener that watches for creation/deletion of observers.
protected  void cleanUp()
          Called from stopAgent() and killAgent() to clean up stuff (stops observers).
 java.util.Map<UnrealId,IUT2004AnalyzerObserver> getObservers()
          Returns all observers currently owned by the analyzer.
 UT2004AnalyzerParameters getParams()
          Returns parameters that were passed into the agent during the construction.
 boolean isListening(IAnalyzerObserverListener listener)
          Tests a listener whether it watches for creation/deletion of observers.
protected  void killAgent()
          Called during kill() method - override to provide custom ruthless stopping (killing) behavior of the agent.
static void main(java.lang.String[] args)
           
 void removeListener(IAnalyzerObserverListener listener)
          Removes a listener that watches for creation/deletion of observers.
protected  void stopAgent()
          Called during stop() method - override to provide custom stopping behavior of the agent.
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.server.impl.UT2004Server
reset, setGameMap, startAgent, startPausedAgent
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.server.impl.AbstractUT2004Server
connectNativeBot, createPasswordReply, getAgents, getAvailableMaps, getGameInfo, getGameSpeedFlag, getMap, getMapName, getMutators, getNativeAgents, getPasswordReply, getPlayers, getWorldView, readyCommandRequested, resetAgent, setAddress, setPassword
 
Methods inherited from class cz.cuni.amis.pogamut.base.server.AbstractWorldServer
getWorldAddress
 
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.ut2004.server.IUT2004Server
connectNativeBot, getAvailableMaps, getGameSpeedFlag, getMap, getMapName, getMutators, getNativeAgents, getPlayers, setAddress, setGameMap
 
Methods inherited from interface cz.cuni.amis.pogamut.base.server.IWorldServer
getWorldAddress
 
Methods inherited from interface cz.cuni.amis.pogamut.base.server.IWorldAgentsObserver
getAgents
 
Methods inherited from interface cz.cuni.amis.pogamut.base.agent.IGhostAgent
getAct
 
Methods inherited from interface cz.cuni.amis.pogamut.base.agent.IObservingAgent
getWorldView
 
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

UT2004Analyzer

@Inject
public UT2004Analyzer(UT2004AnalyzerParameters params,
                             IAgentLogger agentLogger,
                             IComponentBus bus,
                             SocketConnection connection,
                             UT2004WorldView worldView,
                             IAct act)
Method Detail

getParams

public UT2004AnalyzerParameters getParams()
Description copied from class: UT2004Server
Returns parameters that were passed into the agent during the construction.

This is a great place to parametrize your agent. Note that you may pass arbitrary subclass of UT2004AgentParameters to the constructor/factory/runner and pick them up here.

Overrides:
getParams in class UT2004Server
Returns:
parameters

getObservers

public java.util.Map<UnrealId,IUT2004AnalyzerObserver> getObservers()
Description copied from interface: IUT2004Analyzer
Returns all observers currently owned by the analyzer.

The id can be obtained for instance from Player.getId() or Self.getId() or new one can be obtained from String via UnrealId.get(String).

NOTE: returns unmodifiable map that is a copy of the inner map inside the analyzer.

Specified by:
getObservers in interface IUT2004Analyzer
Returns:

stopAgent

protected void stopAgent()
Description copied from class: AbstractAgent
Called during stop() method - override to provide custom stopping behavior of the agent.

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.

Overrides:
stopAgent in class AbstractUT2004Server<UT2004WorldView,IAct>

killAgent

protected void killAgent()
Description copied from class: AbstractAgent
Called during kill() method - override to provide custom ruthless stopping (killing) behavior of the agent.

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.

Overrides:
killAgent in class AbstractUT2004Server<UT2004WorldView,IAct>

cleanUp

protected void cleanUp()
Called from stopAgent() and killAgent() to clean up stuff (stops observers).


main

public static void main(java.lang.String[] args)

addListener

public void addListener(IAnalyzerObserverListener listener)
Description copied from interface: IUT2004Analyzer
Hooks a listener that watches for creation/deletion of observers. (WeakReference is used to store the listener reference!)

Specified by:
addListener in interface IUT2004Analyzer

isListening

public boolean isListening(IAnalyzerObserverListener listener)
Description copied from interface: IUT2004Analyzer
Tests a listener whether it watches for creation/deletion of observers.

Specified by:
isListening in interface IUT2004Analyzer
Returns:

removeListener

public void removeListener(IAnalyzerObserverListener listener)
Description copied from interface: IUT2004Analyzer
Removes a listener that watches for creation/deletion of observers.

Specified by:
removeListener in interface IUT2004Analyzer