agent.get_prop

Agent Referenceboth

Read a property's value on the current agent. The simplest form returns the value at the current timestep. Add a negative offset to look back in time — useful for self-referential formulas where the new value depends on the old one. The return type matches the property's data type: a number for Number properties, true/false for Boolean, a string for everything else.

Signature

agent.get_prop(name) -> value
agent.get_prop(name, offset) -> value

Example

// Current value
let current_salary = agent.get_prop("salary");

// Last timestep's value
let prev_salary = agent.get_prop("salary", -1);

// 3% raise relative to last month
agent.get_prop("salary", -1) * 1.03