Function TCOD_frontier_push¶
Defined in File pathfinder_frontier.h
Function Documentation¶
-
TCOD_Error TCOD_frontier_push(struct TCOD_Frontier *frontier, const int *index, int dist, int heuristic)¶
Add a node to this frontier.
index[frontier->ndim]
is the position of the node to add to the frontier.dist
is the total distance of the node. This should be a low number like 0, but can also be a negative number such asINT_MIN
. When adding a node as an edge thendist
isfrontier->active_dist
plus the cost of the edge.heuristic
is the true priority of the node, used to affect node order. For Dijkstra-like algorithms this should be the same asdist
. For A* this should bedist
plus the maximum possible distance to the goal.