import mesa
# You can either define the BoltzmannWealthModel (aka MoneyModel) or install mesa-models:
from mesa_models.boltzmann_wealth_model.model import BoltzmannWealthModel
def agent_portrayal(agent):
return {
"color": "tab:blue",
"size": 50,
}
model_params = {
"N": {
"type": "SliderInt",
"value": 50,
"label": "Number of agents:",
"min": 10,
"max": 100,
"step": 1,
},
"width": 10,
"height": 10,
}
from mesa.experimental import JupyterViz
page = JupyterViz(
BoltzmannWealthModel,
model_params,
measures=["Gini"],
name="Money Model",
agent_portrayal=agent_portrayal,
)
# This is required to render the visualization in the Jupyter notebook
page