epymorph.simulator.basic.ipm_exec
IPMExecutor is part of the internal workings of BasicSimulator, implementing the
logic for processing the IPM phase of the simulation. Most users will not use this
module directly.
CompiledTransition
module-attribute
CompiledTransition = CompiledEdge | CompiledFork
A transition is either a fork or a plain edge.
Result
Bases: NamedTuple
The result from executing a single IPM step.
visit_compartments
instance-attribute
visit_compartments: SimArray
updated compartments as a result of these events (an (N,C) array) tracked by the location where the individuals currently are
visit_events
instance-attribute
visit_events: SimArray
events that happened this tick (an (N,E) array) tracked by the location where the event occurred
home_compartments
instance-attribute
home_compartments: SimArray
updated compartments as a result of these events (an (N,C) array) tracked by the location that the individuals consider home
home_events
instance-attribute
home_events: SimArray
events that happened this tick (an (N,E) array) tracked by the home location of the individuals effected
CompiledEdge
dataclass
Lambdified EdgeDef (no fork). Effectively: poisson(rate * tau).
CompiledFork
dataclass
CompiledFork(
size: int,
rate_lambda: SympyLambda,
prob_lambda: SympyLambda,
)
Lambdified ForkDef. Effectively: multinomial(poisson(rate * tau), prob).
IPMExecutor
IPMExecutor(
rume: RUME,
world: World,
data: DataResolver,
rng: Generator,
)
The standard implementation of compartment model IPM execution.
Parameters:
-
rume(RUME) –The RUME.
-
world(World) –The world state.
-
data(DataResolver) –The evaluated data attributes of the simulation.
-
rng(Generator) –The simulation RNG.