antsim.impl
Class TimeExperiment

java.lang.Object
  |
  +--antsim.impl.TimeExperiment
All Implemented Interfaces:
Clearable, Experiment

public class TimeExperiment
extends Object
implements Experiment

This class implements an experiment in which the evolution through time of a simulation is shown. The experiment is repeated for a number of times specified by parameter Repetitions. Each experiment is composed of a number of iterations of the configured scenario; this number is specified using the parameter Iterations. When evaluated, this experiment returns statistics for each iteration of each repetitions, arranged as an array of arrays of statistcs objects.

Version:
$Revision: 1.5 $
Author:
Alberto Montresor

Field Summary
protected  Factory factory
          Factory used to instantiate objects
protected  boolean footprint
          If true, methods for the analysis of experiment footprint are invoked
protected  int iterations
          Number of iterations composing an experiment.
static String PAR_ITERATIONS
          String name of the parameter used to determine the number of iterations to be executed.
static String PAR_REPETITIONS
          String name of the parameter used to determine the number of repetitions to be executed.
static String PROP_FOOTPRINT
          String name of the Java property used to determine whether the the analyisis of the footprint is activated.
protected  int repetitions
          Number of repetions of this experiment.
protected  Scenario scenario
          Scenario on which evaluate the experiment
 
Fields inherited from interface antsim.Experiment
NAME
 
Constructor Summary
TimeExperiment(Factory factory, String name)
          Instantiates a new time experiment.
 
Method Summary
 void clear()
          Restores the object to its initial state.
 Object evaluate()
          Executes the evaluation of the current ant algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_FOOTPRINT

public static final String PROP_FOOTPRINT
String name of the Java property used to determine whether the the analyisis of the footprint is activated.

See Also:
Constant Field Values

PAR_REPETITIONS

public static final String PAR_REPETITIONS
String name of the parameter used to determine the number of repetitions to be executed.

See Also:
Constant Field Values

PAR_ITERATIONS

public static final String PAR_ITERATIONS
String name of the parameter used to determine the number of iterations to be executed.

See Also:
Constant Field Values

iterations

protected int iterations
Number of iterations composing an experiment. During a single iteration, method evaluate of the scenario associated to this experiment is evaluated.


repetitions

protected int repetitions
Number of repetions of this experiment. The experiment is repeated a certain number of times, in order to obtain mean values.


footprint

protected boolean footprint
If true, methods for the analysis of experiment footprint are invoked


factory

protected Factory factory
Factory used to instantiate objects


scenario

protected Scenario scenario
Scenario on which evaluate the experiment

Constructor Detail

TimeExperiment

public TimeExperiment(Factory factory,
                      String name)
Instantiates a new time experiment. Configuration parameters are read through the specified factory object.

Parameters:
factory - the factory to be used to read configuration arguments and to create other configurable objects
name - the name that is associated to this instance in the configuration file
Method Detail

clear

public void clear()
Restores the object to its initial state.

Specified by:
clear in interface Clearable

evaluate

public Object evaluate()
Executes the evaluation of the current ant algorithm. Returns an array of array of Stats objects containing the statistics collected during the simulation.

Specified by:
evaluate in interface Experiment