pyLM  v1.1
A Python Problem Solving Environment for the simulation of stochastic biological systems
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
pyLM.CME.CMESimulation Class Reference

A CME simulation that contains reactions and species. More...

Public Member Functions

def __init__
 A constructor fo the CMESimulation. More...
 
def defineSpecies
 Define a specie/s of particles that exist in the simulation. More...
 
def addParticles
 Add a specified number of particles of the specified type to the specified region. More...
 
def addConcentration
 Add a concentration of particles of the specified type to the simulation. More...
 
def addReaction
 Adds a 0th, 1st or 2nd order reaction. More...
 
def buildReactionModel
 Return the Lattice Microbes ReactionModel object for fine-tuning. More...
 
def setRandomSeed
 
def setWriteInterval
 Set the simulation state write-to-disk interval. More...
 
def setSimulationTime
 Set the total simulation time. More...
 
def setTimestep
 
def save
 Create an HDF5 version of the simulation amenable for later running or stand-alone running. More...
 
def run
 Run the simulation using the specified solver the specified amount of time. More...
 
def runMPI
 Run the simulation using a call to mpirun with the given options. More...
 
def runSolver
 

Public Attributes

 particleMap
 
 species_id
 
 initial_counts
 
 reactions
 
 parameters
 
 volume
 
 name
 
 replicates
 
 filename
 

Detailed Description

A CME simulation that contains reactions and species.

Constructor & Destructor Documentation

def pyLM.CME.CMESimulation.__init__ (   self,
  volume = None,
  name = "unnamed" 
)

A constructor fo the CMESimulation.

Parameters
volumeThe reaction vessel volume (in Litres). Specifying 'None' signifies that the user has already accounted for volume in rate constants.
nameThe name of the CME simulation; Default: "unnamed"
Returns
self

Member Function Documentation

def pyLM.CME.CMESimulation.addConcentration (   self,
  species = 'unknown',
  conc = 0.0 
)

Add a concentration of particles of the specified type to the simulation.

Parameters
self
speciesThe name of the specie to add
concentrationThe concentration of the species (Molar). Particle count is rounded to nearest integer.
Exceptions
Anerror if the volume is not specified
def pyLM.CME.CMESimulation.addParticles (   self,
  species = 'unknown',
  count = 1 
)

Add a specified number of particles of the specified type to the specified region.

Parameters
self
speciesThe name of the specie to add particles to
countThe number of that particle to start with (default 1)
def pyLM.CME.CMESimulation.addReaction (   self,
  reactant,
  product,
  rate 
)

Adds a 0th, 1st or 2nd order reaction.

Parameters
self
reactantThe list or reactants
productThe list of products
rateThe rate of reaction
def pyLM.CME.CMESimulation.buildReactionModel (   self)

Return the Lattice Microbes ReactionModel object for fine-tuning.

Parameters
self
Returns
The reaction model for the simulation
def pyLM.CME.CMESimulation.defineSpecies (   self,
  species 
)

Define a specie/s of particles that exist in the simulation.

Parameters
self
speciesA list of species to add to the simulation
def pyLM.CME.CMESimulation.run (   self,
  filename,
  method,
  replicates = 1,
  seed = None 
)

Run the simulation using the specified solver the specified amount of time.

Parameters
self
filenameThe HDF file to write to
methodThe class name for the solver to use (e.g., lm::cme::GillespieDSolver")
replicatesThe number of replicates to serially run
seedA seed for the random number generator to use when running the simulation; None indicates default
def pyLM.CME.CMESimulation.runMPI (   self,
  filename,
  method,
  replicates = 1,
  driver = "mpirun",
  ppe = 1,
  seed = None 
)

Run the simulation using a call to mpirun with the given options.

Parameters
self
filenameThe HDF file to write to
methodThe class name for the solver to use (e.g., lm::cme::GillespieDSolver")
replicatesThe number of replicates to serially run
driverThe program to execute the parallel run, e.g. "mpirun", "aprun", "ibrun", etc.
ppeThe number of processing elements to use
seedA seed for the random number generator to use when running the simulation; None indicates default
def pyLM.CME.CMESimulation.runSolver (   self,
  filename,
  solver,
  replicates = 1 
)
def pyLM.CME.CMESimulation.save (   self,
  filename 
)

Create an HDF5 version of the simulation amenable for later running or stand-alone running.

Parameters
self
filenameThe filename to save the simulation setup in
def pyLM.CME.CMESimulation.setRandomSeed (   self,
  seed 
)
def pyLM.CME.CMESimulation.setSimulationTime (   self,
  time 
)

Set the total simulation time.

Parameters
self
timeTime length of the simulation
def pyLM.CME.CMESimulation.setTimestep (   self,
  time 
)
def pyLM.CME.CMESimulation.setWriteInterval (   self,
  time 
)

Set the simulation state write-to-disk interval.

Parameters
self
timeTime length between writes

Member Data Documentation

pyLM.CME.CMESimulation.filename
pyLM.CME.CMESimulation.initial_counts
pyLM.CME.CMESimulation.name
pyLM.CME.CMESimulation.parameters
pyLM.CME.CMESimulation.particleMap
pyLM.CME.CMESimulation.reactions
pyLM.CME.CMESimulation.replicates
pyLM.CME.CMESimulation.species_id
pyLM.CME.CMESimulation.volume

The documentation for this class was generated from the following file: