Function TCOD_frontier_push

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 as INT_MIN. When adding a node as an edge then dist is frontier->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 as dist. For A* this should be dist plus the maximum possible distance to the goal.