You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In IndexedAStarPathFinder#search there is this line:
// Terminate if we reached the goal node
if (current.node == endNode) return true;
This only works if nodes don't change identity. Depending on how the user implements methods such as getConnections, the nodes might change identity while still remaining logically equal (eg if the type N is the user's custom Coordinate class). I ran into this problem myself, but fixed it by caching my coordinate objects (which I should have been doing anyway), but it's potentially confusing for less experienced developers. If there isn't a compelling reason to to do otherwise, it might be better to replace the == with .equals.
The text was updated successfully, but these errors were encountered:
In IndexedAStarPathFinder#search there is this line:
This only works if nodes don't change identity. Depending on how the user implements methods such as getConnections, the nodes might change identity while still remaining logically equal (eg if the type N is the user's custom Coordinate class). I ran into this problem myself, but fixed it by caching my coordinate objects (which I should have been doing anyway), but it's potentially confusing for less experienced developers. If there isn't a compelling reason to to do otherwise, it might be better to replace the == with .equals.
The text was updated successfully, but these errors were encountered: