Skip to content

epymorph.simulator.basic.basic_simulator

Implements BasicSimulator: an epymorph simulation algorithm for performing single run, forward simulations.

RUMEType module-attribute

RUMEType = TypeVar('RUMEType', bound=RUME)

A type of RUME.

BasicSimulator

BasicSimulator(rume: RUMEType)

Bases: Generic[RUMEType]

A simulator for running singular simulation passes and producing time-series output. The most basic simulator.

This class is generic in the type of RUME used to create it (RUMEType).

Parameters:

  • rume (RUMEType) –

    The rume to use for the simulation.

ipm_exec instance-attribute

ipm_exec: IPMExecutor

The class responsible for executing disease simulation.

mm_exec instance-attribute

The class responsible for executing movement simulation.

rume instance-attribute

rume: RUMEType = rume

The RUME to use for the simulation.

run

run(
    params: CovariantMapping[str | NamePattern, ParamValue]
    | None = None,
    rng_factory: Callable[[], Generator] | None = None,
) -> Output[RUMEType]

Run a forward simulation on the RUME and produce one realization (output).

Parameters:

  • params (CovariantMapping[str | NamePattern, ParamValue] | None, default: None ) –

    The set of parameters to override for the sake of this run. Specified as a dictionary of name/value pairs, where values can be in any form normally allowed for the construction of a RUME. Any parameter not overridden uses the value from the RUME.

  • rng_factory (Callable[[], Generator] | None, default: None ) –

    A function used to construct the random number generator for this run. This can be used to provide a seeded random number generator if consistent results are desired. By default BasicSimulator creates a new random number generator for each run, using numpy's default rng logic.

Returns: