From e28db2d573a515b160fec33ad6e4b459272b7c07 Mon Sep 17 00:00:00 2001 From: rht Date: Mon, 8 Jan 2024 19:03:01 -0500 Subject: [PATCH] Boid flockers: Add Solara viz file --- examples/boid_flockers/app.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 examples/boid_flockers/app.py diff --git a/examples/boid_flockers/app.py b/examples/boid_flockers/app.py new file mode 100644 index 00000000..30b9fa28 --- /dev/null +++ b/examples/boid_flockers/app.py @@ -0,0 +1,25 @@ +from boid_flockers.model import BoidFlockers +from mesa.experimental import JupyterViz + + +def boid_draw(agent): + return {"color": "tab:red"} + + +model_params = { + "population": 100, + "width": 100, + "height": 100, + "speed": 5, + "vision": 10, + "separation": 2, +} + +page = JupyterViz( + BoidFlockers, + model_params, + measures=[], + name="BoidFlockers", + agent_portrayal=boid_draw, +) +page # noqa