__timestep

Time Contextboth

The current timestep's index — 0 at the start of the scenario, 1 at the next step, and so on. Available as a scope variable inside every formula and act method. Useful for periodic logic ('once per year'), startup conditions, or any rule that depends on absolute time within the scenario.

Signature

__timestep : integer  (scope variable)

Example

// Apply annual raise on January (monthly steps)
if __timestep % 12 == 0 && __timestep > 0 {
    agent.get_prop("salary", -1) * 1.03
} else {
    agent.get_prop("salary", -1)
}