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

Package class diagram package 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().

Author:
Jimmy

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, LOG_CATEGORY_NAME
 
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).
 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.
protected  void init()
          Hook for users (descendants of this class) to fill-in initialization code, any listeners hooked here should be removed inside UT2004Server.reset().
 boolean isListening(IAnalyzerObserverListener listener)
          Tests a listener whether it watches for creation/deletion of observers.
protected  void killAgent()
           
static void main(String[] args)
           
 void removeListener(IAnalyzerObserverListener listener)
          Removes a listener that watches for creation/deletion of observers.
protected  void startAgent()
           
protected  void startPausedAgent()
           
protected  void stopAgent()
           
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.server.impl.UT2004Server
connectNativeBot, reset, setGameMap
 
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.unreal.server.IUnrealServer
connectNativeBot
 
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 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:

startAgent

protected void startAgent()
Overrides:
startAgent in class UT2004Server

startPausedAgent

protected void startPausedAgent()
Overrides:
startPausedAgent in class UT2004Server

stopAgent

protected void stopAgent()
Overrides:
stopAgent in class AbstractUT2004Server<UT2004WorldView,IAct>

killAgent

protected void killAgent()
Overrides:
killAgent in class AbstractUT2004Server<UT2004WorldView,IAct>

init

protected void init()
Description copied from class: UT2004Server
Hook for users (descendants of this class) to fill-in initialization code, any listeners hooked here should be removed inside UT2004Server.reset().

Overrides:
init in class UT2004Server

cleanUp

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


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

main

public static void main(String[] args)


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