Conversation
|
Performance benchmarks:
|
|
Sounds like it’s working like intended, right? All agents with the same location are not considered neighbors. Specifically for flocking, since agents are on continuous coordinates, isn’t the chance extremely small a neighbor has the exact same location (fp32 precision?) as another agent? |
I beg to differ. To me, if a given agent X asks for its neighbors, I expect to get all neighbors even if there happens to be an agent Y on the exact same location this agent Y is still a neighbor of agent X.
Yes, this is very much an edge-case kind of issue, which is why the documentation solution is fine as far as I am concerned. |
Co-authored-by: Ewout ter Hoeven <[email protected]>
|
I updated the PR title and body to reflect the final changes. Feel free to adjust further or let me know if you don't like it. |
Co-authored-by: Ewout ter Hoeven <[email protected]> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ewout ter Hoeven <[email protected]>
Co-authored-by: Ewout ter Hoeven <[email protected]> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ewout ter Hoeven <[email protected]>
This PR clarifies the behavior of
ContinuousSpace.get_neighborswhen multiple agents occupy the same position.Changes:
get_neighborsexplaining howinclude_center=Falseaffects agents at the same positioninclude_center=Trueand filtering out selfContext:
When multiple agents occupy the same position and
include_center=Falseis used, all agents at that position are excluded from the results - not just the center agent. This is the expected behavior, but was not clearly documented. Rather than making a breaking change to the API, this PR:include_center=Trueand filtering unwanted agentsExample usage:
Closes #2592.