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

Package class diagram package UT2004AnalyzerFullObserver
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,IAct>
                  extended by cz.cuni.amis.pogamut.ut2004.observer.impl.UT2004Observer
                      extended by cz.cuni.amis.pogamut.ut2004.analyzer.UT2004AnalyzerFullObserver
All Implemented Interfaces:
IAgent, IGhostAgent, IObservingAgent, IComponent, IComponentAware, IControllable, IUT2004AnalyzerObserver, IUT2004Observer
Direct Known Subclasses:
UT2004AnalyzerObsStats

public class UT2004AnalyzerFullObserver
extends UT2004Observer
implements IUT2004AnalyzerObserver

Similar to UT2004AnalyzerObserver, but it may output ALL MESSAGES for a given bot.

Author:
Jimmy

Field Summary
static String humanLike_DELIMITER
          Delimiter separating parts of saved log messages.
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.impl.AbstractAgent
events, INTROSPECTION_ROOT_NAME, log, LOG_CATEGORY_NAME
 
Constructor Summary
UT2004AnalyzerFullObserver(UT2004AnalyzerFullObserverParameters params, IComponentBus bus, IAgentLogger agentLogger, UT2004WorldView worldView, IAct act)
           
 
Method Summary
protected  void configureObserver()
          Called from the startAgent() after InitializeObserver command is sent to configure the observer instance.
protected  void gameRestartEnd()
          Called whenever GameRestart message with GameRestarted.isFinished() is received.
protected  void gameRestartStarted()
          Called whenever GameRestart message with GameRestarted.isStarted() is received.
 Self getBotSelf()
          READ-ONLY, Self object of the observed bot.
 UnrealId getObservedBotId()
          Returns id of the bot that the observer is sniffing info from.
 String getOutputFilePath()
          Returns path to file that should be used for outputting the data
 UT2004AnalyzerFullObserverParameters getParams()
          Returns parameters that were passed into the agent during the construction.
protected  void initializeHumanLikeObserving(String observedPlayer, PrintWriter printWriter)
          Initialize listeners.
protected  void save(String name, Long time, String type, String message)
           
protected  void startAgent()
          Initialize the observer to listen on the UT2004AnalyzerObserverParameters.getObservedAgentId() that is obtained from the getParams().
protected  void startPausedAgent()
           
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.observer.impl.AbstractUT2004Observer
createPasswordReply, getPasswordReply, getWorldView, killAgent, readyCommandRequested, reset, resetAgent, setPassword, 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.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
 

Field Detail

humanLike_DELIMITER

public static final String humanLike_DELIMITER
Delimiter separating parts of saved log messages. Parts are player name, time, type of message and a GameBots message.

See Also:
Constant Field Values
Constructor Detail

UT2004AnalyzerFullObserver

@Inject
public UT2004AnalyzerFullObserver(UT2004AnalyzerFullObserverParameters params,
                                         IComponentBus bus,
                                         IAgentLogger agentLogger,
                                         UT2004WorldView worldView,
                                         IAct act)
Method Detail

getParams

public UT2004AnalyzerFullObserverParameters getParams()
Description copied from class: UT2004Observer
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 UT2004Observer
Returns:
parameters

getObservedBotId

public UnrealId getObservedBotId()
Description copied from interface: IUT2004AnalyzerObserver
Returns id of the bot that the observer is sniffing info from.

Specified by:
getObservedBotId in interface IUT2004AnalyzerObserver
Returns:
bot's id

getOutputFilePath

public String getOutputFilePath()
Returns path to file that should be used for outputting the data

Returns:

gameRestartStarted

protected void gameRestartStarted()
Called whenever GameRestart message with GameRestarted.isStarted() is received.

You probably won't need to override this method, better override gameRestartEnd(), that is the place where you should reset data collection statistics / start them in case of UT2004AnalyzerObserverParameters.isWaitForMatchRestart().

Current implementation is empty.


gameRestartEnd

protected void gameRestartEnd()
Called whenever GameRestart message with GameRestarted.isFinished() is received.

Place where you should reset data collection statistics / start them in case of UT2004AnalyzerObserverParameters.isWaitForMatchRestart().

Current implementation is empty.


startAgent

protected void startAgent()
Initialize the observer to listen on the UT2004AnalyzerObserverParameters.getObservedAgentId() that is obtained from the getParams().

Overrides:
startAgent in class AbstractUT2004Observer<UT2004WorldView,IAct>

startPausedAgent

protected void startPausedAgent()
Overrides:
startPausedAgent in class AbstractUT2004Observer<UT2004WorldView,IAct>

configureObserver

protected void configureObserver()
Called from the startAgent() after InitializeObserver command is sent to configure the observer instance.

Actually enables Self, MyInventory and async messages (i.e., BotKilled).


save

protected void save(String name,
                    Long time,
                    String type,
                    String message)

getBotSelf

public Self getBotSelf()
READ-ONLY, Self object of the observed bot.


initializeHumanLikeObserving

protected void initializeHumanLikeObserving(String observedPlayer,
                                            PrintWriter printWriter)
Initialize listeners. We call this method manually - we register listeners here.

Parameters:
observedPlayer - name of observed player
printWriter -


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