OpenTTD Source 20250426-master-gbb1d561369
aystar.h File Reference

This file has the header for AyStar. More...

#include "yapf/nodelist.hpp"
#include "yapf/yapf_node.hpp"

Go to the source code of this file.

Data Structures

struct  PathNode
 
class  AyStar
 AyStar search algorithm struct. More...
 

Typedefs

using AyStarNode = CYapfNodeKeyTrackDir
 

Enumerations

enum class  AyStarStatus : uint8_t {
  FoundEndNode , EmptyOpenList , StillBusy , NoPath ,
  LimitReached , Done
}
 Return status of AyStar methods. More...
 

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).
 

Detailed Description

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 Documentation

◆ AyStarNode

Definition at line 36 of file aystar.h.

Enumeration Type Documentation

◆ AyStarStatus

enum class AyStarStatus : uint8_t
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_DEF_MAX_SEARCH_NODES limit has been reached, aborting search.

Done 

Not an end-tile, or wrong direction.

Definition at line 25 of file aystar.h.

Variable Documentation

◆ AYSTAR_DEF_MAX_SEARCH_NODES

const int AYSTAR_DEF_MAX_SEARCH_NODES = 10000
static

Reference limit for #AyStar::max_search_nodes.

Definition at line 22 of file aystar.h.

Referenced by AyStar::Loop().

◆ AYSTAR_INVALID_NODE

const int AYSTAR_INVALID_NODE = -1
static

Item is not valid (for example, not walkable).

Definition at line 34 of file aystar.h.

Referenced by AyStar::CheckTile().