Skip to content

state

Syntax

condition <condition-name> {
    ...
    state <state-name> {
        # logic for the state
    }
}

Parameters

<condition-name>
The name of the condition.
<state-name>
The name for the state.

Description

The state block defines a state within a condition. Each agent occupies exactly one state within each condition at any time, and each condition can define any number of states.

A state block defines three types of statements:

  1. The actions an agent performs when it enters the state;
  2. The duration of time the agent spends in the state; and
  3. The transition rules that determine which state the agent occupies next.

Examples

Here is an example of a partial INFLUENZA condition with two states defined.

condition INFLUENZA {
    . . .

    state Susceptible {
        INFLUENZA.sus = 1
        wait()
        next()
    }

    state Exposed {
        INFLUENZA.sus = 0
        wait(24 * lognormal(1.9, 1.23))
        next(InfectiousAsymptomatic) with prob(0.33)
        default(InfectiousSymptomatic)
    }

    . . .
}

See Also