Skip to content

prev_state

Syntax

prev_state(condition-name)

Parameters

condition-name
The name of a condition defined in the model.

Returns

This action returns the index of the previous state of agent in the given condition.

Description

The states of each condition are numbered in the order they are defined in the model, with Start always numbered 0 and Excluded always the last state in the condition.

If the agent is in the Start state, then the value returned is 0.

If the agent is in the Excluded state, then the value returned is the index of the Excluded state. That is, once an agent reaches the Excluded state, no other history of the agent within the condition is available.

This action returns the index of the previous state of agent in the given condition.

See Also