OpenTTD Source
20241121-master-g67a0fccfad
|
This file has the header for AyStar. More...
#include "../track_func.h"
#include "../misc/hashtable.hpp"
#include "../misc/binaryheap.hpp"
#include "../misc/dbg_helpers.h"
#include "yapf/nodelist.hpp"
#include "yapf/yapf_node.hpp"
Go to the source code of this file.
Data Structures | |
struct | PathNode |
struct | AyStar |
AyStar search algorithm struct. More... | |
Typedefs | |
using | AyStarNode = CYapfNodeKeyTrackDir |
typedef int32_t | AyStar_EndNodeCheck(const AyStar *aystar, const PathNode *current) |
Check whether the end-tile is found. More... | |
typedef int32_t | AyStar_CalculateG(AyStar *aystar, AyStarNode *current, PathNode *parent) |
Calculate the G-value for the AyStar algorithm. More... | |
typedef int32_t | AyStar_CalculateH(AyStar *aystar, AyStarNode *current, PathNode *parent) |
Calculate the H-value for the AyStar algorithm. More... | |
typedef void | AyStar_GetNeighbours(AyStar *aystar, PathNode *current) |
This function requests the tiles around the current tile and put them in #neighbours. More... | |
typedef void | AyStar_FoundEndNode(AyStar *aystar, PathNode *current) |
If the End Node is found, this function is called. More... | |
Enumerations | |
enum | AystarStatus { AYSTAR_FOUND_END_NODE , AYSTAR_EMPTY_OPENLIST , AYSTAR_STILL_BUSY , AYSTAR_NO_PATH , AYSTAR_LIMIT_REACHED , AYSTAR_DONE } |
Return status of AyStar methods. More... | |
Functions | |
bool | CheckIgnoreFirstTile (const PathNode *node) |
Variables | |
static const int | AYSTAR_DEF_MAX_SEARCH_NODES = 10000 |
Reference limit for AyStar::max_search_nodes. | |
static const int | AYSTAR_INVALID_NODE = -1 |
Item is not valid (for example, not walkable). | |
This file has the header for AyStar.
AyStar is a fast path finding routine and is used for things like AI path finding and Train path finding. For more information about AyStar (A* Algorithm), you can look at http://en.wikipedia.org/wiki/A-star_search_algorithm.
Definition in file aystar.h.
typedef int32_t AyStar_CalculateG(AyStar *aystar, AyStarNode *current, PathNode *parent) |
Calculate the G-value for the AyStar algorithm.
typedef int32_t AyStar_CalculateH(AyStar *aystar, AyStarNode *current, PathNode *parent) |
Check whether the end-tile is found.
aystar | AyStar search algorithm data. |
current | Node to exam one. |
enum AystarStatus |
Return status of AyStar methods.
Enumerator | |
---|---|
AYSTAR_FOUND_END_NODE | An end node was found. |
AYSTAR_EMPTY_OPENLIST | All items are tested, and no path has been found. |
AYSTAR_STILL_BUSY | Some checking was done, but no path found yet, and there are still items left to try. |
AYSTAR_NO_PATH | No path to the goal was found. |
AYSTAR_LIMIT_REACHED | The AyStar::max_search_nodes limit has been reached, aborting search. |
AYSTAR_DONE | Not an end-tile, or wrong direction. |