Skip to content

variables

Syntax

variables {
    # One or more variable declarations.
    <scope> <variable_type> <variable_name>
}

Parameters

<scope>

The scope of the variable being declared. Valid values for scope are shared and agent.

Important

For agent-scoped variables, table and list_table variable types are currently disabled, as they would be extremely memory-intensive with fairly ordinary numbers of agents.

<variable_type>

The type of the variable being declared. Valid variable types are:

Important

For agent-scoped variables, table and list_table variable types are currently disabled, as they would be extremely memory-intensive with fairly ordinary numbers of agents.

<variable_name>
A name to give the newly declared variable. If multiple are present, they must be separated by a space. Variable names must start with a letter and contain no symbols.

Description

This block defines the names and initial values of variables.

Programs may contain more than one variables block. They are interpreted as a single block when the model file is processed.

Examples

This example declares a shared variable fever_temperature and an agent variable my_temperature.

variables {
    shared numeric fever_temperature
    agent numeric my_temperature
}

See Also