-
Notifications
You must be signed in to change notification settings - Fork 8
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
Use random_nearby
in wolf sheep?
#66
Comments
Yes, indeed this is what I was referring to when I was saying that there is some other API calls to add there, but we need to add some new methods in Agents.jl before so, will do a pr there in a couple of days when I find the time! |
be careful though to only add API methods that are generally useful. We don't want to "cheat" and just add functions to Agents.jl API that would only be used in this comparison repo. What is the method that is "missing" here? |
we already have filtering here: https://juliadynamics.github.io/Agents.jl/stable/api/#Agents.random_nearby_agent |
BTW this function seems to allocate the collection anyways: https://github.com/JuliaDynamics/Agents.jl/blob/main/src/core/space_interaction_API.jl#L414C30-L414C30 Which makes me think, how is it more performant than directly collecting the iterator and calling |
It is more performant since it doesn't test the Yes, anyway I'm (almost) sure those functions will be beneficial for the users |
In Agents.jl we have spent considerable development effort optimizing functions that pick a "random nearby thing" but these aren't used here anywhere even though picking a "random nearby thing" is an extremely common ABM programming pattern.
Maybe we can use the random nearby in the wolf sheep model?
here: https://github.com/JuliaDynamics/ABM_Framework_Comparisons/blob/main/WolfSheep/Agents/WolfSheep.jl#L78
The text was updated successfully, but these errors were encountered: