-
Notifications
You must be signed in to change notification settings - Fork 928
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
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? |
I think breaking this link is fine. The main use case of the examples is showcasing Mesa features. I think this change showcases what's possible with the Mesa Cell Space well.
While I'm not disagreeing, I don't think this applies here: Most operation are still Mesa internals (the spaces), so we're still benchmarking Mesa, and not arbitrary Python code.
Their goal is to see how fast Mesa is, and to detect performance regressions or improvements when we do feature development. Since we're still benchmarking Mesa internals, sounds like it fulfills its purpose. |
I'm merging this, because:
|
@EwoutH next time can you ping one of us just to make sure we get the approve on the PR. Thank you |
You're right, will do |
This would be a implicit change of policy though. Previously, in Mesa-examples, we didn't require explicit reviews, while we could request them. I'm not against requiring reviews for example updates per se, but I do think this warrants a bit of a bigger discussion. Personally I might have the stance that only core Mesa would require explicit reviews. Other stuff is non-critical, and we can trust each others judgement to request a review when they are nessesary. We might have to accept the occasional revert. I don't think that is a bad thing, it means we're finding our path and learning things. |
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.
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.