agent.has_prop

Agent Referenceboth

Check whether a property exists on the agent. Returns true if the property is defined on the agent's node type, false otherwise. Useful when working with optional properties or when writing formulas that adapt to different agent types in the same model.

Signature

agent.has_prop(name) -> bool

Example

if agent.has_prop("bonus") {
    agent.get_prop("salary") + agent.get_prop("bonus")
} else {
    agent.get_prop("salary")
}