-
Notifications
You must be signed in to change notification settings - Fork 925
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
Fix deterministic behavior in move_agent_to_one_of
with selection="closest"
#2118
Conversation
…ith muliple options and a fix of the issue
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 a lot for catching this! You are indeed right, the closest choice is deterministic while it shouldn't be.
I have one suggestion to implement it a bit cleaner.
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.
Ok I see that the test passes and my example that uses this code is not showing the issue anymore. SO +1
Awesome! Let’s now try to make it faster :) |
@EwoutH Do we want to wait for speed on this one or merge it and do a 2.3.1 to fix the bug? |
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.
Sorry that we did this die in red tape. I'm not sure if our benchmarks use this behavior, but for now correct behavior is more important than performance.
Thanks for the fix!
move_agent_to_one_of
with selection="closest"
…"closest"` (projectmesa#2118) This PR addresses a bug in `move_agent_to_one_of` where agents exhibit deterministic behavior when multiple closest positions are available and `selection="closest"` is used.
This PR addresses a bug in
move_agent_to_one_of
where agents exhibit deterministic behavior when multiple closest positions are available andselection="closest"
is used. This issue caused agents to follow periodic motion patterns instead of random selection within sugar plateaus, particularly noticeable in low-vision agents.Changes:
move_agent_to_one_of
to ensure randomness when multiple equally distant positions are found by shuffling the positions and randomly selecting from the closest ones.test_move_agent_closest_selection_multiple
, to verify that agents exhibit random behavior in scenarios with multiple closest positions.Fixes: Agents now select randomly from multiple closest positions, preventing deterministic motion.
Closes: #2117