Conversation
fc5778f to
fdc814d
Compare
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
Thanks for the PR. We have certain standards to keep the quality of our examples high, please see the Mesa Examples self- and peer-review guidelines. If you have any questions let us know. |
B2prakash
left a comment
There was a problem hiding this comment.
- Good fit for Mesa 4.0: Using ContinuousSpaceAgent and get_neighbors_in_radius aligns with the new API. This fills a real gap in mesa-examples.
- Dynamic agent management: The reproduction, hunting, and starvation mechanics properly test runtime agent addition/removal — which is exactly what the benchmarking discussion (#2972) called for.
- Suggestion: The maintainers have posted self- and peer-review guidelines (#390). It would be helpful to run through that checklist — especially checking for a metadata.toml, consistent README format, and making sure the model follows the latest mesa-examples contribution template.
- Minor: A headless run.py is included which is good for benchmarking. Consider also adding an app.py with SolaraViz visualization so users can see the model visually.
|
I beg to differ here
These are not new Mesa 4.0 APIs, see mesa/mesa#2584
I really don't know what you meant by metadata.toml I would really appreciate if you'll actually dig into the code and I'm sure you'll enjoy it once familiar :) |
|
Hi @Ishwarpatra For eg. You need not to assign
|
for more information, see https://pre-commit.ci
6161bb5 to
61f4cc0
Compare
76fa7a5 to
f2ec8d5
Compare
for more information, see https://pre-commit.ci
|
Hi @codebreaker32 and @B2prakash, Thank you both so much for your patience and incredible guidance! The boid_flockers reference was the perfect blueprint, and Ved's suggestion to add a Solara visualization completely transformed this model. I have just pushed the final round of updates to the PR: Folder Restructure: Moved the model into a clean prey_predator directory. Biological Realism: I noticed the base logic resulted in infinite exponential growth, so I added biological constraints: agents now have lifespans (max_age), Prey have a spatial carrying capacity (overcrowding checks), and Predators require a high energy threshold to reproduce. Solara Dashboard: Added app.py which now renders both the continuous spatial map and a live Lotka-Volterra population line chart! Documentation: I also just updated the README.md to follow the "mini-paper" structure discussed by Ewout in #417. I am really proud of how this turned out. I'm ready for a final review whenever you have the time also open recommendation as their are many variables which can affect this! |
|
Hi @Ishwarpatra, I’ve been following the Mesa 4.0 "Clean Slate" evolution and just did a deep-dive into your latest refactor. Moving toward the "mini-paper" README format is exactly the direction @EwoutH suggested in #417. Technical Observations:
Really strong work. This is a solid blueprint for others looking to build Continuous Space models! |
Vanya-kapoor
left a comment
There was a problem hiding this comment.
Hey,great work on this!
I just have one small suggestion :predator_gain_from_food not exposed as a slider in app.py — it's a key parameter affecting dynamics but can't be tuned interactively.
| self.datacollector.collect( | ||
| self | ||
| ) # collect the data for the current step of the simulation | ||
| # Mesa 4.0 native agent activation (replaces the old scheduler) | ||
| self.agents.shuffle_do( | ||
| "step" | ||
| ) # it step all agents during the scheduling process |
There was a problem hiding this comment.
You are collecting data before the step logic will be encountered. In this way, wouldn't you always miss the last step?
| new_pos = (new_x, new_y) | ||
|
|
||
| # to make sure it doesn't go off the map; use the new helper | ||
| if self.model.space.torus: |
There was a problem hiding this comment.
You need not to do it, its already handled via position.setter
Description
This PR introduces a new
ContinuousSpacePredator-Prey model to the examples directory.As discussed by the maintainers in the Mesa 4 goals (Discussion #2972), there is a need for a model with dynamic adding and removing of agents in continuous space to properly benchmark the performance of the new
ContinuousSpaceAgentand the experimentalContinuousSpace.This model provides exactly that testing ground. It includes:
ContinuousSpaceAgentimplementations for both Predator and Prey.get_neighbors_in_radiusAPI.run.py) ready to be hooked into the benchmark suite.Related Issue / Discussion
Addresses the benchmarking gap mentioned by @quaquel in Discussion #2972.
Type of Change
How Has This Been Tested?
python run.py, confirming populations fluctuate dynamically and agents are successfully added/removed from the continuous space and scheduler during runtime.ruff.