cz.cuni.pogamut.experiments.util
Class BasicExperiment
java.lang.Object
cz.cuni.pogamut.experiments.AbstractExperimentHandle
cz.cuni.pogamut.experiments.Experiment
cz.cuni.pogamut.experiments.util.BasicExperiment
- All Implemented Interfaces:
- ExperimentHandle, LocalExperimentHandle
public class BasicExperiment
- extends Experiment
Compares set of bots, constructs a stat object for each bot.
Method Summary |
protected void |
stageOneInit()
Initializes all resources that the experiment may need (eg. rule engine). |
protected void |
stageThreeFinish()
Release resources used by the experiment, should stop running threads etc. |
protected void |
stageTwoPostAgentConnect()
Template method called after the bots were connected. |
protected void |
stageTwoStart()
Runs the experiment, always called after stageOneInit(). |
protected void |
terminate()
Terminates the experiment and sets agents stats as a result. |
Methods inherited from class cz.cuni.pogamut.experiments.Experiment |
getDescriptor, getExperiment, getExperimentExecutionFlag, getLogger, getName, getServer, getTimeProvider, handleException, handleReplay, runExperiment, setResultAndTerminate, schedule, stop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
agents
protected Agent[] agents
stats
protected AgentStats[] stats
BasicExperiment
public BasicExperiment(ExperimentDescriptor descriptor,
UTServer server)
- Class returning results of the experiment back to a client.
It must be static because Experiment isn't serializable.
stageOneInit
protected void stageOneInit()
throws java.lang.Exception
- Description copied from class:
Experiment
- Initializes all resources that the experiment may need (eg. rule engine).
This method is called from runExperiment()
- Specified by:
stageOneInit
in class Experiment
- Throws:
java.lang.Exception
stageTwoStart
protected void stageTwoStart()
throws java.lang.Exception
- Description copied from class:
Experiment
- Runs the experiment, always called after stageOneInit().
This method is called from runExperiment()
- Specified by:
stageTwoStart
in class Experiment
- Throws:
java.lang.Exception
terminate
protected void terminate()
- Terminates the experiment and sets agents stats as a result.
stageThreeFinish
protected void stageThreeFinish()
- Description copied from class:
Experiment
- Release resources used by the experiment, should stop running threads etc.
Called either when the experiment finishes or when it fails (even if exception was raised).
- Specified by:
stageThreeFinish
in class Experiment
stageTwoPostAgentConnect
protected void stageTwoPostAgentConnect()
- Template method called after the bots were connected.