forecast_from
Time ContextbothThe timestep index where the forecast starts, as set by the dashboard's time slider (Forecast from) — or () when there is no cutoff. Available in every formula and act method. Use it to show actual figures before the cutoff and simulated values from it on.
Signature
forecast_from() : integer or ()
Example
let f = forecast_from();
if f == () || __timestep < f {
agent.get_prop("actual_revenue") // history: the real figures
} else {
agent.get_prop("revenue", -1) * 1.02 // forecast: grow 2% per step
}This content was written collaboratively with AI.