PBeFS
Parallel Best-First Search
Loading...
Searching...
No Matches
HDAStar< D, Dist, Executor, Open > Class Template Reference

Hash Distributed A* on a shared-memory machine. More...

#include <PBeFS/astar/HDAStar.h>

Classes

struct  Msg
 a node travelling to its owner More...

Public Types

using State = state_t< D >
 the state type
using Cost = cost_t< D >
 the cost type
using NodeT = Node< State , Cost >
 the node type
using SolutionT = Solution< State , Cost >
 the solution type

Public Member Functions

 HDAStar (const D &domain, const Dist &dist, const ParallelOptions &options={})
 constructor, taking the Domain and the distribution (which must outlive the HDAStar)
void set_executor (Executor &ex) noexcept
 sets the Executor that runs the workers, which must outlive the searches; without it, each search builds one of as many threads as there are workers
SolutionT solve (void) const
 searches the Domain, returning the Solution

Detailed Description

template<Domain D, class Dist = StateHashDistribution< D >, ADS::WorkerExecutor Executor = ADS::ThreadPool, class Open = std::conditional_t< std::is_integral_v< cost_t< D > > , BucketOpenList< Node< state_t< D > , cost_t< D > > > , HeapOpenList< Node< state_t< D > , cost_t< D > > > >>
class PBeFS_di_unipi_it::HDAStar< D, Dist, Executor, Open >

Hash Distributed A* on a shared-memory machine.

Every worker runs A* on its own OPEN and CLOSED lists, and a global function Dist assigns every state to the worker that owns it: a node generated by a worker is sent to its owner, which checks it against its closed list and possibly adds it to its OPEN list [see section 4.1 of Fukunaga et al., 2017, and Kishimoto, Fukunaga and Botea, AIJ 2013]. Nodes are sent asynchronously, packed in batches of batch nodes, and an outbox not yet full is flushed every flush_period expansions and before the worker waits. The goal test is done at the expansion, the cost of the best goal found (the incumbent) prunes every node with f not smaller, and the search ends when no worker has a node with f smaller than the incumbent and no node is travelling, which the mailbox of ADS detects.

The node of a state belongs to its owner, which is the only worker that writes it; parent pointers cross the workers, and they are followed only after all the workers have finished.

Member Typedef Documentation

◆ Cost

template<Domain D, class Dist = StateHashDistribution< D >, ADS::WorkerExecutor Executor = ADS::ThreadPool, class Open = std::conditional_t< std::is_integral_v< cost_t< D > > , BucketOpenList< Node< state_t< D > , cost_t< D > > > , HeapOpenList< Node< state_t< D > , cost_t< D > > > >>
using Cost = cost_t< D >

the cost type

◆ NodeT

template<Domain D, class Dist = StateHashDistribution< D >, ADS::WorkerExecutor Executor = ADS::ThreadPool, class Open = std::conditional_t< std::is_integral_v< cost_t< D > > , BucketOpenList< Node< state_t< D > , cost_t< D > > > , HeapOpenList< Node< state_t< D > , cost_t< D > > > >>
using NodeT = Node< State , Cost >

the node type

◆ SolutionT

template<Domain D, class Dist = StateHashDistribution< D >, ADS::WorkerExecutor Executor = ADS::ThreadPool, class Open = std::conditional_t< std::is_integral_v< cost_t< D > > , BucketOpenList< Node< state_t< D > , cost_t< D > > > , HeapOpenList< Node< state_t< D > , cost_t< D > > > >>
using SolutionT = Solution< State , Cost >

the solution type

◆ State

template<Domain D, class Dist = StateHashDistribution< D >, ADS::WorkerExecutor Executor = ADS::ThreadPool, class Open = std::conditional_t< std::is_integral_v< cost_t< D > > , BucketOpenList< Node< state_t< D > , cost_t< D > > > , HeapOpenList< Node< state_t< D > , cost_t< D > > > >>
using State = state_t< D >

the state type

Constructor & Destructor Documentation

◆ HDAStar()

template<Domain D, class Dist = StateHashDistribution< D >, ADS::WorkerExecutor Executor = ADS::ThreadPool, class Open = std::conditional_t< std::is_integral_v< cost_t< D > > , BucketOpenList< Node< state_t< D > , cost_t< D > > > , HeapOpenList< Node< state_t< D > , cost_t< D > > > >>
HDAStar ( const D & domain,
const Dist & dist,
const ParallelOptions & options = {} )
inline

constructor, taking the Domain and the distribution (which must outlive the HDAStar)

Member Function Documentation

◆ set_executor()

template<Domain D, class Dist = StateHashDistribution< D >, ADS::WorkerExecutor Executor = ADS::ThreadPool, class Open = std::conditional_t< std::is_integral_v< cost_t< D > > , BucketOpenList< Node< state_t< D > , cost_t< D > > > , HeapOpenList< Node< state_t< D > , cost_t< D > > > >>
void set_executor ( Executor & ex)
inlinenoexcept

sets the Executor that runs the workers, which must outlive the searches; without it, each search builds one of as many threads as there are workers

◆ solve()

template<Domain D, class Dist = StateHashDistribution< D >, ADS::WorkerExecutor Executor = ADS::ThreadPool, class Open = std::conditional_t< std::is_integral_v< cost_t< D > > , BucketOpenList< Node< state_t< D > , cost_t< D > > > , HeapOpenList< Node< state_t< D > , cost_t< D > > > >>
SolutionT solve ( void ) const
inlinenodiscard

searches the Domain, returning the Solution


The documentation for this class was generated from the following file: