BaseCompartmentModel

compartment_model.BaseCompartmentModel()

Shared base-class for compartment models.

BaseCompartmentModel is an abstract class. In practice users will mostly use CompartmentModel for single-strata IPMs or CombinedCompartmentModel for multi-strata IPMs.

Attributes

compartments: Sequence[CompartmentDef]

The compartments of the model.

requirements: Sequence[AttributeDef]

The attributes required by the model.

quantities: Iterator[CompartmentDef | EdgeDef]

All quantities from the model, compartments then edges, in definition order.

symbols: ModelSymbols

The symbols which represent parts of this model.

transitions: Sequence[TransitionDef]

The transitions in the model.

events: Sequence[EdgeDef]

Iterate over all events in order.

requirements_dict: OrderedDict[AbsoluteName, AttributeDef]

The attributes required by this model.

num_compartments: int

The number of compartments in this model.

num_events: int

The number of distinct events (transitions) in this model.

strata: Sequence[str]

The names of the strata involved in this compartment model.

is_multistrata: bool

True if this compartment model is multistrata (False for single-strata).

select: QuantitySelector

Make a quantity selection from this IPM.

Methods

Name Description
diagram Render a diagram of this IPM, either by showing it with matplotlib (default) or by saving it to file as a png image.