Go to the documentation of this file.
9 #ifndef __hog2_glut__RubiksCube__
10 #define __hog2_glut__RubiksCube__
14 #include <unordered_map>
50 return std::hash<RubikEdgeState>{}(x.
edge)^(std::hash<RubiksCornerState>{}(x.
corner)<<2);
68 out <<
"{" << s.
edge <<
", " << s.
corner <<
"}";
118 uint64_t maxBuckSize = GetMaxBucketSize<RubikEdge, RubikEdgeState>(
false);
119 InitTwoPieceData<RubikEdge, RubikEdgeState>(
data, maxBuckSize);
120 InitBucketSize<RubikEdge, RubikEdgeState>(
buckets, maxBuckSize);
134 std::string
GetName() {
return "Rubiks Cube"; }
240 bool Load(
const char *prefix);
241 void Save(
const char *prefix);
virtual bool GoalTest(const RubiksState &node, const RubiksState &goal) const
static bool operator!=(const RubiksState &l1, const RubiksState &l2)
virtual uint64_t GetCornerHash(const RubiksState &node) const
std::vector< bucketData > buckets
void OpenGLDrawCube(int cube) const
RubikArbitraryGoalPDB(RubikPDB *pdb)
std::vector< bucketInfo > data
static bool operator==(const RubiksState &l1, const RubiksState &l2)
virtual void OpenGLDrawCorners(const RubiksState &) const
virtual void GetNextState(const RubiksState &, RubiksAction, RubiksState &) const
virtual void UndoAction(RubiksState &s, RubiksAction a) const
virtual void OpenGLDrawEdgeDual(const RubiksState &) const
virtual void GetPrunedActions(const RubiksState &nodeID, RubiksAction lastAction, std::vector< RubiksAction > &actions) const
void Save(const char *prefix)
virtual double HCost(const RubiksState &a, const RubiksState &b) const
virtual uint64_t GetEdgeHash(const RubiksState &node) const
virtual double GCost(const RubiksState &node, const RubiksAction &act) const
std::vector< uint64_t > edgeDist
std::vector< int > corners
RubikPDB(RubiksCube *e, const RubiksState &s, std::vector< int > distinctEdges, std::vector< int > distinctCorners)
RubikDualPDB(RubikPDB *pdb)
uint64_t GetPDBHash(const RubiksState &s, int threadID=0) const
virtual uint64_t GetAbstractHash(const RubiksState &s, int threadID=0) const
std::vector< RubiksAction > history
MinBloomFilter * minBloom
virtual double HCost(const RubiksState &a, const RubiksState &b) const
size_t operator()(const RubiksState &x) const
static std::ostream & operator<<(std::ostream &out, const RubiksState &s)
void SetPruneSuccessors(bool val)
virtual double HCost(const RubiksState &node1, const RubiksState &node2) const
Heuristic value between two arbitrary nodes.
virtual uint64_t GetActionHash(RubiksAction act) const
virtual uint64_t GetStateHash(const RubiksState &node) const
virtual bool InvertAction(RubiksAction &a) const
virtual void OpenGLDrawCenters() const
virtual RubiksAction GetAction(const RubiksState &s1, const RubiksState &s2) const
int Edge12PDBDist(const RubiksState &s)
uint64_t GetPDBSize() const
virtual void GetStateFromHash(uint64_t hash, RubiksState &node) const
std::string GetFileName(const char *prefix)
virtual void GetSuccessors(const RubiksState &nodeID, std::vector< RubiksState > &neighbors) const
uint64_t GetStateHash(const RubiksState &s) const
virtual double GCost(const RubiksState &node1, const RubiksState &node2) const
bool Load(const char *prefix)
std::vector< uint64_t > cornDist
virtual void OpenGLDraw() const
std::unordered_map< uint64_t, uint8_t > depthTable
virtual void ApplyAction(RubiksState &s, RubiksAction a) const
void GetStateFromPDBHash(uint64_t hash, RubiksState &s, int threadID=0) const
void SetFaceColor(int face) const
void GetStateFromHash(RubiksState &s, uint64_t hash) const
virtual void OpenGLDrawCubeBackground() const
RubiksState GetStateFromAbstractState(RubiksState &s) const
Nodes to be stored within a Graph.
virtual void GetActions(const RubiksState &nodeID, std::vector< RubiksAction > &actions) const
Edge class for connections between node in a Graph.
virtual void OpenGLDrawEdges(const RubiksState &) const