antsim.impl
Class RangeExperiment

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

public class RangeExperiment
extends Object
implements Experiment

This class contains an implementation of experiment in which one of the simulation parameter, specified trough parameter ParameterName, has its value changed from a minimum value (parameter MinValue) to a maximum value (parameter MaxValue), with an increase specified by parameter Step. For each value of the variable parameter, the simulation is composed of a certain number of execution method evaluate() of a scenario; this number is specified by parameter Iterations.

Version:
$Revision: 1.4 $
Author:
Alberto Montresor

Field Summary
protected  boolean footprint
          If true, methods for the analysis of experiment footprint are invoked
protected  int iterations
          Number of times a scenario is evaluated
protected  int maxvalue
           
protected  int minvalue
           
static String PAR_ITERATIONS
          String name of the parameter used to determine the number of iterations to be executed.
static String PAR_MAXVALUE
          String name of the parameter used to determine the maximum value that has to be assigned to the ranged parameter.
static String PAR_MINVALUE
          String name of the parameter used to determine the minimum value that has to be assigned to the ranged parameter.
static String PAR_PARAMETERNAME
          String name of the parameter used to identify the name of the parameter whose value is ranged from a minimum value to a maximum value.
static String PAR_STEP
          String name of the parameter used to determine the step between two consecutive values to be assigned to the ranged parameter.
protected  String parameterName
          Identifier of the parameter to be set
static String PROP_FOOTPRINT
          String name of the Java property used to determine whether the the analyisis of the footprint is activated.
protected  Scenario scenario
          Scenario on which evaluate the experiment
protected  int step
           
 
Fields inherited from interface antsim.Experiment
NAME
 
Constructor Summary
RangeExperiment(Factory factory, String name)
          Instantiates a new RangeExperiment.
 
Method Summary
 void clear()
          Restores the object to its initial state.
 Object evaluate()
          Perform 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_PARAMETERNAME

public static final String PAR_PARAMETERNAME
String name of the parameter used to identify the name of the parameter whose value is ranged from a minimum value to a maximum value.

See Also:
Constant Field Values

PAR_MINVALUE

public static final String PAR_MINVALUE
String name of the parameter used to determine the minimum value that has to be assigned to the ranged parameter.

See Also:
Constant Field Values

PAR_MAXVALUE

public static final String PAR_MAXVALUE
String name of the parameter used to determine the maximum value that has to be assigned to the ranged parameter.

See Also:
Constant Field Values

PAR_STEP

public static final String PAR_STEP
String name of the parameter used to determine the step between two consecutive values to be assigned to the ranged parameter.

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

parameterName

protected String parameterName
Identifier of the parameter to be set


maxvalue

protected int maxvalue

minvalue

protected int minvalue

step

protected int step

iterations

protected int iterations
Number of times a scenario is evaluated


footprint

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


scenario

protected Scenario scenario
Scenario on which evaluate the experiment

Constructor Detail

RangeExperiment

public RangeExperiment(Factory factory,
                       String name)
Instantiates a new RangeExperiment. 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()
Perform the evaluation of the current ant algorithm. Returns a Stats array containing the statistics collected during the simulation.

In this implementation, a single Stats object is created and is used to collect statistics for all scenario executions performed by this Experiment.

Specified by:
evaluate in interface Experiment