SlidingTilePDB

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

inheritance diagram of SlidingTilePDB

template<int W, int H, class Enc = NibbleEntries>
class SlidingTilePDB : public PBeFS_di_unipi_it::SlidingTile<W, H>

the sliding-tile puzzle with an additive pattern database heuristic

The domain SlidingTile, with all its features, hashes and abstractions, whose heuristic is that of an AdditivePDB (which must outlive it) in place of the Manhattan distance; the goal is that of the tables. With Mod3Entries the heuristic of a successor is that of its parent plus the change of the table of the tile moved, which the residues give, and only the initial state is looked up from the residues alone; this needs the sum without the reflection, since from the maximum of two sums the parts cannot be told apart.

Public Types

using Base = SlidingTile<W, H>

the puzzle

using PDB = AdditivePDB<W, H, Enc>

the heuristic

using state_type = typename Base::state_type

a packed board

using cost_type = typename Base::cost_type

the cost type

using board_type = typename Base::board_type

a board

Public Functions

inline SlidingTilePDB(const board_type &start, const PDB &pdb)

constructor, taking the start board and the heuristic

inline cost_type heuristic(state_type s) const

the heuristic of s, looked up in the tables

template<class F>
inline void for_each_successor(state_type s, cost_type h, F &&f) const

calls f( t , 1 , h( t ) ) for each successor t of s

template<class F>
inline void for_each_successor(state_type s, cost_type h, std::uint8_t op, F &&f) const

as above, but without the successor that op leads back to [see SlidingTile]

inline const PDB &pdb(void) const noexcept

the heuristic

Public Static Functions

static inline void cells_of(state_type s, std::uint8_t *q) noexcept

writes in q the cell of each tile of s

Public Static Attributes

static constexpr int cells = Base::cells

the cells