Skip to content

laser.cohorts.SEI

SEI

SEI model component preset.

Assembles the Susceptible, Exposed, and Infectious compartments with SE-style transmission (S → E → I, no recovery) for use as a standalone SEI model.

Exposed

Exposed(model, r_progression, validating=False)

Exposed (E) compartment component.

Tracks individuals who are infected but not yet infectious. Applies non-disease mortality and progression from E to I each time step. Initial E counts are read from the scenario at setup.

Initialize the Exposed component.

Parameters:

Name Type Description Default
model Model

The parent model instance.

required
r_progression ValuesMap

Per-tick, per-node rate of progression from E to I.

required
validating bool

Enable validation checks during simulation.

False

properties property

properties

Return node properties required by this component.

Returns:

Type Description
list[PropertyType]

list[PropertyType]: [("newly_infectious", nticks, np.int32, 0)]

states property

states

Return the compartment state names managed by this component.

Returns:

Type Description
list[str]

list[str]: ["E", "I"]

end_step

end_step(tick)

No-op end-of-step hook for the E compartment.

Parameters:

Name Type Description Default
tick int

Current simulation tick (0-indexed).

required

setup

setup()

Initialize state E at tick 0 from the scenario E column.

start_step

start_step(tick)

No-op start-of-step hook; carry-forward is handled by the Model.

Parameters:

Name Type Description Default
tick int

Current simulation tick (0-indexed).

required

step

step(tick)

Apply disease progression to exposed individuals.

Draws newly infectious individuals from a binomial using r_progression, moving them from E to I and recording the flow in nodes.newly_infectious.

Parameters:

Name Type Description Default
tick int

Current simulation tick (0-indexed).

required

Infectious

Infectious(model, validating=False)

Infectious (I) compartment component.

Tracks the infectious population and applies non-disease mortality each time step. Initial I counts are read from the scenario at setup.

Initialize the Infectious component.

Parameters:

Name Type Description Default
model Model

The parent model instance.

required
validating bool

Enable validation checks during simulation.

False

properties property

properties

Return node properties required by this component.

Returns:

Type Description
list[PropertyType]

list[PropertyType]: Empty list; mortality tracking belongs to NonDiseaseMortality.

states property

states

Return the compartment state names managed by this component.

Returns:

Type Description
list[str]

list[str]: ["I"]

end_step

end_step(tick)

No-op end-of-step hook for the I compartment.

Parameters:

Name Type Description Default
tick int

Current simulation tick (0-indexed).

required

setup

setup()

Initialize state I at tick 0 from the scenario I column.

start_step

start_step(tick)

No-op start-of-step hook; carry-forward is handled by the Model.

Parameters:

Name Type Description Default
tick int

Current simulation tick (0-indexed).

required

step

step(tick)

No-op step hook for the I compartment.

Parameters:

Name Type Description Default
tick int

Current simulation tick (0-indexed).

required

Susceptible

Susceptible(model, validating=False)

Susceptible (S) compartment component.

Tracks the susceptible population and applies non-disease mortality each time step. Initial S counts are read from the scenario at setup.

Initialize the Susceptible component.

Parameters:

Name Type Description Default
model Model

The parent model instance.

required
validating bool

Enable validation checks during simulation.

False

properties property

properties

Return node properties required by this component.

Returns:

Type Description
list[PropertyType]

list[PropertyType]: Empty list; mortality tracking belongs to NonDiseaseMortality.

states property

states

Return the compartment state names managed by this component.

Returns:

Type Description
list[str]

list[str]: ["S"]

end_step

end_step(tick)

No-op end-of-step hook for the S compartment.

Parameters:

Name Type Description Default
tick int

Current simulation tick (0-indexed).

required

setup

setup()

Initialize state S at tick 0 from the scenario S column.

start_step

start_step(tick)

No-op start-of-step hook; carry-forward is handled by the Model.

Parameters:

Name Type Description Default
tick int

Current simulation tick (0-indexed).

required

step

step(tick)

No-op step hook for the S compartment.

Parameters:

Name Type Description Default
tick int

Current simulation tick (0-indexed).

required

Transmission

Transmission(
    model, beta, seasonality=None, validating=False
)

Bases: TransmissionCommon

Transmission component that moves individuals from S to E.

Specialises TransmissionCommon for models with an exposed/latent period (SEI, SEIR, SEIS, SEIRS). Newly infected individuals enter the E compartment before becoming infectious.

Initialize the S → E transmission component.

Parameters:

Name Type Description Default
model Model

The parent model instance.

required
beta ValuesMap

Per-tick, per-node transmission rate.

required
validating bool

Enable validation checks during simulation.

False

properties property

properties

Return node properties required by this component.

Returns:

Type Description
list[PropertyType]

list[PropertyType]: Parent properties plus ("newly_infected", nticks, np.int32, 0).

states property

states

Return the compartment state names managed by this component.

Returns:

Type Description
list[str]

list[str]: Parent states plus ["E"].