Romania

Declared in astar/Romania.h; the same class on the site of Doxygen.

inheritance diagram of Romania

class Romania : public ExplicitGraph<double>

a trip on the road map of Romania

The cities are Arad, Bucharest, Craiova, Drobeta, Eforie, Fagaras, Giurgiu, Hirsova, Iasi, Lugoj, Mehadia, Neamt, Oradea, Pitesti, Rimnicu (Vilcea), Sibiu, Timisoara, Urziceni, Vaslui and Zerind, and the roads cost their length in km. Towards Bucharest the heuristic is the straight-line distance of figure 3.22 of the book; towards any other city it is the distance between the coordinates of the cities in aima-python (github.com/aimacode/aima-python), which on this map never exceeds the length of a road and is therefore consistent. The costs are real numbers, since the latter heuristic is not an integer.

Public Types

enum City

the cities, in alphabetical order

Values:

enumerator Arad
enumerator Bucharest
enumerator Craiova
enumerator Drobeta
enumerator Eforie
enumerator Fagaras
enumerator Giurgiu
enumerator Hirsova
enumerator Iasi
enumerator Lugoj
enumerator Mehadia
enumerator Neamt
enumerator Oradea
enumerator Pitesti
enumerator Rimnicu
enumerator Sibiu
enumerator Timisoara
enumerator Urziceni
enumerator Vaslui
enumerator Zerind
enumerator NCities

Public Functions

inline Romania(City from = Arad, City to = Bucharest)

constructor of the trip from the city from to the city to

Public Static Functions

static inline const char *name(std::uint32_t c)

the name of the city c

static inline City find(const std::string &city_name)

the city called name, NCities if there is none

static inline const std::array<Road, 23> &roads(void)

the roads of figure 3.2 of the book

struct Road

a road and its length in km

Public Members

City a
City b
int km