We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug ContinuousSpace.get_heading returns wrong result when going over the middle line and toroidal space is enabled.
ContinuousSpace.get_heading
Expected behavior Heading from (51, 51) to (49, 49) should return (-2, -2).
(51, 51)
(49, 49)
(-2, -2)
To Reproduce
import numpy as np from mesa import space cspace = space.ContinuousSpace(100, 100, True) print(cspace.get_heading((51, 51), (49, 49)))
Prints (98.0, 98.0). So it goes 180 Degree in the wrong direction.
(98.0, 98.0)
If I shift the points down I get the right results:
import numpy as np from mesa import space cspace = space.ContinuousSpace(100, 100, True) print(cspace.get_heading((11, 11), (9, 9)))
Prints (-2.0, -2.0). So the correct result.
(-2.0, -2.0)
The text was updated successfully, but these errors were encountered:
Fixes problem with ContinuousSpace.get_heading in toroidal space mode
9c04327
see issue projectmesa#943
Confirmed that the bug is still present in v1.2.1.
Sorry, something went wrong.
2a2b6e4
Fixed by #1686.
No branches or pull requests
Describe the bug
ContinuousSpace.get_heading
returns wrong result when going over the middle line and toroidal space is enabled.Expected behavior
Heading from
(51, 51)
to(49, 49)
should return(-2, -2)
.To Reproduce
Prints
(98.0, 98.0)
. So it goes 180 Degree in the wrong direction.If I shift the points down I get the right results:
Prints
(-2.0, -2.0)
. So the correct result.The text was updated successfully, but these errors were encountered: