fern.benchmark
Class SimulatorPerformance

java.lang.Object
  extended by fern.benchmark.Benchmark
      extended by fern.benchmark.SimulatorPerformance
Direct Known Subclasses:
SimulatorCorrectness, SimulatorTime

public abstract class SimulatorPerformance
extends Benchmark

Measures the performance of the different simulation algorithms for a given network. This is the base class for different benchmarks and manages the simulators, the iteration of the simulators and when results have to be presented. You just have to implement present and getController and add some Observers to the simulators.

Author:
Florian Erhard

Constructor Summary
SimulatorPerformance(Network net)
          Registers the six built-in simulators for the performance benchmarks.
 
Method Summary
 void benchmark()
          Performs one benchmark for each of the six simulators.
 int getShowSteps()
          Gets the number of iterations between two present-calls.
 Simulator[] getSimulators()
          Gets the simulators used by this benchmark.
 void setShowSteps(int showSteps)
          Sets the number of iterations between two present-calls.
 
Methods inherited from class fern.benchmark.Benchmark
addData, clearData, createRandomDoubleArray, end, getNumBins, setNumBins, start, toGnuplot, toGnuplot, toGnuPlotAsHistogram, toGnuPlotAsHistogram
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimulatorPerformance

public SimulatorPerformance(Network net)
Registers the six built-in simulators for the performance benchmarks.

Parameters:
net - the network to benchmark
See Also:
GillespieSimple, GillespieEnhanced, GibsonBruckSimulator, TauLeapingAbsoluteBoundSimulator, TauLeapingRelativeBoundSimulator, TauLeapingSpeciesPopulationBoundSimulator
Method Detail

benchmark

public void benchmark()
Performs one benchmark for each of the six simulators. To minimize effects that could compromise time benchmarks like caching, the order of the simulators is randomized each time. The time needed for each algorithm is recorded and added to Benchmark's data pool. After each getShowSteps() iterations, present is called.

See Also:
Benchmark.addData(double[])

getShowSteps

public int getShowSteps()
Gets the number of iterations between two present-calls.

Returns:
the showSteps

setShowSteps

public void setShowSteps(int showSteps)
Sets the number of iterations between two present-calls.

Parameters:
showSteps - the showSteps to set

getSimulators

public Simulator[] getSimulators()
Gets the simulators used by this benchmark.

Returns:
simulators.