Lattice Microbes 2.5
This is for whole cell modeling
Loading...
Searching...
No Matches
pyLM.CME.CMESimulation Class Reference

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

Public Member Functions

 __init__ (self, volume=None, name="unnamed")
 defineSpecies (self, species)
 addParticles (self, species='unknown', count=1)
 addConcentration (self, species='unknown', conc=0.0)
 addReaction (self, reactant, product, rate)
 buildReactionModel (self)
 setRandomSeed (self, seed)
 setWriteInterval (self, time)
 setHookInterval (self, time)
 setSimulationTime (self, time)
 setTimestep (self, time)
 save (self, filename)
 run (self, filename, method, replicates=1, seed=None, cudaDevices=None, checkpointInterval=0)
 runMPI (self, filename, method, replicates=1, driver="mpirun", ppe=1, seed=None)
 runSolver (self, filename, solver, replicates=1, cudaDevices=None, checkpointInterval=0)

Public Attributes

dict particleMap = {}
list species_id = []
dict initial_counts = {}
list reactions = []
dict parameters = {}
 volume = volume
 name = name
list replicates = []
 filename = None

Protected Member Functions

 _repr_html_ (self)

Detailed Description

A CME simulation that contains reactions and species.

A constructor for the CMESimulation

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

Constructor & Destructor Documentation

◆ __init__()

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

Member Function Documentation

◆ _repr_html_()

pyLM.CME.CMESimulation._repr_html_ ( self)
protected
Here is the call graph for this function:

◆ addConcentration()

pyLM.CME.CMESimulation.addConcentration ( self,
species = 'unknown',
conc = 0.0 )
Add a concentration of particles of the specified type to the simulation

Args:
    species: 
        The name of the specie to add

    concentration: 
        The concentration of the species (Molar).  Particle count is rounded to nearest integer.

◆ addParticles()

pyLM.CME.CMESimulation.addParticles ( self,
species = 'unknown',
count = 1 )
Add a specified number of particles of the specified type to the  specified region

Args:
    species: 
        The name of the specie to add particles to

    count:
        The number of that particle to start with (default 1)

◆ addReaction()

pyLM.CME.CMESimulation.addReaction ( self,
reactant,
product,
rate )
Adds a 0th, 1st or 2nd order reaction

Reaction rates are specified as *stochastic* rates: i.e. in units of
:math:`1/\mathrm{s}`.

Args:
    reactant: 
        The list or reactants
    product:
        The list of products
    rate:
        The *stochastic* rate of reaction

◆ buildReactionModel()

pyLM.CME.CMESimulation.buildReactionModel ( self)
Return the Lattice Microbes ReactionModel object for fine-tuning

Returns:
    The reaction model for the simulation
Here is the caller graph for this function:

◆ defineSpecies()

pyLM.CME.CMESimulation.defineSpecies ( self,
species )
Define a species of particles that exist in the simulation

Args:
    species: 
        A list of species to add to the simulation

◆ run()

pyLM.CME.CMESimulation.run ( self,
filename,
method,
replicates = 1,
seed = None,
cudaDevices = None,
checkpointInterval = 0 )
Run the simulation using the specified solver the specified amount of time

Args:
    filename:
        The HDF file to write to
    method:
        The class name for the solver to use (e.g., lm::cme::GillespieDSolver")
    replicates:
        The number of replicates to serially run
    seed:
        A seed for the random number generator to use when running the simulation; None indicates default
Here is the call graph for this function:

◆ runMPI()

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

Args:
    filename:
        The HDF file to write to
    method:
        The class name for the solver to use (e.g. lm::cme::GillespieDSolver")
    replicates:
        The number of replicates to serially run
    driver:
        The program to execute the parallel run, e.g. "mpirun", "aprun", "ibrun", etc.
    ppe:
        The number of processing elements to use (e.g. number of nodes)
    seed:
        A seed for the random number generator to use when running the simulation; None indicates default

◆ runSolver()

pyLM.CME.CMESimulation.runSolver ( self,
filename,
solver,
replicates = 1,
cudaDevices = None,
checkpointInterval = 0 )
Run a simulation with a given solver

Args:
    filename:
        The HDF file to write to
    solver:
        An MESolver object
    replicates:
        The number of replicates to serially run
Here is the call graph for this function:

◆ save()

pyLM.CME.CMESimulation.save ( self,
filename )
Create an HDF5 version of the simulation amenable for later running or stand-alone running

Args:
    filename:
        The filename to save the simulation setup in
Here is the call graph for this function:

◆ setHookInterval()

pyLM.CME.CMESimulation.setHookInterval ( self,
time )
Set the simulation hook interval

Args:
    time: 
        Time length between hook calls

◆ setRandomSeed()

pyLM.CME.CMESimulation.setRandomSeed ( self,
seed )
Set a known random seed

Args:
    seed:
        Random seed

◆ setSimulationTime()

pyLM.CME.CMESimulation.setSimulationTime ( self,
time )
Set the total simulation time

Args:
    time:
        Time length of the simulation

◆ setTimestep()

pyLM.CME.CMESimulation.setTimestep ( self,
time )
set the simulation time step
Args:
    time:
        The length of simulation timestep for CME

◆ setWriteInterval()

pyLM.CME.CMESimulation.setWriteInterval ( self,
time )
Set the simulation state write-to-disk interval 
Args:
    time :
        Time length between writes

Member Data Documentation

◆ filename

pyLM.CME.CMESimulation.filename = None

◆ initial_counts

dict pyLM.CME.CMESimulation.initial_counts = {}

◆ name

pyLM.CME.CMESimulation.name = name

◆ parameters

pyLM.CME.CMESimulation.parameters = {}

◆ particleMap

dict pyLM.CME.CMESimulation.particleMap = {}

◆ reactions

pyLM.CME.CMESimulation.reactions = []

◆ replicates

pyLM.CME.CMESimulation.replicates = []

◆ species_id

pyLM.CME.CMESimulation.species_id = []

◆ volume

pyLM.CME.CMESimulation.volume = volume

The documentation for this class was generated from the following file:
  • /data2/LM_zls_github/Lattice-Microbes/src/pylm/pyLM/CME.py