Lattice Microbes 2.5
This is for whole cell modeling
Loading...
Searching...
No Matches
jLM.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, name=None)
 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=[], 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 = {}
dict reaction_map = {}
dict reverse_reaction_map = {}
 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__()

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

Member Function Documentation

◆ _repr_html_()

jLM.CME.CMESimulation._repr_html_ ( self)
protected

◆ addConcentration()

jLM.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()

jLM.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()

jLM.CME.CMESimulation.addReaction ( self,
reactant,
product,
rate,
name = None )
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
            name:
                Optional name to identify the reaction

◆ buildReactionModel()

jLM.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()

jLM.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, 
        or string, if only one species is being added

◆ run()

jLM.CME.CMESimulation.run ( self,
filename,
method,
replicates = 1,
seed = None,
cudaDevices = [],
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
            cudaDevices:
                The index list of CUDA devices
            checkpointInterval:
                The time interval between check points
Here is the call graph for this function:

◆ runMPI()

jLM.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()

jLM.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()

jLM.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()

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

Args:
    time: 
        Time length between hook calls

◆ setRandomSeed()

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

Args:
    seed:
        Random seed

◆ setSimulationTime()

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

Args:
    time:
        Time length of the simulation

◆ setTimestep()

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

◆ setWriteInterval()

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

Member Data Documentation

◆ filename

jLM.CME.CMESimulation.filename = None

◆ initial_counts

dict jLM.CME.CMESimulation.initial_counts = {}

◆ name

jLM.CME.CMESimulation.name = name

◆ parameters

jLM.CME.CMESimulation.parameters = {}

◆ particleMap

dict jLM.CME.CMESimulation.particleMap = {}

◆ reaction_map

dict jLM.CME.CMESimulation.reaction_map = {}

◆ reactions

jLM.CME.CMESimulation.reactions = []

◆ replicates

jLM.CME.CMESimulation.replicates = []

◆ reverse_reaction_map

dict jLM.CME.CMESimulation.reverse_reaction_map = {}

◆ species_id

jLM.CME.CMESimulation.species_id = []

◆ volume

jLM.CME.CMESimulation.volume = volume

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