mesa-examples
mesa-examples copied to clipboard
fix(bank-reserves): migrate to SpaceRenderer and AgentPortrayalStyle
Summary
- Replaces the deprecated dict-based
agent_portrayalwithAgentPortrayalStyle(fixes the deprecation warning reported in #318) - Migrates from the old
make_space_componentAPI to the newSpaceRenderer.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 toMID_COLOR) - Updates
Readme.mdto 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.pyruns 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.pycompletes without error
🤖 Generated with Claude Code