net.sourceforge.cilib.simulator
Class MeasurementSuite

java.lang.Object
  extended by net.sourceforge.cilib.simulator.MeasurementSuite
All Implemented Interfaces:
Serializable

public class MeasurementSuite
extends Object
implements Serializable

The MeasurementSuite is essentially a collection of measurements.

Author:
Edwin Peer
See Also:
net.sourceforge.Measurement.Measurement, Serialized Form

Constructor Summary
MeasurementSuite()
          Creates a new instance of MeasurementSuite.
 
Method Summary
 void addMeasurement(Measurement measurement)
          Adds a measurement to the suite.
 String getFile()
          Get the current specified filename.
 SynchronizedOutputBuffer getOutputBuffer()
          Get the current SynchronizedOutputBuffer.
 int getResolution()
          Accessor for the resolution of the results.
 int getSamples()
          Accessor for the number of samples to take for each measurement.
 void initialise()
          Initialise the require output buffers for the MeasurementSuite.
 void measure(Algorithm algorithm)
          Measure the provided Algorithm.
 void setFile(String file)
          Sets the output file to record the measurements in.
 void setOutputBuffer(SynchronizedOutputBuffer buffer)
           
 void setResolution(int resolution)
          Sets the resolution of the results.
 void setSamples(int samples)
          Sets the number of samples to take for each measurement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MeasurementSuite

public MeasurementSuite()
Creates a new instance of MeasurementSuite.

Method Detail

initialise

public void initialise()
Initialise the require output buffers for the MeasurementSuite.


setFile

public void setFile(String file)
Sets the output file to record the measurements in.

Parameters:
file - The name of the output file.

getFile

public String getFile()
Get the current specified filename.

Returns:
The current file name.

setSamples

public void setSamples(int samples)
Sets the number of samples to take for each measurement. Each sample results in the experiment being performed again.

Parameters:
samples - The number of samples.

getSamples

public int getSamples()
Accessor for the number of samples to take for each measurement.

Returns:
The number of samples.

setResolution

public void setResolution(int resolution)
Sets the resolution of the results. The resolution determines how offen results are logged to file. If the resolution is 10 then results are logged every 10 iterations.

Parameters:
resolution - The result resolution.

getResolution

public int getResolution()
Accessor for the resolution of the results.

Returns:
The result resolution.

getOutputBuffer

public SynchronizedOutputBuffer getOutputBuffer()
Get the current SynchronizedOutputBuffer.

Returns:
The current buffer.

setOutputBuffer

public void setOutputBuffer(SynchronizedOutputBuffer buffer)

addMeasurement

public void addMeasurement(Measurement measurement)
Adds a measurement to the suite.

Parameters:
measurement - The measurement to be added.

measure

public void measure(Algorithm algorithm)
Measure the provided Algorithm. All the current measurements that are defined for the MeasurementSuite are applied to the Algorithm. Any measurements that are state aware instances will automatically have their internal state saved and restored as measurements are taken on the current Algorithm.

Parameters:
algorithm - The Algorithm to measure.


Copyright © 2009 CIRG. All Rights Reserved.