HOG2
|
#include <RubiksCube.h>
Public Member Functions | |
RubiksCube () | |
~RubiksCube () | |
std::string | GetName () |
void | SetPruneSuccessors (bool val) |
virtual void | GetSuccessors (const RubiksState &nodeID, std::vector< RubiksState > &neighbors) const |
virtual void | GetActions (const RubiksState &nodeID, std::vector< RubiksAction > &actions) const |
virtual void | GetPrunedActions (const RubiksState &nodeID, RubiksAction lastAction, std::vector< RubiksAction > &actions) const |
virtual RubiksAction | GetAction (const RubiksState &s1, const RubiksState &s2) const |
virtual void | ApplyAction (RubiksState &s, RubiksAction a) const |
virtual void | UndoAction (RubiksState &s, RubiksAction a) const |
virtual void | GetNextState (const RubiksState &, RubiksAction, RubiksState &) const |
virtual bool | InvertAction (RubiksAction &a) const |
virtual double | HCost (const RubiksState &node1, const RubiksState &node2) const |
Heuristic value between two arbitrary nodes. More... | |
virtual double | HCost (const RubiksState &node1, const RubiksState &node2, double parentHCost) const |
int | Edge12PDBDist (const RubiksState &s) |
virtual double | HCost (const RubiksState &node) const |
Heuristic value between node and the stored goal. More... | |
virtual double | GCost (const RubiksState &node1, const RubiksState &node2) const |
virtual double | GCost (const RubiksState &node, const RubiksAction &act) const |
virtual bool | GoalTest (const RubiksState &node, const RubiksState &goal) const |
virtual bool | GoalTest (const RubiksState &node) const |
Goal Test if the goal is stored. More... | |
virtual uint64_t | GetStateHash (const RubiksState &node) const |
virtual uint64_t | GetCornerHash (const RubiksState &node) const |
virtual uint64_t | GetEdgeHash (const RubiksState &node) const |
virtual uint64_t | GetActionHash (RubiksAction act) const |
virtual void | GetStateFromHash (uint64_t hash, RubiksState &node) const |
virtual void | GetStateFromHash (uint64_t cornerHash, uint64_t edgeHash, RubiksState &node) const |
virtual void | OpenGLDraw () const |
virtual void | OpenGLDraw (const RubiksState &) const |
virtual void | OpenGLDrawCorners (const RubiksState &) const |
virtual void | OpenGLDrawEdges (const RubiksState &) const |
virtual void | OpenGLDrawEdgeDual (const RubiksState &) const |
virtual void | OpenGLDrawCenters () const |
virtual void | OpenGLDrawCubeBackground () const |
virtual void | OpenGLDraw (const RubiksState &, const RubiksState &, float) const |
Draw the transition at some percentage 0...1 between two states. More... | |
virtual void | OpenGLDraw (const RubiksState &, const RubiksAction &) const |
void | OpenGLDrawCube (int cube) const |
void | SetFaceColor (int face) const |
Public Member Functions inherited from SearchEnvironment< RubiksState, RubiksAction > | |
virtual | ~SearchEnvironment () |
virtual int | GetNumSuccessors (const RubiksState &stateID) const |
virtual void | StoreGoal (RubiksState &s) |
Stores the goal for use by single-state HCost. More... | |
virtual void | ClearGoal () |
Clears the goal from memory. More... | |
virtual bool | IsGoalStored () const |
Returns true if the goal is stored and false otherwise. More... | |
virtual uint64_t | GetMaxHash () const |
virtual double | GetPathLength (std::vector< RubiksState > &neighbors) |
virtual double | GetPathLength (const RubiksState &start, std::vector< RubiksAction > &neighbors) |
virtual OccupancyInterface< RubiksState, RubiksAction > * | GetOccupancyInfo () |
virtual void | SetOccupancyInfo (OccupancyInterface< RubiksState, RubiksAction > *) |
virtual void | OpenGLDraw () const |
virtual void | GLLabelState (const RubiksState &, const char *) const |
virtual void | GLDrawLine (const RubiksState &x, const RubiksState &y) const |
virtual void | GLDrawPath (const std::vector< RubiksState > &x) const |
virtual void | SetColor (const rgbColor &r) const |
virtual void | SetColor (GLfloat rr, GLfloat g, GLfloat b, GLfloat t=1.0) const |
virtual void | GetColor (GLfloat &rr, GLfloat &g, GLfloat &b, GLfloat &t) const |
virtual rgbColor | GetColor () const |
virtual void | Draw (Graphics::Display &display) const |
virtual void | Draw (Graphics::Display &display, const RubiksState &) const |
virtual void | DrawLine (Graphics::Display &display, const RubiksState &x, const RubiksState &y, float width=1.0) const |
Public Member Functions inherited from Heuristic< RubiksState > | |
Heuristic () | |
virtual | ~Heuristic () |
Public Attributes | |
int | compressionFactor |
bool | minCompression |
bool | bloomFilter |
bool | minBloomFilter |
std::vector< uint64_t > | edgeDist |
std::vector< uint64_t > | cornDist |
std::unordered_map< uint64_t, uint8_t > | depthTable |
BloomFilter * | depth8 |
BloomFilter * | depth9 |
MinBloomFilter * | minBloom |
std::vector< RubiksAction > | history |
RubiksCorner | c |
RubikEdge | e |
RubikEdgeState | dual |
Rubik7EdgeState | e7dual |
Rubik7Edge | e7 |
DiskBitFile * | f |
std::vector< bucketInfo > | data |
std::vector< bucketData > | buckets |
bool | pruneSuccessors |
Public Attributes inherited from Heuristic< RubiksState > | |
std::vector< HeuristicTreeNode > | lookups |
std::vector< Heuristic * > | heuristics |
uint64_t | histogram [256] |
Additional Inherited Members | |
Protected Attributes inherited from SearchEnvironment< RubiksState, RubiksAction > | |
bool | bValidSearchGoal |
RubiksState | searchGoal |
rgbColor | color |
GLfloat | transparency |
Definition at line 106 of file RubiksCube.h.
|
inline |
Definition at line 109 of file RubiksCube.h.
References bloomFilter, buckets, cornDist, data, depth8, depth9, edgeDist, f, minCompression, and pruneSuccessors.
|
inline |
Definition at line 133 of file RubiksCube.h.
|
virtual |
Implements SearchEnvironment< RubiksState, RubiksAction >.
Definition at line 86 of file RubiksCube.cpp.
References RubiksCorner::ApplyAction(), RubikEdge::ApplyAction(), c, RubiksState::corner, e, RubiksState::edge, history, and pruneSuccessors.
Referenced by RubiksCubeInstances::GetDepth20(), RubiksCubeInstances::GetKorfRubikInstance(), GetNextState(), RubiksCubeInstances::GetRandomN(), and RubiksCubeInstances::GetSuperFlip().
int RubiksCube::Edge12PDBDist | ( | const RubiksState & | s | ) |
Definition at line 813 of file RubiksCube.cpp.
References data, e, RubiksState::edge, f, RubikEdge::rankPlayer(), and DiskBitFile::ReadFileDepth().
|
inlinevirtual |
Implements SearchEnvironment< RubiksState, RubiksAction >.
Definition at line 157 of file RubiksCube.h.
|
inlinevirtual |
Implements SearchEnvironment< RubiksState, RubiksAction >.
Definition at line 156 of file RubiksCube.h.
|
virtual |
Reimplemented from SearchEnvironment< RubiksState, RubiksAction >.
Definition at line 71 of file RubiksCube.cpp.
References GetNextState().
Referenced by OpenGLDraw().
|
inlinevirtual |
Implements SearchEnvironment< RubiksState, RubiksAction >.
Definition at line 167 of file RubiksCube.h.
|
virtual |
Implements SearchEnvironment< RubiksState, RubiksAction >.
Definition at line 43 of file RubiksCube.cpp.
References history, and pruneSuccessors.
Referenced by RubiksCubeInstances::GetRandomN().
|
virtual |
Definition at line 418 of file RubiksCube.cpp.
References c, and RubiksCorner::GetStateHash().
|
virtual |
Definition at line 423 of file RubiksCube.cpp.
References e, and RubikEdge::GetStateHash().
|
inline |
Definition at line 134 of file RubiksCube.h.
|
virtual |
Reimplemented from SearchEnvironment< RubiksState, RubiksAction >.
Definition at line 109 of file RubiksCube.cpp.
References ApplyAction().
Referenced by GetAction(), and GetSuccessors().
|
virtual |
Definition at line 24 of file RubiksCube.cpp.
|
virtual |
Definition at line 428 of file RubiksCube.cpp.
References c, e, RubiksCorner::GetStateFromHash(), and RubikEdge::GetStateFromHash().
|
virtual |
Reimplemented from SearchEnvironment< RubiksState, RubiksAction >.
Definition at line 434 of file RubiksCube.cpp.
References c, e, RubikEdge::getMaxSinglePlayerRank(), RubiksCorner::GetStateFromHash(), and RubikEdge::GetStateFromHash().
|
virtual |
Implements SearchEnvironment< RubiksState, RubiksAction >.
Definition at line 410 of file RubiksCube.cpp.
References c, e, RubikEdge::getMaxSinglePlayerRank(), RubiksCorner::GetStateHash(), and RubikEdge::GetStateHash().
|
virtual |
Implements SearchEnvironment< RubiksState, RubiksAction >.
Definition at line 15 of file RubiksCube.cpp.
References GetNextState().
|
virtual |
Goal Test if the goal is stored.
Reimplemented from SearchEnvironment< RubiksState, RubiksAction >.
Definition at line 404 of file RubiksCube.cpp.
|
virtual |
Implements SearchEnvironment< RubiksState, RubiksAction >.
Definition at line 397 of file RubiksCube.cpp.
References RubiksState::corner, and RubiksState::edge.
|
virtual |
Heuristic value between node and the stored goal.
Asserts that the goal is stored
Reimplemented from SearchEnvironment< RubiksState, RubiksAction >.
Definition at line 392 of file RubiksCube.cpp.
References HCost().
|
virtual |
Heuristic value between two arbitrary nodes.
Implements SearchEnvironment< RubiksState, RubiksAction >.
Definition at line 290 of file RubiksCube.cpp.
Referenced by HCost().
|
virtual |
Reimplemented from SearchEnvironment< RubiksState, RubiksAction >.
Definition at line 153 of file RubiksCube.cpp.
References HCost().
|
virtual |
Implements SearchEnvironment< RubiksState, RubiksAction >.
Definition at line 115 of file RubiksCube.cpp.
Referenced by UndoAction().
|
virtual |
Definition at line 440 of file RubiksCube.cpp.
Referenced by RubikPDB::OpenGLDraw().
|
virtual |
Reimplemented from SearchEnvironment< RubiksState, RubiksAction >.
Definition at line 444 of file RubiksCube.cpp.
References c, RubiksState::corner, e, RubiksState::edge, RubiksCorner::OpenGLDraw(), RubikEdge::OpenGLDraw(), OpenGLDrawCenters(), and OpenGLDrawCubeBackground().
|
virtual |
Reimplemented from SearchEnvironment< RubiksState, RubiksAction >.
Definition at line 808 of file RubiksCube.cpp.
|
virtual |
Draw the transition at some percentage 0...1 between two states.
Reimplemented from SearchEnvironment< RubiksState, RubiksAction >.
Definition at line 650 of file RubiksCube.cpp.
References c, RubiksState::corner, e, RubiksState::edge, GetAction(), RubiksCorner::OpenGLDrawCube(), RubikEdge::OpenGLDrawCube(), and OpenGLDrawCube().
|
virtual |
Definition at line 522 of file RubiksCube.cpp.
References OpenGLDrawCube().
Referenced by OpenGLDraw(), OpenGLDrawCorners(), OpenGLDrawEdgeDual(), and OpenGLDrawEdges().
|
virtual |
Definition at line 452 of file RubiksCube.cpp.
References c, RubiksState::corner, RubiksCorner::OpenGLDraw(), OpenGLDrawCenters(), and OpenGLDrawCubeBackground().
void RubiksCube::OpenGLDrawCube | ( | int | cube | ) | const |
Definition at line 534 of file RubiksCube.cpp.
References SetFaceColor().
Referenced by OpenGLDraw(), and OpenGLDrawCenters().
|
virtual |
Definition at line 476 of file RubiksCube.cpp.
Referenced by OpenGLDraw(), OpenGLDrawCorners(), OpenGLDrawEdgeDual(), and OpenGLDrawEdges().
|
virtual |
Definition at line 468 of file RubiksCube.cpp.
References dual, e, RubiksState::edge, RubikEdgeStateArray::GetDual(), RubikEdge::OpenGLDraw(), OpenGLDrawCenters(), and OpenGLDrawCubeBackground().
|
virtual |
Definition at line 459 of file RubiksCube.cpp.
References e, RubiksState::edge, RubikEdge::OpenGLDraw(), OpenGLDrawCenters(), and OpenGLDrawCubeBackground().
void RubiksCube::SetFaceColor | ( | int | face | ) | const |
Definition at line 633 of file RubiksCube.cpp.
Referenced by OpenGLDrawCube().
|
inline |
Definition at line 135 of file RubiksCube.h.
References history, and pruneSuccessors.
Referenced by RubiksCubeInstances::GetRandomN().
|
virtual |
Reimplemented from SearchEnvironment< RubiksState, RubiksAction >.
Definition at line 95 of file RubiksCube.cpp.
References RubiksCorner::ApplyAction(), RubikEdge::ApplyAction(), c, RubiksState::corner, e, RubiksState::edge, history, InvertAction(), and pruneSuccessors.
bool RubiksCube::bloomFilter |
Definition at line 189 of file RubiksCube.h.
Referenced by RubiksCube().
std::vector<bucketData> RubiksCube::buckets |
Definition at line 213 of file RubiksCube.h.
Referenced by RubiksCube().
RubiksCorner RubiksCube::c |
Definition at line 200 of file RubiksCube.h.
Referenced by ApplyAction(), GetCornerHash(), GetStateFromHash(), GetStateHash(), OpenGLDraw(), OpenGLDrawCorners(), and UndoAction().
int RubiksCube::compressionFactor |
Definition at line 187 of file RubiksCube.h.
std::vector<uint64_t> RubiksCube::cornDist |
Definition at line 192 of file RubiksCube.h.
Referenced by RubiksCube().
std::vector<bucketInfo> RubiksCube::data |
Definition at line 212 of file RubiksCube.h.
Referenced by Edge12PDBDist(), and RubiksCube().
BloomFilter* RubiksCube::depth8 |
Definition at line 194 of file RubiksCube.h.
Referenced by RubiksCube().
BloomFilter * RubiksCube::depth9 |
Definition at line 194 of file RubiksCube.h.
Referenced by RubiksCube().
std::unordered_map<uint64_t, uint8_t> RubiksCube::depthTable |
Definition at line 193 of file RubiksCube.h.
|
mutable |
Definition at line 202 of file RubiksCube.h.
Referenced by OpenGLDrawEdgeDual().
RubikEdge RubiksCube::e |
Definition at line 201 of file RubiksCube.h.
Referenced by ApplyAction(), Edge12PDBDist(), GetEdgeHash(), GetStateFromHash(), GetStateHash(), OpenGLDraw(), OpenGLDrawEdgeDual(), OpenGLDrawEdges(), and UndoAction().
Rubik7Edge RubiksCube::e7 |
Definition at line 204 of file RubiksCube.h.
|
mutable |
Definition at line 203 of file RubiksCube.h.
std::vector<uint64_t> RubiksCube::edgeDist |
Definition at line 191 of file RubiksCube.h.
Referenced by RubiksCube().
DiskBitFile* RubiksCube::f |
Definition at line 211 of file RubiksCube.h.
Referenced by Edge12PDBDist(), and RubiksCube().
|
mutable |
Definition at line 199 of file RubiksCube.h.
Referenced by ApplyAction(), GetActions(), SetPruneSuccessors(), and UndoAction().
MinBloomFilter* RubiksCube::minBloom |
Definition at line 195 of file RubiksCube.h.
bool RubiksCube::minBloomFilter |
Definition at line 190 of file RubiksCube.h.
bool RubiksCube::minCompression |
Definition at line 188 of file RubiksCube.h.
Referenced by RubiksCube().
bool RubiksCube::pruneSuccessors |
Definition at line 215 of file RubiksCube.h.
Referenced by ApplyAction(), GetActions(), RubiksCube(), SetPruneSuccessors(), and UndoAction().