public class GibsonBruckSimulator extends Simulator
GillespieSimple):
In order to do that the perspective of viewing the simulators time has to be changed from relative to absolute. As a consequence, a new random number has to be drawn for each reaction whose propensity has changed by a firing. To avoid this inefficient permanent discarding of random numbers (drawing a random number is a time expensive operation) Gibson and Bruck developed a method for reusing unused random numbers.
One pitfall remains: What happens, when a propensity decreases to 0 and after a time
ceases to be 0. Then the propensity from the pre-0 state can be reused which is tricky
to implement. Some implementations (including Dizzy) just draw a new random number which
is always valid but slow. Actually may these extra random numbers spoil the whole
improvement of the indexed priority queue in certain networks and it would be faster to
use the Direct method with the dependency graph (as in GillespieEnhanced ).
For reference see M.A.Gibson and J.Bruck, Efficient Exact Stochastic Simulation of Chemical Systems with Many Species and Many Channels, J.Phys.Chem.A., Vol 104, no 9, 2000
GillespieSimple,
GillespieEnhanced,
DependencyGraph,
IndexedPriorityQueueSimulator.FireType| Constructor and Description |
|---|
GibsonBruckSimulator(Network net) |
| Modifier and Type | Method and Description |
|---|---|
String |
getName()
Gets the name of the algorithm.
|
void |
initialize()
Initializes the algorithm:
set t=0reset the
AmountManagerrecalculate the propensities
Gets called at the very beginning of start |
void |
performStep(SimulationController control)
Performs one simulation step.
|
void |
reinitialize()
Reset propensities when a event has been executed.
|
void |
setAmount(int species,
long amount)
Sets the amount of the given species.
|
void |
setVolume(double volume)
Sets the volume of the reaction network.
|
addObserver, getAmount, getNet, getNextThetaEvent, getPropensity, getPropensityCalculator, getTime, getVolume, initializePropensities, isInterpolateTheta, postRun, preRun, registerNewTheta, run, setInterpolateTheta, setStochasticSeed, start, startpublic GibsonBruckSimulator(Network net)
public void reinitialize()
Simulatorreinitialize in class Simulatorpublic void performStep(SimulationController control)
SimulatorSimulator.setAmount(int, long)
and Simulator.setVolume(double) if they need correct values!performStep in class Simulatorcontrol - the simulators controllerpublic void initialize()
SimulatorAmountManagerstartinitialize in class Simulatorpublic String getName()
Simulatorpublic void setVolume(double volume)
Simulatorpublic void setAmount(int species,
long amount)
SimulatorsetAmount in class Simulatorspecies - species indexamount - amount of speciesAmountManager.setAmount(int, long)Copyright © 2007–2021. All rights reserved.