73template<
class State ,
class Cost >
83 std::uint32_t
key = 0;
87 [[nodiscard]] Cost
f(
void )
const noexcept {
return(
g +
h ); }
102 if constexpr( std::numeric_limits< Cost >::has_infinity )
103 return( std::numeric_limits< Cost >::infinity() );
105 return( std::numeric_limits< Cost >::max() );
114template<
class Cost >
115 requires std::is_integral_v< Cost >
116[[nodiscard]]
constexpr std::uint64_t
packed_fg( Cost g , Cost h )
noexcept
118 return( ( std::uint64_t( g + h ) << 32 ) |
119 ( ~std::uint64_t( g ) & 0xFFFFFFFFu ) );
125template<
class NodeT >
128 std::vector<
decltype( goal->state ) > path;
129 for(
const NodeT * n = goal ; n ; n = n->parent )
130 path.push_back( n->state );
131 std::reverse( path.begin() , path.end() );
142#if defined( PBEFS_STRUCTURES_STD )
143 #include "PBeFS/astar/structures/std/NodePool.h"
144#elif defined( PBEFS_STRUCTURES_BOOST )
145 #include "PBeFS/astar/structures/boost/NodePool.h"
146#elif defined( PBEFS_STRUCTURES_ADS )
Header file for the concepts a search problem has to satisfy in order to be searched by the algorithm...
Header file for the class template NodePool of the set of data structures of ADS [see Structures....
Header file for the small helpers shared by the searches: a stopwatch, the placement of the workers o...
Header file for the choice of the set of data structures of A*: the arena of the nodes (NodePool),...
namespace for the Parallel Best-First Search library
Definition AStar.h:83
constexpr Cost infinite_cost(void) noexcept
the largest value of a cost type, used as "no incumbent yet"
Definition Node.h:100
constexpr std::uint64_t packed_fg(Cost g, Cost h) noexcept
with integer costs, f = g + h in the high half of a word and the complement of g in the low one,...
Definition Node.h:116
constexpr std::uint8_t no_op
the operator of the root, which no state was generated by
Definition Domain.h:205
auto trace_path(const NodeT *goal)
the states from the root to goal, following the parent pointers
Definition Node.h:126
a node of the search graph
Definition Node.h:74
Node * parent
the predecessor on that path (nullptr at the root)
Definition Node.h:79
bool expanded
true if ever expanded
Definition Node.h:81
bool closed
true if expanded with the current g
Definition Node.h:80
std::uint8_t op
the operator that generated the state
Definition Node.h:82
State state
the state
Definition Node.h:76
Cost g
the cost of the best path found from the root
Definition Node.h:77
Cost h
the heuristic estimate of the cost to a goal
Definition Node.h:78
Cost f(void) const noexcept
the estimate of the cost of a solution through the Node
Definition Node.h:87
std::uint32_t key
the key of the state for its owner
Definition Node.h:83