age

The integer portion of the agent’s age in years.

Synopsis

age

Description

This factor evaluates to the age of the agent in years as an integer. This drops any decimal portion of the agent’s age in years.

Examples

Suppose an agent is \(33.75\) years old. In this case age evaluates to 33.

As a more interesting example, the following code defines a list containing a transmission value for each decade (0 to 9, 10 to 19, and so forth). The following lines would set the agent’s trans value to the appropriate value in the list, based on the agent’s age.

trans_by_decade = list(0.12, 0.23, 0.34, 0.35, 0.36, 0.37, 0.45, 0.46, 0.56, 0.67, 0.67)

# This assumes agents do not live post 110 years old
INFLUENZA.trans = trans_by_decade[age / 10)

If the agent is \(12.34\) (or \(12.98\)) years old`, then the above statements would set the trans property for the INFLUENZA condition to the value \(0.23\).

See Also

age_in_days, age_in_years