Skip to content

Commit

Permalink
Sugarscape G1MT: Update to Mesa 2.1.2 JupyterViz API
Browse files Browse the repository at this point in the history
  • Loading branch information
rht authored and Corvince committed Sep 26, 2023
1 parent 221c422 commit bb96487
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/sugarscape_g1mt/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from sugarscape_g1mt.trader_agents import Trader


def space_drawer(viz):
def space_drawer(model, agent_portrayal):
def portray(g):
layers = {
"sugar": [[np.nan for j in range(g.height)] for i in range(g.width)],
Expand All @@ -31,7 +31,7 @@ def portray(g):

fig = Figure()
ax = fig.subplots()
out = portray(viz.model.grid)
out = portray(model.grid)
# Sugar
# Important note: imshow by default draws from upper left. You have to
# always explicitly specify origin="lower".
Expand All @@ -42,7 +42,7 @@ def portray(g):
# Trader
ax.scatter(**out["trader"])
ax.set_axis_off()
solara.FigureMatplotlib(fig, dependencies=[viz.model, viz.df])
solara.FigureMatplotlib(fig)


model_params = {
Expand Down

0 comments on commit bb96487

Please sign in to comment.