19#include "../track_func.h"
21#include "../misc/hashtable.hpp"
22#include "../misc/binaryheap.hpp"
23#include "../misc/dbg_helpers.h"
47bool CheckIgnoreFirstTile(
const PathNode *node);
129 std::vector<AyStarNode> neighbours;
AyStarStatus AyStar_EndNodeCheck(const AyStar *aystar, const PathNode *current)
Check whether the end-tile is found.
int32_t AyStar_CalculateG(AyStar *aystar, AyStarNode *current, PathNode *parent)
Calculate the G-value for the AyStar algorithm.
AyStarStatus
Return status of AyStar methods.
@ EmptyOpenList
All items are tested, and no path has been found.
@ StillBusy
Some checking was done, but no path found yet, and there are still items left to try.
@ LimitReached
The AyStar::max_search_nodes limit has been reached, aborting search.
@ NoPath
No path to the goal was found.
@ FoundEndNode
An end node was found.
@ Done
Not an end-tile, or wrong direction.
static const int AYSTAR_INVALID_NODE
Item is not valid (for example, not walkable).
int32_t AyStar_CalculateH(AyStar *aystar, AyStarNode *current, PathNode *parent)
Calculate the H-value for the AyStar algorithm.
void AyStar_GetNeighbours(AyStar *aystar, PathNode *current)
This function requests the tiles around the current tile and put them in #neighbours.
static const int AYSTAR_DEF_MAX_SEARCH_NODES
Reference limit for AyStar::max_search_nodes.
void AyStar_FoundEndNode(AyStar *aystar, PathNode *current)
If the End Node is found, this function is called.
Hash table based node list multi-container class.
List of nodes used for the A-star pathfinder.
AyStar search algorithm struct.
int max_search_nodes
The maximum number of nodes that will be expanded, 0 = infinite.
void OpenListAdd(PathNode *parent, const AyStarNode *node, int f, int g)
Adds a node to the open list.
int max_path_cost
If the g-value goes over this number, it stops searching, 0 = infinite.
AyStarStatus Loop()
This function is the core of AyStar.
AyStarStatus Main()
This is the function you call to run AyStar.
void CheckTile(AyStarNode *current, PathNode *parent)
Checks one tile and calculate its f-value.
void AddStartNode(AyStarNode *start_node, int g)
Adds a node from where to start an algorithm.
uint8_t loops_per_tick
How many loops are there called before Main() gives control back to the caller. 0 = until done.
Node in the pathfinder's graph.