|
|||||||||
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.base.server.AbstractWorldServer<WORLD_VIEW,ACT,IUT2004Bot> cz.cuni.amis.pogamut.ut2004.server.impl.AbstractUT2004Server<UT2004WorldView,IAct> cz.cuni.amis.pogamut.ut2004.server.impl.UT2004Server cz.cuni.amis.pogamut.ut2004.analyzer.UT2004Analyzer
public class UT2004Analyzer
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 |
---|
@Inject public UT2004Analyzer(UT2004AnalyzerParameters params, IAgentLogger agentLogger, IComponentBus bus, SocketConnection connection, UT2004WorldView worldView, IAct act)
Method Detail |
---|
public UT2004AnalyzerParameters getParams()
UT2004Server
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.
getParams
in class UT2004Server
public java.util.Map<UnrealId,IUT2004AnalyzerObserver> getObservers()
IUT2004Analyzer
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.
getObservers
in interface IUT2004Analyzer
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 AbstractUT2004Server<UT2004WorldView,IAct>
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 AbstractUT2004Server<UT2004WorldView,IAct>
protected void cleanUp()
stopAgent()
and killAgent()
to clean up stuff (stops observers).
public static void main(java.lang.String[] args)
public void addListener(IAnalyzerObserverListener listener)
IUT2004Analyzer
WeakReference
is used to store the listener reference!)
addListener
in interface IUT2004Analyzer
public boolean isListening(IAnalyzerObserverListener listener)
IUT2004Analyzer
isListening
in interface IUT2004Analyzer
public void removeListener(IAnalyzerObserverListener listener)
IUT2004Analyzer
removeListener
in interface IUT2004Analyzer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |