Skip to content

epymorph.simulator.basic.output

The simulation results for basic simulations.

RUMEType_co module-attribute

RUMEType_co = TypeVar(
    "RUMEType_co", covariant=True, bound=RUME[GeoScope]
)

The type of a RUME used to produce an Output.

Output dataclass

Output(
    rume: RUMEType_co,
    initial: NDArray[SimDType],
    visit_compartments: NDArray[SimDType],
    visit_events: NDArray[SimDType],
    home_compartments: NDArray[SimDType],
    home_events: NDArray[SimDType],
    data_mode: Literal["visit", "home"] = "visit",
)

Bases: TableRendererMixin, PlotRendererMixin, MapRendererMixin, Generic[RUMEType_co]

The output of a BasicSimulation run, including time series for compartment data and transition events for all locations.

Parameters:

  • rume (RUMEType_co) –

    The RUME used in the simulation that generated this output.

  • initial (NDArray[SimDType]) –

    The simulation's initial compartments by location and compartment.

  • visit_compartments (NDArray[SimDType]) –

    Compartment data collected in the node where individuals are visiting.

  • visit_events (NDArray[SimDType]) –

    Event data collected in the node where individuals are visiting.

  • home_compartments (NDArray[SimDType]) –

    Compartment data collected in the node where individuals reside.

  • home_events (NDArray[SimDType]) –

    Event data collected in the node where individuals reside.

See Also

epymorph.simulator.basic.basic_simulator.BasicSimulator which is the most common way to create an output.

rume instance-attribute

The RUME used in the simulation that generated this output.

initial instance-attribute

initial: NDArray[SimDType]

The simulation's initial compartments by location and compartment. Array of shape (N,C) where N is the number of locations, and C is the number of compartments

visit_compartments instance-attribute

visit_compartments: NDArray[SimDType]

Compartment data collected in the node where individuals are visiting. See compartments for more information.

visit_events instance-attribute

visit_events: NDArray[SimDType]

Event data collected in the node where individuals are visiting. See events for more information.

home_compartments instance-attribute

home_compartments: NDArray[SimDType]

Compartment data collected in the node where individuals reside. See compartments for more information.

home_events instance-attribute

home_events: NDArray[SimDType]

Event data collected in the node where individuals reside. See events for more information.

data_mode class-attribute instance-attribute

data_mode: Literal["visit", "home"] = field(default="visit")

Controls which data is returned by the compartments and events properties. Although you can access both data sets, it's helpful to have a default for things like our plotting and mapping tools. Defaults to "visit".

See data_by_visit and data_by_home to obtain an Output object that uses a different data mode.

data_by_visit cached property

data_by_visit: Output

Return an Output object that contains the same set of data, but uses 'visit' as the default data mode.

data_by_home cached property

data_by_home: Output

Return an Output object that contains the same set of data, but uses 'home' as the default data mode.

compartments property

compartments: NDArray[SimDType]

Compartment data by timestep, location, and compartment. Array of shape (S,N,C) where S is the number of ticks in the simulation, N is the number of locations, and C is the number of compartments.

events property

events: NDArray[SimDType]

Event data by timestep, location, and event. Array of shape (S,N,E) where S is the number of ticks in the simulation, N is the number of locations, and E is the number of events.

events_per_day property

events_per_day: NDArray[SimDType]

Returns this output's incidence from a per-tick value to a per-day value. Returns a shape (T,N,E) array, where T is the number of simulation days.

ticks_in_days property

ticks_in_days: NDArray[float64]

Create a series with as many values as there are simulation ticks, but in the scale of fractional days. That is: the cumulative sum of the simulation's tau step lengths across the simulation duration. Returns a shape (S,) array, where S is the number of simulation ticks.

dataframe property

dataframe: DataFrame

Returns the output data as a data frame, using the current data mode.