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 the astar.cpp file, costs receive the map as a one-dimensional array.
This program uses the manhattan distance.
Select nodes up, down, left, and right through +i, -i, +nx_, and -nx_ at 68:71 line.
In the case of nodes at the edge of the map, simply using +i and -i will select the opposite node of the upper or lower line, respectively, so a conditional statement is required.
The code below is the code I modified
if(i%nx_!=0) add(costs, potential, potential[i], i - 1, end_x, end_y);
if(i%nx_!=nx_-1) add(costs, potential, potential[i], i + 1, end_x, end_y);
add(costs, potential, potential[i], i + nx_, end_x, end_y);
add(costs, potential, potential[i], i - nx_, end_x, end_y);
The text was updated successfully, but these errors were encountered:
In the astar.cpp file, costs receive the map as a one-dimensional array.
This program uses the manhattan distance.
Select nodes up, down, left, and right through +i, -i, +nx_, and -nx_ at 68:71 line.
In the case of nodes at the edge of the map, simply using +i and -i will select the opposite node of the upper or lower line, respectively, so a conditional statement is required.
The code below is the code I modified
The text was updated successfully, but these errors were encountered: