Skip to content

epymorph.data.mm.icecube

IcecubeClause

Bases: MovementClause

The clause of the icecube model.

requirements class-attribute instance-attribute

requirements = (
    AttributeDef(
        "population",
        int,
        N,
        comment="The total population at each node.",
    ),
    AttributeDef(
        "commuter_proportion",
        float,
        Scalar,
        default_value=0.1,
        comment="The proportion of the total population which commutes.",
    ),
)

The attribute definitions describing the data requirements for this function.

For advanced use-cases, you may specify requirements as a property if you need it to be dynamically computed.

predicate class-attribute instance-attribute

predicate = EveryDay()

When does this movement clause apply?

leaves class-attribute instance-attribute

leaves = TickIndex(step=0)

On which tau step does this movement clause apply?

returns class-attribute instance-attribute

returns = TickDelta(step=1, days=0)

When do the movers from this clause return home?

evaluate

evaluate(tick: Tick) -> NDArray[int64]

Implement this method to provide logic for the clause. Use self methods and properties to access the simulation context or defer processing to another function.

Parameters:

  • tick (Tick) –

    The simulation tick being evaluated.

Returns:

  • NDArray[SimDType]

    An array describing the requested number of individuals to move from origin location (row; axis 0) to destination location (column; axis 1).

Icecube

Bases: MovementModel

A toy example: ice cube tray movement movement model Each state sends a fixed number of commuters to the next state in the line (without wraparound).

steps class-attribute instance-attribute

steps = (1 / 2, 1 / 2)

The length and order of tau steps.

clauses class-attribute instance-attribute

clauses = (IcecubeClause(),)

The movement clauses that make up the model.