HDAStar

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

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 HDAStar

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.

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 Functions

inline HDAStar(const D &domain, const Dist &dist, const ParallelOptions &options = {})

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

inline 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

inline SolutionT solve(void) const

searches the Domain, returning the Solution

struct Msg

a node travelling to its owner

Public Members

State s
Cost g
Cost h
NodeT *parent
OperatorOf<D> o
std::uint32_t key