HOG2
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
PermutationPDB< state, action, environment, bits > Class Template Referenceabstract

This class does the basic permutation calculation with a regular N^2 permutation computation. More...

#include <PermutationPDB.h>

Inheritance diagram for PermutationPDB< state, action, environment, bits >:
Inheritance graph
[legend]
Collaboration diagram for PermutationPDB< state, action, environment, bits >:
Collaboration graph
[legend]

Public Member Functions

 PermutationPDB (environment *e, const state &s, const std::vector< int > &distincts)
 
virtual uint64_t GetPDBSize () const
 
virtual uint64_t GetPDBHash (const state &s, int threadID=0) const =0
 
virtual void GetStateFromPDBHash (uint64_t hash, state &s, int threadID=0) const =0
 
virtual uint64_t GetAbstractHash (const state &s, int threadID=0) const =0
 
virtual state GetStateFromAbstractState (state &s) const =0
 
bool Load (FILE *f)
 
void Save (FILE *f)
 
bool Load (const char *prefix)
 
void Save (const char *prefix)
 
virtual std::string GetFileName (const char *prefix)
 
- Public Member Functions inherited from PDBHeuristic< state, action, environment, state, 8 >
 PDBHeuristic (environment *e)
 
virtual ~PDBHeuristic ()
 
void SetGoal (const state &goal)
 
void SetGoal (const std::vector< state > &goals)
 
virtual double HCost (const state &a, const state &b) const
 
virtual uint64_t GetPDBSize () const=0
 
void ShuffleValues ()
 This methods randomizes the entries in the PDB. More...
 
void BuildPDB (const state &goal)
 
void BuildPDB (const state &goal, int numThreads)
 
void BuildPDBForward (const state &goal, int numThreads, bool useCoarseOpen=true, bool verbose=false)
 
void BuildPDBForward (const std::vector< state > &goal, int numThreads, bool useCoarseOpen=true, bool verbose=false)
 
void BuildPDBBackward (const state &goal, int numThreads)
 
void BuildPDBForwardBackward (const state &goal, int numThreads)
 
void BuildAdditivePDB (const state &goal, int numThreads, bool useCourseOpen=true)
 
void DivCompress (int factor, bool print_histogram)
 
void ModCompress (int factor, bool print_histogram)
 
void ModCompress (uint64_t newEntries, bool print_histogram)
 
void ZeroLowValues (int limit)
 
void DeltaCompress (Heuristic< state > *h, state goal, bool print_histogram)
 
void FractionalDivCompress (uint64_t count, bool print_histogram)
 
void FractionalModCompress (uint64_t factor, bool print_histogram)
 
void ValueCompress (int maxValue, bool print_histogram)
 
void ValueCompress (std::vector< int > cutoffs, bool print_histogram)
 
void ValueRangeCompress (int numBits, bool print_histogram)
 
void ValueRangeCompress (PDBHeuristic< state, action, environment, state, 5 > *, bool print_histogram)
 
void ValueRangeCompress (PDBHeuristic< state, action, environment, state, 4 > *, bool print_histogram)
 
void ValueRangeCompress (PDBHeuristic< state, action, environment, state, 3 > *, bool print_histogram)
 
void ValueRangeCompress (PDBHeuristic< state, action, environment, state, 2 > *, bool print_histogram)
 
void ValueRangeCompress (PDBHeuristic< state, action, environment, state, 1 > *, bool print_histogram)
 
void CustomValueRangeCompress (std::vector< uint64_t > dist, int numBits, bool print_histogram)
 
double PrintHistogram ()
 
double GetAverageValue ()
 
void GetHistogram (std::vector< uint64_t > &histogram)
 
- Public Member Functions inherited from Heuristic< state >
 Heuristic ()
 
virtual ~Heuristic ()
 

Protected Attributes

std::vector< int > distinct
 
size_t puzzleSize
 
uint64_t pdbSize
 
state example
 

Private Member Functions

uint64_t Factorial (int val) const
 
uint64_t FactorialUpperK (int n, int k) const
 

Additional Inherited Members

- Public Attributes inherited from PDBHeuristic< state, action, environment, state, 8 >
NBitArray< pdbBits > PDB
 
int vrcValues [1<< pdbBits]
 
PDBLookupType type
 
uint64_t compressionValue
 
environment * env
 
std::vector< state > goalState
 
- Public Attributes inherited from Heuristic< state >
std::vector< HeuristicTreeNodelookups
 
std::vector< Heuristic * > heuristics
 
uint64_t histogram [256]
 

Detailed Description

template<class state, class action, class environment, int bits = 8>
class PermutationPDB< state, action, environment, bits >

This class does the basic permutation calculation with a regular N^2 permutation computation.

Definition at line 19 of file PermutationPDB.h.

Constructor & Destructor Documentation

◆ PermutationPDB()

template<class state , class action , class environment , int bits>
PermutationPDB< state, action, environment, bits >::PermutationPDB ( environment *  e,
const state &  s,
const std::vector< int > &  distincts 
)

Definition at line 47 of file PermutationPDB.h.

Member Function Documentation

◆ Factorial()

template<class state , class action , class environment , int bits = 8>
uint64_t PermutationPDB< state, action, environment, bits >::Factorial ( int  val) const
private

◆ FactorialUpperK()

template<class state , class action , class environment , int bits>
uint64_t PermutationPDB< state, action, environment, bits >::FactorialUpperK ( int  n,
int  k 
) const
private

Definition at line 155 of file PermutationPDB.h.

◆ GetAbstractHash()

template<class state , class action , class environment , int bits = 8>
virtual uint64_t PermutationPDB< state, action, environment, bits >::GetAbstractHash ( const state &  s,
int  threadID = 0 
) const
pure virtual

◆ GetFileName()

template<class state , class action , class environment , int bits>
std::string PermutationPDB< state, action, environment, bits >::GetFileName ( const char *  prefix)
virtual

◆ GetPDBHash()

template<class state , class action , class environment , int bits = 8>
virtual uint64_t PermutationPDB< state, action, environment, bits >::GetPDBHash ( const state &  s,
int  threadID = 0 
) const
pure virtual

◆ GetPDBSize()

template<class state , class action , class environment , int bits>
uint64_t PermutationPDB< state, action, environment, bits >::GetPDBSize
virtual

Definition at line 58 of file PermutationPDB.h.

◆ GetStateFromAbstractState()

template<class state , class action , class environment , int bits = 8>
virtual state PermutationPDB< state, action, environment, bits >::GetStateFromAbstractState ( state &  s) const
pure virtual

◆ GetStateFromPDBHash()

template<class state , class action , class environment , int bits = 8>
virtual void PermutationPDB< state, action, environment, bits >::GetStateFromPDBHash ( uint64_t  hash,
state &  s,
int  threadID = 0 
) const
pure virtual

◆ Load() [1/2]

template<class state , class action , class environment , int bits>
bool PermutationPDB< state, action, environment, bits >::Load ( const char *  prefix)
virtual

◆ Load() [2/2]

template<class state , class action , class environment , int bits>
bool PermutationPDB< state, action, environment, bits >::Load ( FILE *  f)
virtual

Reimplemented from PDBHeuristic< state, action, environment, state, 8 >.

Definition at line 121 of file PermutationPDB.h.

◆ Save() [1/2]

template<class state , class action , class environment , int bits>
void PermutationPDB< state, action, environment, bits >::Save ( const char *  prefix)
virtual

◆ Save() [2/2]

template<class state , class action , class environment , int bits>
void PermutationPDB< state, action, environment, bits >::Save ( FILE *  f)
virtual

Reimplemented from PDBHeuristic< state, action, environment, state, 8 >.

Definition at line 143 of file PermutationPDB.h.

Member Data Documentation

◆ distinct

template<class state , class action , class environment , int bits = 8>
std::vector<int> PermutationPDB< state, action, environment, bits >::distinct
protected

Definition at line 40 of file PermutationPDB.h.

◆ example

template<class state , class action , class environment , int bits = 8>
state PermutationPDB< state, action, environment, bits >::example
protected

Definition at line 43 of file PermutationPDB.h.

◆ pdbSize

template<class state , class action , class environment , int bits = 8>
uint64_t PermutationPDB< state, action, environment, bits >::pdbSize
protected

◆ puzzleSize

template<class state , class action , class environment , int bits = 8>
size_t PermutationPDB< state, action, environment, bits >::puzzleSize
protected

Definition at line 41 of file PermutationPDB.h.


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