CombinedCompartmentModel

compartment_model.CombinedCompartmentModel(
    self,
    strata,
    meta_requirements,
    meta_edges,
)

A CompartmentModel constructed by combining others for use in multi-strata models. Typically you will not have to create a CombinedCompartmentModel directly. Building a MultiStrataRUME will combine the models for you.

Parameters

strata: Sequence[tuple[str, CompartmentModel]]

A list of pairs mapping strata names to the IPM for the strata. (Strata order is important, so we didn’t use a dict for this.)

meta_requirements: Sequence[AttributeDef]

Additional requirement definitions for use in the combined model’s meta edges.

meta_edges: MetaEdgeBuilder

A function which defines the combined model’s meta edges.

Attributes

compartments: Sequence[CompartmentDef]

All compartments; renamed with strata.

requirements: Sequence[AttributeDef]

All requirements, including meta-requirements.

quantities: Iterator[CompartmentDef | EdgeDef]

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

symbols: MultiStrataModelSymbols

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.

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.