-
Notifications
You must be signed in to change notification settings - Fork 892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
examples/wolf_sheep: Don't allow dumb moves #2503
base: main
Are you sure you want to change the base?
Conversation
Agents now move completely random in WolfSheep. That makes no sense whatsoever, so this PR makes them move a little bit less dump. - Wolf moves to random cell with sheep on them, if available (otherwise completely random) - Sheep move to a random cell without a wolf (if available), and preferably with grass. This enables sheep to actually "search" for grass, wolfs to search for sheep and sheep to not move to a cell with wolves. More importantly, it shows of some nice selection mechanics with the cell space.
dcaf243
to
dfbdb1a
Compare
Performance benchmarks:
|
Double the runtime is quite an increase. But that's good, that means we now have a meaningful step which can be profiled and optimized. |
Oof, yes that's quite an increase and invites to further investigate! And this seems to be a way more interesting model dynamic |
I have an overarching question. This model is used in the ABM Framework comparison. We, therefore, use it in our own internal benchmarks. Clearly, with the examples back in the main repo, we should not duplicate code between benchmarks and examples. This change, however, breaks the link with the ABM Framework comparison, so do we want that, and what does this imply for our own benchmark models?
It highlights a point we both have made before, no matter how fast we would make the core of mesa (e.g., via rust or cython), often the real bottleneck is user code. As an aside, and more for my own understanding, how does the benchmarking now work with examples back in the main repo? |
Agents now move completely random in WolfSheep. That makes no sense whatsoever, so this PR makes them move a little bit less dumb.
This enables sheep to actually "search" for grass, wolfs to search for sheep and sheep to not move to a cell with wolves.
More importantly, it shows of some nice selection mechanics with the cell space.
I expect the WolfSheep model to be slower, but curious by how much.
Depends on #2502.
Edit: Dynamics are quite interesting, I had this epic run where one single sheep survived endlessly until all the wolves where finally dead.