HOG2
|
Note, assumes that state has a public vector<int> called puzzle in which the permutation is held. More...
#include <PermutationPuzzleEnvironment.h>
Public Member Functions | |
PermutationPuzzleEnvironment () | |
double | HCost (const state &s) const |
virtual double | AdditiveGCost (const state &s, const action &d) |
void | GetStateFromHash (state &s, uint64_t hash) const |
uint64_t | GetStateHash (const state &s) const |
state | TranformToStandardGoal (const state &a, const state &b) const |
virtual void | FinishUnranking (state &s) const |
bool | Validate_Problems (std::vector< state > &puzzles) |
Static Public Member Functions | |
static uint64_t | Hash (const state &s) |
static bool | Check_Permutation (const std::vector< int > &to_check) |
Ensures that the state contains a valid permutation. More... | |
static bool | Output_Puzzles (std::vector< state > &puzzle_vector, bool write_puzz_num) |
Outputs the set of puzzles in puzzle_vector to standard output. More... | |
static bool | Read_In_Permutations (const char *filename, unsigned size, unsigned max_puzzles, std::vector< std::vector< int > > &permutations, bool puzz_num_start) |
static std::vector< int > | Get_Random_Permutation (unsigned size) |
Public Attributes | |
bool | additive |
int | maxItem |
int | minPattern |
std::vector< std::vector< uint8_t > > | PDB |
std::vector< std::vector< int > > | PDB_distincts |
std::vector< PDBTreeNode > | lookups |
std::vector< std::vector< uint64_t > > | factorialCache |
MR1KPermutation | mr1 |
Protected Member Functions | |
uint64_t | Factorial (int val) const |
uint64_t | nUpperk (int n, int k) const |
Returns the value of n! / k! More... | |
virtual bool | State_Check (const state &to_check)=0 |
Checks that the given state is a valid state for this domain. More... | |
Private Member Functions | |
virtual double | DefaultH (const state &s) const |
void | buildCaches () const |
Builds caches for nUpperk. More... | |
Note, assumes that state has a public vector<int> called puzzle in which the permutation is held.
Definition at line 26 of file PermutationPuzzleEnvironment.h.
|
inline |
Definition at line 59 of file PermutationPuzzleEnvironment.h.
|
inlinevirtual |
Reimplemented in TopSpin< N, k >.
Definition at line 63 of file PermutationPuzzleEnvironment.h.
|
private |
Builds caches for nUpperk.
Definition at line 1115 of file PermutationPuzzleEnvironment.h.
|
static |
Ensures that the state contains a valid permutation.
That is, if the state is of size n, each of the integers from 0 to n-1 occurs exactly once.
Definition at line 1360 of file PermutationPuzzleEnvironment.h.
|
inlineprivatevirtual |
Reimplemented in PancakePuzzle< N >, and MNPuzzle< width, height >.
Definition at line 105 of file PermutationPuzzleEnvironment.h.
|
protected |
Definition at line 1100 of file PermutationPuzzleEnvironment.h.
|
inlinevirtual |
Definition at line 79 of file PermutationPuzzleEnvironment.h.
|
static |
Definition at line 1499 of file PermutationPuzzleEnvironment.h.
void PermutationPuzzle::PermutationPuzzleEnvironment< state, action >::GetStateFromHash | ( | state & | s, |
uint64_t | hash | ||
) | const |
Definition at line 1276 of file PermutationPuzzleEnvironment.h.
uint64_t PermutationPuzzle::PermutationPuzzleEnvironment< state, action >::GetStateHash | ( | const state & | s | ) | const |
Definition at line 1284 of file PermutationPuzzleEnvironment.h.
|
inlinestatic |
Definition at line 68 of file PermutationPuzzleEnvironment.h.
double PermutationPuzzle::PermutationPuzzleEnvironment< state, action >::HCost | ( | const state & | s | ) | const |
Definition at line 1013 of file PermutationPuzzleEnvironment.h.
|
protected |
Returns the value of n! / k!
Definition at line 1138 of file PermutationPuzzleEnvironment.h.
|
static |
Outputs the set of puzzles in puzzle_vector to standard output.
The output is of the form "I_0 I_1 ... I_(MN - 1)" where I_K is the element in the Kth position of the puzzle. If the write_puzz_num flag is set as true, the first item of the output is the puzzle number. Puzzles are checked for validity before they are outputted. True is return if all the puzzles are valid, otherwise false is returned and the puzzles are not outputted.
Make sure all puzzles are for this environment
Definition at line 1394 of file PermutationPuzzleEnvironment.h.
|
static |
Definition at line 1428 of file PermutationPuzzleEnvironment.h.
|
protectedpure virtual |
Checks that the given state is a valid state for this domain.
Note, is not a check of solvability, just legality (ie. has the right size, dimensions). Note, this method should be a quick check that can be used for debugging purposes and so should not call Check_Permutation which is O(state size)
Implemented in TopSpin< N, k >, PancakePuzzle< N >, and MNPuzzle< width, height >.
state PermutationPuzzle::PermutationPuzzleEnvironment< state, action >::TranformToStandardGoal | ( | const state & | a, |
const state & | b | ||
) | const |
Definition at line 1296 of file PermutationPuzzleEnvironment.h.
bool PermutationPuzzle::PermutationPuzzleEnvironment< state, action >::Validate_Problems | ( | std::vector< state > & | puzzles | ) |
Definition at line 1524 of file PermutationPuzzleEnvironment.h.
bool PermutationPuzzle::PermutationPuzzleEnvironment< state, action >::additive |
Definition at line 124 of file PermutationPuzzleEnvironment.h.
|
mutable |
Definition at line 131 of file PermutationPuzzleEnvironment.h.
std::vector<PDBTreeNode> PermutationPuzzle::PermutationPuzzleEnvironment< state, action >::lookups |
Definition at line 130 of file PermutationPuzzleEnvironment.h.
int PermutationPuzzle::PermutationPuzzleEnvironment< state, action >::maxItem |
Definition at line 125 of file PermutationPuzzleEnvironment.h.
int PermutationPuzzle::PermutationPuzzleEnvironment< state, action >::minPattern |
Definition at line 125 of file PermutationPuzzleEnvironment.h.
MR1KPermutation PermutationPuzzle::PermutationPuzzleEnvironment< state, action >::mr1 |
Definition at line 133 of file PermutationPuzzleEnvironment.h.
Referenced by PermutationPuzzle::PermutationPuzzleEnvironment< TopSpinState< N >, TopSpinAction >::Hash().
std::vector<std::vector<uint8_t> > PermutationPuzzle::PermutationPuzzleEnvironment< state, action >::PDB |
Definition at line 127 of file PermutationPuzzleEnvironment.h.
std::vector<std::vector<int> > PermutationPuzzle::PermutationPuzzleEnvironment< state, action >::PDB_distincts |
Definition at line 129 of file PermutationPuzzleEnvironment.h.