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

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.agent.params.impl.AgentParameters
      extended by cz.cuni.amis.pogamut.base.agent.params.impl.RemoteAgentParameters
          extended by cz.cuni.amis.pogamut.ut2004.agent.params.UT2004AgentParameters
              extended by cz.cuni.amis.pogamut.ut2004.analyzer.UT2004AnalyzerParameters
All Implemented Interfaces:
IAgentParameters, IRemoteAgentParameters

public class UT2004AnalyzerParameters
extends UT2004AgentParameters

Agent parameters are meant to provide run-time parameters needed by UT2004Analyzer.

Crucial parameters that (even though are present in the UT2004AnalyzerRunner might be needed in order to customize whole UT2004Analyzer: UT2004AnalyzerParameters#setObserverModule(UT2004AnalyzerObserverModule).

NOTE: all {@link IAgentParameters} implementors are usually used together with {@link IAgentRunner} or {@link IMultipleAgentRunner} which usually contains sensible default params, therefore there is no need to set all parameters into newly created ones as runners will supply them via {@link IAgentParameters#assignDefaults(IAgentParameters)}.

See Also:
UT2004AgentParameters

Constructor Summary
UT2004AnalyzerParameters()
          If you need to populate the parameters after instantiation, use setters available in this class: setAgentId(IAgentId), setWorldAddress(IWorldConnectionAddress), UT2004AnalyzerParameters#setObserverModule(UT2004ObserverModule).
 
Method Summary
 void assignDefaults(IAgentParameters defaults)
          Fills missing parameters of 'this' with values from 'defaults'.
 java.util.Map<UnrealId,java.lang.String> getFileNames()
          This may be used to provide concrete filenames for outputting stats for bots identified by their id.
 SocketConnectionAddress getObserverAddress()
          Returns observer address that should be used for spawning new observers.
 UT2004AnalyzerObserverModule getObserverModule()
           
 java.lang.String getOutputPath()
          Contains path to directory where the observer should output its results.
 boolean isWaitForMatchRestart()
          Whether the analyzer's observers should wait for match-restart before it starts to collect data.
 UT2004AnalyzerParameters setAgentId(IAgentId agentId)
          Sets agent id into the parameters.
 UT2004AnalyzerParameters setFileNames(java.util.Map<UnrealId,java.lang.String> fileNames)
          This may be used to provide concrete filenames for outputting stats for bots identified by their id.
 UT2004AnalyzerParameters setObserverAddress(SocketConnectionAddress observerAddress)
          Sets observer address that should be used for spawning new observers.
 UT2004AnalyzerParameters setObserverModule(UT2004AnalyzerObserverModule observerModule)
          Sets observer module (one that will be used to construct new UT2004AnalyzerObserver in order to sniff info about connected bots.
 UT2004AnalyzerParameters setOutputPath(java.lang.String outputPath)
          Sets path to directory where the observer should output its results.
 UT2004AnalyzerParameters setWaitForMatchRestart(boolean waitForMatchRestart)
          Sets whether the analyzer's observers should wait for match-restart before it starts to collect data.
 UT2004AnalyzerParameters setWorldAddress(IWorldConnectionAddress address)
          Sets connection address into the parameters.
 
Methods inherited from class cz.cuni.amis.pogamut.base.agent.params.impl.RemoteAgentParameters
getWorldAddress
 
Methods inherited from class cz.cuni.amis.pogamut.base.agent.params.impl.AgentParameters
getAgentId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cz.cuni.amis.pogamut.base.agent.params.IAgentParameters
getAgentId
 

Constructor Detail

UT2004AnalyzerParameters

public UT2004AnalyzerParameters()
If you need to populate the parameters after instantiation, use setters available in this class: setAgentId(IAgentId), setWorldAddress(IWorldConnectionAddress), UT2004AnalyzerParameters#setObserverModule(UT2004ObserverModule).

Method Detail

getObserverModule

public UT2004AnalyzerObserverModule getObserverModule()

setObserverModule

public UT2004AnalyzerParameters setObserverModule(UT2004AnalyzerObserverModule observerModule)
Sets observer module (one that will be used to construct new UT2004AnalyzerObserver in order to sniff info about connected bots.

WARNING: Note that you should not mess with 'setters' in different threads as they are non-thread-safe and may interrupt horrible agent instantiations with such behavior.

Parameters:
address -
Returns:
this instance

setAgentId

public UT2004AnalyzerParameters setAgentId(IAgentId agentId)
Description copied from class: AgentParameters
Sets agent id into the parameters.

WARNING: Note that you should not mess with 'setters' in different threads as they are non-thread-safe and may interrupt horrible agent instantiations with such behavior.

Overrides:
setAgentId in class UT2004AgentParameters
Returns:
this instance

setWorldAddress

public UT2004AnalyzerParameters setWorldAddress(IWorldConnectionAddress address)
Description copied from class: RemoteAgentParameters
Sets connection address into the parameters.

WARNING: Note that you should not mess with 'setters' in different threads as they are non-thread-safe and may interrupt horrible agent instantiations with such behavior.

Overrides:
setWorldAddress in class UT2004AgentParameters
Returns:
this instance

getOutputPath

public java.lang.String getOutputPath()
Contains path to directory where the observer should output its results. MUST POINT TO DIR!

Returns:

setOutputPath

public UT2004AnalyzerParameters setOutputPath(java.lang.String outputPath)
Sets path to directory where the observer should output its results. MUST POINT TO DIR!

Parameters:
outputPath -

isWaitForMatchRestart

public boolean isWaitForMatchRestart()
Whether the analyzer's observers should wait for match-restart before it starts to collect data.

Returns:

setWaitForMatchRestart

public UT2004AnalyzerParameters setWaitForMatchRestart(boolean waitForMatchRestart)
Sets whether the analyzer's observers should wait for match-restart before it starts to collect data.

Parameters:
waitForMatchRestart -

getFileNames

public java.util.Map<UnrealId,java.lang.String> getFileNames()
This may be used to provide concrete filenames for outputting stats for bots identified by their id.

Returns:

setFileNames

public UT2004AnalyzerParameters setFileNames(java.util.Map<UnrealId,java.lang.String> fileNames)
This may be used to provide concrete filenames for outputting stats for bots identified by their id.

Parameters:
fileNames -
Returns:

getObserverAddress

public SocketConnectionAddress getObserverAddress()
Returns observer address that should be used for spawning new observers.

Returns:

setObserverAddress

public UT2004AnalyzerParameters setObserverAddress(SocketConnectionAddress observerAddress)
Sets observer address that should be used for spawning new observers. If you do not specify it a default address will be used.

Parameters:
observerAddress -

assignDefaults

public void assignDefaults(IAgentParameters defaults)
Description copied from interface: IAgentParameters
Fills missing parameters of 'this' with values from 'defaults'.

This method is meant as a hook for IAgentRunners that can ease the burden of instantiating&launching the agent into a specific environment.

It assigns params from 'default' only to fields (of this) that are null!

Specified by:
assignDefaults in interface IAgentParameters
Overrides:
assignDefaults in class RemoteAgentParameters
Parameters:
defaults - values that should filled missing parameters