Closed
Description
The Sugerscape_g1mt app.py is missing any input Model Params (like Sliders etc.) to play with in the visualisation.
mesa/mesa/examples/advanced/sugarscape_g1mt/app.py
Lines 49 to 52 in a04e20b
I tried to add these:
model_params = {
# Grid parameters
"width": Slider("Grid Width", value=50, min=20, max=100, step=10),
"height": Slider("Grid Height", value=50, min=20, max=100, step=10),
# Population parameters
"initial_population": Slider("Initial Population", value=200, min=50, max=500, step=10),
# Agent endowment parameters
"endowment_min": Slider("Min Initial Endowment", value=25, min=5, max=30, step=1),
"endowment_max": Slider("Max Initial Endowment", value=50, min=30, max=100, step=1),
# Metabolism parameters
"metabolism_min": Slider("Min Metabolism", value=1, min=1, max=3, step=1),
"metabolism_max": Slider("Max Metabolism", value=5, min=3, max=8, step=1),
# Vision parameters
"vision_min": Slider("Min Vision", value=1, min=1, max=3, step=1),
"vision_max": Slider("Max Vision", value=5, min=3, max=8, step=1),
# Trade parameter
"enable_trade": {"type": "Checkbox", "value": True, "label": "Enable Trading"},
}
But modifying things lead to all kinds of error and unexpected behavior. For example, changing the width only did so partially (and apparently the height instead of the width):
I suspect that's due to the model first being initialized (with model1 = SugarscapeG1mt()
), and then the slider value being modified.
CC @Corvince