Fix emperor_dilemma: resolve relative imports and update SpaceRenderer API
Fixes #337
The emperor_dilemma example was broken and could not be run due to two issues:
-
Relative imports across app.py, model.py, and agents.py were incompatible with how Solara loads example modules. Changed to absolute imports.
-
SpaceRenderer.setup_agents() no longer exists in the current Mesa API. Updated to use the current .render(agent_portrayal=...) pattern, consistent with other examples like rumormill.
-
Applied ruff formatting fixes.
The example now runs correctly.
The absolute imports are required for Solara to run the example locally (solara run app.py). Relative imports break Solara's module loading. Looking for guidance on how other examples handle this CI/Solara conflict.
I really can't understand the motive of this PR.
The example now runs correctly.
Tests are failing
Hey! I'm also a GSoC 2026 candidate working on mesa-examples — I've been working on the Emperor's Dilemma model too so I noticed your PR. My PR #443 extends it with WhistleblowerAgent and a belief gap metric. Would you be open to reviewing it in return? Happy to review yours as well!