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.distis 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 thendistisfrontier->active_distplus the cost of the edge.heuristicis 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 bedistplus the maximum possible distance to the goal.