Skip to content

current_state

Syntax

current_state(condition-name)

Parameters

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

Returns

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

Description

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

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.

Examples

if (current_state(MOOD) == get_state(MOOD, Happy)) {
    print("I'm happy!")
}

See Also