|
| | AdditivePDB (std::vector< Table > tables, bool reflect=true) |
| | constructor, taking the tables, all with the same goal
|
| | AdditivePDB (const Partition &partition, const board_type &goal=Pattern::korf_goal(), const PDBOptions &o={}) |
| | constructor, building the tables of a partition for the goal
|
| int | heuristic (const std::uint8_t *q) const noexcept |
| | the heuristic of the state whose tile t is in the cell q[ t ]
|
| int | sum (const std::uint8_t *q) const noexcept |
| | the sum of the values of the tables for the cells q
|
| int | exact (const std::uint8_t *q) const |
| | the heuristic of the cells q, from the residues alone [see PatternTable::exact()]
|
| int | delta (const std::uint8_t *q, int t, int c) const noexcept |
| | the change of the sum when the tile t moves from the cells q to the cell c, from the residues of the table of t (CHILD-H of the file header); 0 for a tile in no pattern
|
| void | reflection (const std::uint8_t *q, std::uint8_t *r) const noexcept |
| | writes in r the cells of the reflection of the state of cells q
|
| const board_type & | goal (void) const noexcept |
| | the goal board
|
| bool | reflected (void) const noexcept |
| | true if the heuristic also looks up the reflection
|
| const std::vector< Table > & | tables (void) const noexcept |
| | the tables
|
| std::size_t | bytes (void) const noexcept |
| | the bytes of the entries of all the tables
|
template<int W, int H, class Enc = NibbleEntries>
class PBeFS_di_unipi_it::AdditivePDB< W, H, Enc >
the additive heuristic of disjoint pattern tables
The tables are those of a partition of (some of) the tiles into disjoint patterns, and the heuristic of a state is the sum of the values of its placements in the tables. With the blank ignored or minimized, a move of the puzzle moves one tile, hence it is a move of the abstraction of at most one pattern, which counts it once; the sum of the abstract distances is thus at most the true one (admissible), and with the blank ignored it changes by at most one along a move (consistent). On a square board whose goal has the blank on the main diagonal, the heuristic is also the maximum with the same sum on the reflection of the state about the diagonal, which is an automorphism of the puzzle fixing the goal [see the file header].
template<int W, int H, class Enc = NibbleEntries>
constructor, building the tables of a partition for the goal
Builds (or takes from the cache directory of o) the table of each pattern of partition, each one with all the workers of o, on the C++ threads; make() does the same on another runtime.
template<int W, int H, class Enc = NibbleEntries>
| int sum |
( |
const std::uint8_t * | q | ) |
const |
|
inlinenodiscardnoexcept |
the sum of the values of the tables for the cells q
The sum of the tables only, without the reflection: for the tests and the benchmarks.