Simulationsfehler und -warnungen diagnostizieren
FortgeschrittenDiagnosing Simulation Errors and Warnings
When a formula doesn't compute the way you expect, an act method misbehaves, or you've accidentally created a circular dependency, the Scenario Diagnostics is where you go. It's a single tab that answers the question "is this scenario healthy?".
Where to find it
- Select a Scenario in the Tree View
- Open the Properties Panel
- Switch to the Diagnostics tab
The tab is empty when everything is fine. As issues appear, they're grouped into sections so you can fix them one category at a time.
What you'll see
Cycles. Circular formula references — org.team_cost → team_a.cost → team_a.personnel_cost → org.team_cost. Each row shows the chain so you can follow the loop and decide where to break it. Common cause: two properties that read each other's current value. Common fix: use agent.get_prop("x", -1) on one side to read the previous timestep instead.
Unresolved references. Formulas that reference a property or relationship name the engine can't resolve — typo, renamed property, deleted relationship type. The engine falls back to baseline values for these, which can lead to surprising results until you fix them.
Runtime warnings. Errors that happened during the most recent simulation run: divide by zero, NaN or infinity, type mismatches. Each warning lists the agent, the timestep, and the formula or act method that produced it.
Authoring errors. Syntax errors and unknown name references in your formulas and act methods, aggregated so you can see every broken script in one place.
A useful workflow
- Cycles first. They cause every dependent property to fall back to baseline values, masking other problems. Break the cycle and rerun.
- Authoring errors next. Anything broken at parse time needs to be fixed before runtime warnings can be trusted.
- Then runtime warnings. Once formulas compile cleanly, runtime issues are usually localized and easier to track down.
- Unresolved references last. Often these are intentional and can stay; promote them to a structured pattern only if they're causing trouble.
Tips
- A scenario can be partially healthy. Sections are independent, so you can ship a working part of the simulation while you work on a problematic part.
- The diagnostics tab only shows issues for the currently selected scenario. If you have multiple scenarios with different overrides, switch to each one in turn.
Next steps
- Writing Property Formulas — getting formulas right the first time
- Writing Act Methods — when single-property formulas aren't enough
- Reading Connected Agents in Rhai — graph traversal patterns