Symphony Of Empires
Eng3D::Pathfind Namespace Reference

Functions

template<typename T >
std::vector< T > get_path (T start, T end, std::function< std::vector< T >(T)> g, std::function< float(T, T)> h)
 Implements the A* algorithm with euclidean distance as heuristic. Returns a vector where the starting point is at the back and the end point at the front. More...
 
template<typename T , typename V >
void from_source (T source, const std::vector< std::vector< V >> &neighbour_rels, std::vector< float > &costs)
 

Function Documentation

◆ from_source()

template<typename T , typename V >
void Eng3D::Pathfind::from_source ( source,
const std::vector< std::vector< V >> &  neighbour_rels,
std::vector< float > &  costs 
)
inline

Definition at line 97 of file pathfind.hpp.

◆ get_path()

template<typename T >
std::vector<T> Eng3D::Pathfind::get_path ( start,
end,
std::function< std::vector< T >(T)>  g,
std::function< float(T, T)>  h 
)
inline

Implements the A* algorithm with euclidean distance as heuristic. Returns a vector where the starting point is at the back and the end point at the front.

Parameters
gThe predicate generator returning a iterable container with the neioghbour of the given arguments
hHeuristic function (cost + HeurFn())

Keeps track of the costs so far

Keeps track of the previous tile for each tile

Keeps track of which tiles have been visited

Priority queue based on cost

Definition at line 40 of file pathfind.hpp.