-
Notifications
You must be signed in to change notification settings - Fork 987
Wolf-sheep to use create_agent
#2543
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
for more information, see https://pre-commit.ci
Looks good! Could you use keyword arguments for clarity? |
see the update and let me know which you prefer |
Thanks, I think this helps. Do you know why the tests fail? FAILED tests/test_examples.py::test_wolf_sheep - ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() |
I have a hunch, but will be tonight most likely before I have time again. I'll get it fixed then |
Performance benchmarks:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This updates the wolf sheep example to use
create_agents
for wolves and sheep. It also showcases how we can easily sample cells from a cell collection.I have deliberately not touched grass patched. It is possible to rewrite this to use create_agent, but to make this nice and clean requires a few more changes. Moreover, ideally, this should be rewritten to use a property layer for grass anyway.