The path_finding.c.
More...
The path_finding.c.
- Author
- Nicolas TORO
◆ browse_neighbors()
Browse the neighbors of a room and create a path node for each neighbor room and add them to possible paths.
- Parameters
-
path_info | The path information |
- Returns
- void
- Author
- Nicolas TORO
◆ display_path()
void display_path |
( |
path_t * | path | ) |
|
Display the path found.
- Parameters
-
- Returns
- void
- Author
- Nicolas TORO
◆ get_best_path()
Get the best path between two rooms.
- Parameters
-
start | The starting room |
end | The ending room |
only_free_room | If we only want to browse free rooms |
- Returns
- path_t * The best path found (NULL if no path found)
- Author
- Nicolas TORO
◆ get_heuristic_distance()
Get the heuristic distance between two rooms.
- Note
- In our case, the heuristic distance is the number of iterations to go from one room to the end room
- Parameters
-
start | The starting room |
end | The ending room |
- Returns
- int The heuristic distance (if the room is connected to the end room, then the number of iterations, else -1)
- Author
- Nicolas TORO
◆ get_lowest_score_node()
Get the node with the lowest score in the possible paths list.
- Parameters
-
possible_paths | The list of possible paths |
- Returns
- path_t * The node with the lowest score
- Author
- Nicolas TORO