set_age¶
Syntax¶
Parameters¶
agent-id- An expression that must evaluate to a valid ordinary agent ID.
age-expression- An expression that must evaluates to a numeric value.
Description¶
Set the agent's age in years to the integer part of the expression's value.
The agent is assigned a randomly selected birth date within the year.
An error occurs of the first argument does not evaluate to a valid agent ID.
Examples¶
In the following, the new agent is assigned a birthdate between 40 and 41 years prior to the current simulation date.
In the following, the new agent is ageless, meaning that its age will always
be reported as -1.