3.1.2. de_sim.examples package¶
3.1.2.1. Subpackages¶
3.1.2.2. Submodules¶
3.1.2.3. de_sim.examples.debug_logs module¶
Setup simulation example configuration
- Author
Arthur Goldberg <Arthur.Goldberg@mssm.edu>
- Date
2016-10-03
- Copyright
2016-2020, Karr Lab
- License
MIT
3.1.2.4. de_sim.examples.minimal_simulation module¶
A minimal simulation, containing one simulation object.
- Author
Arthur Goldberg <Arthur.Goldberg@mssm.edu>
- Date
2018-02-27
- Copyright
2018-2020, Karr Lab
- License
MIT
-
class
de_sim.examples.minimal_simulation.
MinimalSimulationObject
(name, delay)[source]¶ Bases:
de_sim.simulation_object.SimulationObject
SimulationObject
subclasses represent the state of a simulation and the actions that schedule and handle events
3.1.2.5. de_sim.examples.phold module¶
Parallel hold (PHOLD) model commonly used to benchmark parallel discrete-event simulators
- Author
Arthur Goldberg <Arthur.Goldberg@mssm.edu>
- Date
2016-06-10
- Copyright
2016-2020, Karr Lab
- License
MIT
-
class
de_sim.examples.phold.
PholdSimulationObject
(name, args)[source]¶ Bases:
de_sim.simulation_object.SimulationObject
-
event_handlers
= [(<class 'de_sim.event_message.MessageSentToSelf'>, 'handle_simulation_event'), (<class 'de_sim.event_message.MessageSentToOtherObject'>, 'handle_simulation_event'), (<class 'de_sim.event_message.InitMsg'>, 'handle_simulation_event')][source]¶
-
3.1.2.6. de_sim.examples.random_walk module¶
Simulate a random walk whose position changes by -1 or +1 at each event, and inter-event delays are 1 or 2 time units
- Author
Arthur Goldberg <Arthur.Goldberg@mssm.edu>
- Date
2018-02-27
- Copyright
2018-2020, Karr Lab
- License
MIT
-
class
de_sim.examples.random_walk.
RandomWalkSimulationObject
(name)[source]¶ Bases:
de_sim.simulation_object.SimulationObject
A one-dimensional random walk model, with random times between steps
Each step moves either -1 or +1, with equal probability. The delay between steps is 1 or 2, also with equal probability.
-
event_handlers
= [(<class 'de_sim.event_message.RandomStepMessage'>, <function RandomWalkSimulationObject.handle_step_event>)][source]¶
-
3.1.2.7. de_sim.examples.sirs module¶
Example DE-Sim implementations of stochastic Susceptible, Infectious, or Recovered (SIR) epidemic models
- Author
Arthur Goldberg <Arthur.Goldberg@mssm.edu>
- Date
2020-07-08
- Copyright
2020, Karr Lab
- License
MIT
-
class
de_sim.examples.sirs.
AccessSIRObjectState
(sir)[source]¶ Bases:
de_sim.simulation_checkpoint_object.AccessStateObjectInterface
Get the state of an SIR object
-
class
de_sim.examples.sirs.
RunSIRs
(checkpoint_dir)[source]¶ Bases:
object
-
class
de_sim.examples.sirs.
SIR
(name, s, i, N, beta, gamma, recording_period)[source]¶ Bases:
de_sim.simulation_object.SimulationObject
Implement a Susceptible, Infectious, or Recovered (SIR) epidemic model
This example uses DE-Sim to implement a continuous-time Markov chain (CTMC) SIR epidemic model, as described in section 3 of Allen (2017).
Allen, L.J., 2017. A primer on stochastic epidemic models: Formulation, numerical simulation, and analysis. Infectious Disease Modelling, 2(2), pp.128-142.
-
event_handlers
= [(<class 'de_sim.event_message.SusceptibleToInfectious'>, 'handle_s_to_i'), (<class 'de_sim.event_message.InfectiousToRecovered'>, 'handle_i_to_r')][source]¶
-
handle_i_to_r
(event)[source]¶ Handle an infectious to recovered event
- Parameters
event (
Event
) – simulation event; not used
-
handle_s_to_i
(event)[source]¶ Handle a susceptible to infectious event
- Parameters
event (
Event
) – simulation event; not used
-
-
class
de_sim.examples.sirs.
SIR2
(name, s, i, N, beta, gamma, recording_period)[source]¶ Bases:
de_sim.examples.sirs.SIR
Version 2 of an SIR epidemic model
SIR2 is similar to SIR, but uses one event message type for both transitions, and a single message handler to process transition events.
-
event_handlers
= [(<class 'de_sim.event_message.TransitionMessage'>, 'handle_state_transition')][source]¶
-