cz.cuni.pogamut.experiments.util
Class BasicExperiment

java.lang.Object
  extended by cz.cuni.pogamut.experiments.AbstractExperimentHandle
      extended by cz.cuni.pogamut.experiments.Experiment
          extended by 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.


Nested Class Summary
static class BasicExperiment.StatResult
           
 
Field Summary
protected  Agent[] agents
           
protected  AgentStats[] stats
           
 
Fields inherited from class cz.cuni.pogamut.experiments.Experiment
experimentState, timeProvider, timer
 
Fields inherited from class cz.cuni.pogamut.experiments.AbstractExperimentHandle
exception, experimentRunningLatch, result, stateFlag
 
Constructor Summary
BasicExperiment(ExperimentDescriptor descriptor, UTServer server)
          Class returning results of the experiment back to a client.
 
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 cz.cuni.pogamut.experiments.AbstractExperimentHandle
getException, getResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cz.cuni.pogamut.experiments.ExperimentHandle
getException, getResult
 

Field Detail

agents

protected Agent[] agents

stats

protected AgentStats[] stats
Constructor Detail

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.

Method Detail

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.