mesa-examples icon indicating copy to clipboard operation
mesa-examples copied to clipboard

fix(bank-reserves): migrate to SpaceRenderer and AgentPortrayalStyle

Open abhinavk0220 opened this issue 7 months ago • 0 comments

Summary

  • Replaces the deprecated dict-based agent_portrayal with AgentPortrayalStyle (fixes the deprecation warning reported in #318)
  • Migrates from the old make_space_component API to the new SpaceRenderer.setup_agents() pattern, consistent with other updated examples in the repo
  • Simplifies the color-classification logic in person_portrayal (removed a redundant branch that reset to MID_COLOR)
  • Updates Readme.md to remove references to removed Mesa APIs (MultiGrid, ModularServer, BatchRunner) and replace with current equivalents (OrthogonalMooreGrid, SolaraViz/SpaceRenderer, batch_run)

Closes #318

Test plan

  • [ ] solara run app.py runs without deprecation warnings
  • [ ] Agents render correctly (rich = green, poor = red, middle = blue)
  • [ ] Sliders update the model parameters correctly
  • [ ] Line plot shows Rich/Poor/Middle Class trends over time
  • [ ] python batch_run.py completes without error

🤖 Generated with Claude Code

abhinavk0220 avatar Apr 14 '26 07:04 abhinavk0220