-
Notifications
You must be signed in to change notification settings - Fork 119
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
nearby_ids returns the same ID multiple times when r is bigger than the space size #566
Comments
This seems to be oriented around |
This is interesting. Your interpretation of |
This is a problem with To be fair, I'm not sure whether we should do this... Adding an extra |
Yeah, this is non-fixable: function _grid_space_neighborhood(
α::CartesianIndex,
space::GridSpace{D,true},
hood,
) where {D}
return ((mod1.(Tuple(α + β), hood.whole.maxi)) for β in hood.βs)
end we will lose some crazy amount of optimization if we try and fix this issue, and in my eyes it is just not worth it. |
@Datseris Not sure if you are already on top of this, but you should probably update the documentation for this function to let users know about this quirk and an explanation of why it still exists, otherwise you'll be getting a lot more issues/PRs like this one. |
I'm working on something else at the moment, can you open a PR? |
PR created @Datseris |
this is easily fixable actually at least now, just filter |
sorry to reopen this old issue, actually it is a bit more difficult than this, so I think not worth it |
sorry again it is actually fixable with what I had in mind, double confused myself :D |
Describe the bug
nearby_ids
returns the same ID multiple timesMinimal Working Example
Modified from flock.jl
Agents.jl version
4.5.6
The text was updated successfully, but these errors were encountered: