27 #define __PBeFS_Domain
61 template<
class State ,
class Cost >
62 struct successor_sink {
63 void operator()(
const State & , Cost , Cost )
const noexcept {}
68 template<
class State ,
class Cost >
70 void operator()(
const State & , Cost , Cost , std::uint8_t )
const
76 void operator()( std::size_t )
const noexcept {}
103concept Domain =
requires(
const D & d ,
const typename D::state_type & s ,
104 typename D::cost_type h ) {
105 typename D::state_type;
106 typename D::cost_type;
107 requires std::is_arithmetic_v< typename D::cost_type >;
108 requires std::equality_comparable< typename D::state_type >;
109 requires std::copyable< typename D::state_type >;
110 { d.initial_state() } -> std::convertible_to< typename D::state_type >;
111 { d.is_goal( s ) } -> std::convertible_to< bool >;
112 { d.heuristic( s ) } -> std::convertible_to< typename D::cost_type >;
113 { d.hash( s ) } -> std::convertible_to< std::uint64_t >;
114 d.for_each_successor( s , h ,
115 detail::successor_sink<
typename D::state_type ,
116 typename D::cost_type >{} );
128 requires(
const D & d ,
const typename D::state_type & s ) {
129 { d.num_features() } -> std::convertible_to< std::size_t >;
130 d.for_each_feature( s , detail::index_sink{} );
144 requires(
const D & d ,
const typename D::state_type & s ) {
145 d.for_each_feature_change( s , s , detail::index_sink{} );
156 requires(
const D & d , std::size_t i ) {
157 { d.num_abstract_features() } -> std::convertible_to< std::size_t >;
158 { d.abstract_feature( i ) } -> std::convertible_to< std::size_t >;
169 requires(
const D & d ,
const typename D::state_type & s ) {
170 { d.abstract_state( s ) } -> std::convertible_to< std::uint64_t >;
183 requires(
const D & d ,
const typename D::state_type & s , std::size_t b ) {
184 { d.num_nblocks() } -> std::convertible_to< std::size_t >;
185 { d.nblock( s ) } -> std::convertible_to< std::size_t >;
186 d.for_each_nblock_successor( b , detail::index_sink{} );
197 requires(
const D & d ,
const typename D::state_type & s ) {
198 { d.pairwise_heuristic( s , s ) }
199 -> std::convertible_to< typename D::cost_type >;
205inline constexpr std::uint8_t
no_op = 0xFF;
218 requires(
const D & d ,
const typename D::state_type & s ,
219 typename D::cost_type h , std::uint8_t op ) {
220 d.for_each_successor( s , h , op , detail::op_sink<
221 typename D::state_type ,
typename D::cost_type >{} );
231 requires(
const D & d ,
const typename D::state_type & s ) {
232 { d.perfect_hash( s ) } -> std::convertible_to< std::uint64_t >;
259template<
class D >
requires( ! OperatorDomain< D > )
275template< Domain D ,
class F >
277 std::uint8_t op , F && f ) {
279 d.for_each_successor( s , h , op , std::forward< F >( f ) );
283 f( t , c , ht ,
no_op );
Header file for the small helpers shared by the searches: a stopwatch, the placement of the workers o...
a FeatureDomain that also provides a feature projection
Definition Domain.h:155
a Domain with a state abstraction
Definition Domain.h:168
a search domain
Definition Domain.h:103
a Domain whose states are described by a set of features
Definition Domain.h:127
a FeatureDomain that also gives the features changed by a move
Definition Domain.h:143
a Domain whose state space is partitioned into nblocks
Definition Domain.h:182
a Domain that knows the operator by which a state was generated
Definition Domain.h:217
a Domain with a heuristic between any two states
Definition Domain.h:196
a Domain with a perfect hash of its states
Definition Domain.h:230
namespace for the Parallel Best-First Search library
Definition AStar.h:83
void for_each_child(const D &d, const state_t< D > &s, cost_t< D > h, std::uint8_t op, F &&f)
the successors of s but its parent, when D knows the operators
Definition Domain.h:276
typename D::cost_type cost_t
the cost type of a Domain
Definition Domain.h:245
typename D::state_type state_t
the state type of a Domain
Definition Domain.h:241
constexpr std::uint8_t no_op
the operator of the root, which no state was generated by
Definition Domain.h:205
static constexpr std::uint8_t op
no operator
Definition Domain.h:261
constexpr OperatorOf(std::uint8_t)
Definition Domain.h:263
constexpr OperatorOf(void)=default
std::uint8_t op
the operator
Definition Domain.h:254
constexpr OperatorOf(std::uint8_t o)
Definition Domain.h:256
constexpr OperatorOf(void)=default