fern.simulation.algorithm
Class GillespieSimple

java.lang.Object
  extended by fern.simulation.Simulator
      extended by fern.simulation.algorithm.GillespieSimple

public class GillespieSimple
extends Simulator

Implementation of Gillespie's Direct method. It is a simple Monte-Carlo algorithm which draws from a from Gillspie derived distribution a reaction that will fire and a time at which the reaction will fire.

For reference see Daniel T. Gillespie., A General Method for Numerically Simulating the Stochastic Time Evolution of Coupled Chemical Reactions, J.Comp.Phys. 22, 403 (1976)

Author:
Florian Erhard

Nested Class Summary
 
Nested classes/interfaces inherited from class fern.simulation.Simulator
Simulator.FireType
 
Constructor Summary
GillespieSimple(Network net)
           
 
Method Summary
 String getName()
          Gets the name of the algorithm.
 void performStep(SimulationController control)
          Performs one simulation step.
 void reinitialize()
          Reset propensities when a event has been executed.
 
Methods inherited from class fern.simulation.Simulator
addObserver, getAmount, getNet, getNextThetaEvent, getPropensity, getPropensityCalculator, getTime, getVolume, initialize, isInterpolateTheta, registerNewTheta, setAmount, setInterpolateTheta, setVolume, start, start
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GillespieSimple

public GillespieSimple(Network net)
Method Detail

reinitialize

public void reinitialize()
Description copied from class: Simulator
Reset propensities when a event has been executed.

Specified by:
reinitialize in class Simulator

performStep

public void performStep(SimulationController control)
Description copied from class: Simulator
Performs one simulation step. Between steps the terminating condition is checked. The simulators controller is passed, if an extending class wants to check it within one step. Implementing algorithms cannot be sure that the propensities are correct at the beginning of a step (e.g. if the volume changed). They should override Simulator.setAmount(int, long) and Simulator.setVolume(double) if they need correct values!

Specified by:
performStep in class Simulator
Parameters:
control - the simulators controller

getName

public String getName()
Description copied from class: Simulator
Gets the name of the algorithm.

Specified by:
getName in class Simulator
Returns:
name of the algorithm