Package trunk :: Package BIP :: Package SDE :: Module gillespie :: Class Model
[hide private]

Class Model

source code

Instance Methods [hide private]
 
__init__(self, vnames, rates, inits, tmat, propensity)
Class representing a Stochastic Differential equation.
source code
 
getStats(self) source code
 
run(self, method='SSA', tmax=10, reps=1, viz=False, serial=False)
Runs the model.
source code
 
GSSA(self)
Gillespie Direct algorithm
source code
Method Details [hide private]

__init__(self, vnames, rates, inits, tmat, propensity)
(Constructor)

source code 
Class representing a Stochastic Differential equation.
Parameters:
  • vnames - : list of strings
  • rates - : list of fixed rate parameters
  • inits - : list of initial values of variables. Must be integers
  • tmat - : Transition matrix; numpy array with shape=(len(inits),len(propensity))
  • propensity - : list of lambda functions of the form: lambda r,ini: some function of rates ans inits.

run(self, method='SSA', tmax=10, reps=1, viz=False, serial=False)

source code 
Runs the model.
Parameters:
  • method - : String specifying the solving algorithm. Currently only 'SSA'
  • tmax - : duration of the simulation.
  • reps - : Number of replicates.
  • viz - : Boolean. Whether to show graph of each replicate during simulation
  • serial - : Boolean. False to run replicate in parallel when more than one core is a vailable. True to run them serially (easier to debug).
Returns:
a numpy array of shape (reps,tmax,nvars)