HOG2
Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
RubikEdgePDB Class Reference

#include <RubiksCubeEdges.h>

Inheritance diagram for RubikEdgePDB:
Inheritance graph
[legend]
Collaboration diagram for RubikEdgePDB:
Collaboration graph
[legend]

Public Member Functions

 RubikEdgePDB (RubikEdge *e, const RubikEdgeState &s, std::vector< int > &distinctEdges)
 
uint64_t GetPDBSize () const
 
uint64_t GetPDBHash (const RubikEdgeState &s, int threadID=0) const
 
virtual uint64_t GetAbstractHash (const RubikEdgeState &s, int threadID=0) const
 
void GetStateFromPDBHash (uint64_t hash, RubikEdgeState &s, int threadID=0) const
 
RubikEdgeState GetStateFromAbstractState (RubikEdgeState &s) const
 
bool Load (const char *prefix)
 
void Save (const char *prefix)
 
bool Load (FILE *f)
 
void Save (FILE *f)
 
std::string GetFileName (const char *prefix)
 
- Public Member Functions inherited from PDBHeuristic< RubikEdgeState, RubikEdgeAction, RubikEdge, RubikEdgeState, 4 >
 PDBHeuristic (RubikEdge *e)
 
virtual ~PDBHeuristic ()
 
void SetGoal (const RubikEdgeState &goal)
 
void SetGoal (const std::vector< RubikEdgeState > &goals)
 
virtual double HCost (const RubikEdgeState &a, const RubikEdgeState &b) const
 
virtual uint64_t GetPDBSize () const=0
 
void ShuffleValues ()
 This methods randomizes the entries in the PDB. More...
 
void BuildPDB (const RubikEdgeState &goal)
 
void BuildPDB (const RubikEdgeState &goal, int numThreads)
 
void BuildPDBForward (const RubikEdgeState &goal, int numThreads, bool useCoarseOpen=true, bool verbose=false)
 
void BuildPDBForward (const std::vector< RubikEdgeState > &goal, int numThreads, bool useCoarseOpen=true, bool verbose=false)
 
void BuildPDBBackward (const RubikEdgeState &goal, int numThreads)
 
void BuildPDBForwardBackward (const RubikEdgeState &goal, int numThreads)
 
void BuildAdditivePDB (const RubikEdgeState &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< RubikEdgeState > *h, RubikEdgeState 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< RubikEdgeState, RubikEdgeAction, RubikEdge, RubikEdgeState, 5 > *, bool print_histogram)
 
void ValueRangeCompress (PDBHeuristic< RubikEdgeState, RubikEdgeAction, RubikEdge, RubikEdgeState, 4 > *, bool print_histogram)
 
void ValueRangeCompress (PDBHeuristic< RubikEdgeState, RubikEdgeAction, RubikEdge, RubikEdgeState, 3 > *, bool print_histogram)
 
void ValueRangeCompress (PDBHeuristic< RubikEdgeState, RubikEdgeAction, RubikEdge, RubikEdgeState, 2 > *, bool print_histogram)
 
void ValueRangeCompress (PDBHeuristic< RubikEdgeState, RubikEdgeAction, RubikEdge, RubikEdgeState, 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< RubikEdgeState >
 Heuristic ()
 
virtual ~Heuristic ()
 

Static Public Member Functions

static uint64_t GetStateSpaceSize ()
 
static uint64_t GetStateHash (const RubikEdgeState &s)
 
static void GetStateFromHash (RubikEdgeState &s, uint64_t hash)
 

Static Private Member Functions

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

Private Attributes

std::vector< int > edges
 
size_t puzzleSize
 
uint64_t pdbSize
 
MR1KPermutation mr1
 
std::vector< std::vector< int > > puzzles
 

Additional Inherited Members

- Public Attributes inherited from PDBHeuristic< RubikEdgeState, RubikEdgeAction, RubikEdge, RubikEdgeState, 4 >
NBitArray< pdbBits > PDB
 
int vrcValues [1<< pdbBits]
 
PDBLookupType type
 
uint64_t compressionValue
 
RubikEdgeenv
 
std::vector< RubikEdgeStategoalState
 
- Public Attributes inherited from Heuristic< RubikEdgeState >
std::vector< HeuristicTreeNodelookups
 
std::vector< Heuristic * > heuristics
 
uint64_t histogram [256]
 

Detailed Description

Definition at line 202 of file RubiksCubeEdges.h.

Constructor & Destructor Documentation

◆ RubikEdgePDB()

RubikEdgePDB::RubikEdgePDB ( RubikEdge e,
const RubikEdgeState s,
std::vector< int > &  distinctEdges 
)

Member Function Documentation

◆ Factorial()

uint64_t RubikEdgePDB::Factorial ( int  val)
staticprivate

Definition at line 1570 of file RubiksCubeEdges.cpp.

Referenced by GetStateFromHash(), and GetStateHash().

◆ FactorialUpperK()

uint64_t RubikEdgePDB::FactorialUpperK ( int  n,
int  k 
)
staticprivate

Definition at line 1581 of file RubiksCubeEdges.cpp.

Referenced by GetPDBHash(), GetPDBSize(), and GetStateFromPDBHash().

◆ GetAbstractHash()

virtual uint64_t RubikEdgePDB::GetAbstractHash ( const RubikEdgeState s,
int  threadID = 0 
) const
inlinevirtual

◆ GetFileName()

std::string RubikEdgePDB::GetFileName ( const char *  prefix)
virtual

◆ GetPDBHash()

uint64_t RubikEdgePDB::GetPDBHash ( const RubikEdgeState s,
int  threadID = 0 
) const
virtual

◆ GetPDBSize()

uint64_t RubikEdgePDB::GetPDBSize ( ) const

Definition at line 1326 of file RubiksCubeEdges.cpp.

References edges, and FactorialUpperK().

Referenced by RubikPDB::GetPDBSize().

◆ GetStateFromAbstractState()

RubikEdgeState RubikEdgePDB::GetStateFromAbstractState ( RubikEdgeState s) const
inlinevirtual

◆ GetStateFromHash()

void RubikEdgePDB::GetStateFromHash ( RubikEdgeState s,
uint64_t  hash 
)
static

◆ GetStateFromPDBHash()

void RubikEdgePDB::GetStateFromPDBHash ( uint64_t  hash,
RubikEdgeState s,
int  threadID = 0 
) const
virtual

◆ GetStateHash()

uint64_t RubikEdgePDB::GetStateHash ( const RubikEdgeState s)
static

◆ GetStateSpaceSize()

uint64_t RubikEdgePDB::GetStateSpaceSize ( )
static

Definition at line 1270 of file RubiksCubeEdges.cpp.

◆ Load() [1/2]

bool RubikEdgePDB::Load ( const char *  prefix)
virtual

◆ Load() [2/2]

bool RubikEdgePDB::Load ( FILE *  f)
virtual

◆ Save() [1/2]

void RubikEdgePDB::Save ( const char *  prefix)
virtual

◆ Save() [2/2]

void RubikEdgePDB::Save ( FILE *  f)
virtual

Member Data Documentation

◆ edges

std::vector<int> RubikEdgePDB::edges
private

Definition at line 222 of file RubiksCubeEdges.h.

Referenced by GetFileName(), GetPDBHash(), GetPDBSize(), GetStateFromPDBHash(), Load(), and Save().

◆ mr1

MR1KPermutation RubikEdgePDB::mr1
private

Definition at line 225 of file RubiksCubeEdges.h.

Referenced by GetPDBHash(), and GetStateFromPDBHash().

◆ pdbSize

uint64_t RubikEdgePDB::pdbSize
private

Definition at line 224 of file RubiksCubeEdges.h.

Referenced by Load(), and Save().

◆ puzzles

std::vector<std::vector<int> > RubikEdgePDB::puzzles
mutableprivate

Definition at line 227 of file RubiksCubeEdges.h.

Referenced by RubikEdgePDB().

◆ puzzleSize

size_t RubikEdgePDB::puzzleSize
private

Definition at line 223 of file RubiksCubeEdges.h.

Referenced by Load(), and Save().


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