|
OpenTTD Source 15.0-beta1
|
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 AyStarStatus | AyStar_EndNodeCheck(const AyStar *aystar, const PathNode *current) |
| Check whether the end-tile is found. | |
| 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) |
| Calculate the H-value for the AyStar algorithm. | |
| typedef void | AyStar_GetNeighbours(AyStar *aystar, PathNode *current) |
| This function requests the tiles around the current tile and put them in #neighbours. | |
| typedef void | AyStar_FoundEndNode(AyStar *aystar, PathNode *current) |
| If the End Node is found, this function is called. | |
Enumerations | |
| enum class | AyStarStatus : uint8_t { FoundEndNode , EmptyOpenList , StillBusy , NoPath , LimitReached , 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) |
| typedef AyStarStatus AyStar_EndNodeCheck(const AyStar *aystar, const PathNode *current) |
Check whether the end-tile is found.
| aystar | AyStar search algorithm data. |
| current | Node to exam one. |
| using AyStarNode = CYapfNodeKeyTrackDir |
|
strong |
Return status of AyStar methods.
| Enumerator | |
|---|---|
| FoundEndNode | An end node was found. |
| 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. |
| NoPath | No path to the goal was found. |
| LimitReached | The AyStar::max_search_nodes limit has been reached, aborting search. |
| Done | Not an end-tile, or wrong direction. |
|
static |
Reference limit for AyStar::max_search_nodes.
|
static |
Item is not valid (for example, not walkable).
Definition at line 40 of file aystar.h.
Referenced by AyStar::CheckTile().