# current_state()

The current state of the agent in the given condition

## Synopsis

```
current_state(condition-name)
```

## Description

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

## Parameters

`condition-name`

The name of a condition defined in the model.

## Returns

This function returns the index of the current state of 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.

The index of state State in condition COND can be referred to with the notation COND.State, so the value of this function can be compared for equality with the symbolic names of the states.

## Examples

```
if (current_state(INF) == INF.Exposed) then ...
```