2.1.1.3.1.1. wc_sim.submodels.testing package¶
2.1.1.3.1.1.1. Submodules¶
2.1.1.3.1.1.2. wc_sim.submodels.testing.deterministic_simulation_algorithm module¶
A deterministic version of SSA for testing DynamicSubmodel and multialgorithmic simulation
- Author
Arthur Goldberg <Arthur.Goldberg@mssm.edu>
- Date
2019-10-15
- Copyright
2019, Karr Lab
- License
MIT
-
class
wc_sim.submodels.testing.deterministic_simulation_algorithm.
DsaSubmodel
(id, dynamic_model, reactions, species, dynamic_compartments, local_species_population, options=None)[source]¶ Bases:
wc_sim.submodels.dynamic_submodel.DynamicSubmodel
Init a
DsaSubmodel
The Deterministic Simulation Algorithm (DSA) is a deterministic version of the Stochastic Simulation Algorithm. Each reaction executes deterministically at the rate determined by its rate law, which is achieved by scheduling the next execution of a reaction when the reaction executes. E.g., if reaction R executes at time t and R’s rate law has a rate of r then, the next execution of R will occur at time t + 1/r.
-
event_handlers
= [(<class 'de_sim.event_message.ExecuteDsaReaction'>, 'handle_ExecuteDsaReaction_msgs')][source]¶
-
execute_dsa_reaction
(event)[source]¶ Handle a simulation event that contains an
ExecuteDsaReaction
message- Parameters
event (
Event
) – anEvent
to execute
:raises
DynamicMultialgorithmError:
if the reaction does not have sufficient reactants to execute:
-
handle_ExecuteDsaReaction_msgs
(event_or_events)[source]¶ Handle one or more simulation event(s) that contain an
ExecuteDsaReaction
messageReactions with the same rates will occur simultaneously and be superposed.
- Parameters
event_or_events (
obj
) – anEvent
to execute or a list ofEvent
to execute
:raises
DynamicMultialgorithmError:
if the reaction does not have sufficient reactants to execute:
-
init_before_run
()[source]¶ Send this DSA submodel’s initial events
Schedule initial reactions at time 1 / (2 rate) so that the linear approximation for the number of times a reaction with constant rate r has executed is y = rate x.
This method overrides a
DynamicSubmodel
method.
-