HOG2
|
#include <RubiksCubeCorners.h>
Public Member Functions | |
RubiksCorner () | |
~RubiksCorner () | |
virtual void | GetSuccessors (const RubiksCornerState &nodeID, std::vector< RubiksCornerState > &neighbors) const |
virtual void | GetActions (const RubiksCornerState &nodeID, std::vector< RubiksCornersAction > &actions) const |
virtual RubiksCornersAction | GetAction (const RubiksCornerState &s1, const RubiksCornerState &s2) const |
virtual void | ApplyAction (RubiksCornerState &s, RubiksCornersAction a) const |
void | ApplyMove (RubiksCornerState &s, RubikCornerMove *a) |
void | UndoMove (RubiksCornerState &s, RubikCornerMove *a) |
void | unrankPlayer (uint64_t d, RubiksCornerState &s, int who) |
int64_t | getMaxSinglePlayerRank () |
int64_t | getMaxSinglePlayerRank2 () |
int64_t | getMaxSinglePlayerRank2 (int64_t firstIndex) |
RubikCornerMove * | getMoves (RubiksCornerState &) |
void | freeMove (RubikCornerMove *m) |
int64_t | rankPlayer (RubiksCornerState &s, int who) |
void | rankPlayerFirstTwo (const RubiksCornerState &s, int who, int64_t &rank) |
void | rankPlayerRemaining (const RubiksCornerState &s, int who, int64_t &rank) |
void | rankPlayer (RubiksCornerState &s, int who, int64_t &index1, int64_t &index2) |
virtual void | GetNextState (const RubiksCornerState &, RubiksCornersAction, RubiksCornerState &) const |
virtual bool | InvertAction (RubiksCornersAction &a) const |
virtual double | HCost (const RubiksCornerState &node1, const RubiksCornerState &node2) const |
Heuristic value between two arbitrary nodes. More... | |
virtual double | HCost (const RubiksCornerState &node) const |
Heuristic value between node and the stored goal. More... | |
virtual double | GCost (const RubiksCornerState &node1, const RubiksCornerState &node2) const |
virtual double | GCost (const RubiksCornerState &node, const RubiksCornersAction &act) const |
virtual bool | GoalTest (const RubiksCornerState &node, const RubiksCornerState &goal) const |
virtual bool | GoalTest (const RubiksCornerStateBits &node) const |
Goal Test if the goal is stored. More... | |
virtual bool | GoalTest (const RubiksCornerStateArray &node) const |
Goal Test if the goal is stored. More... | |
uint64_t | GetStateHash (const RubiksCornerState &node) const |
void | GetStateFromHash (uint64_t hash, RubiksCornerState &node) const |
virtual uint64_t | GetActionHash (RubiksCornersAction act) const |
virtual void | OpenGLDraw () const |
virtual void | OpenGLDraw (const RubiksCornerState &) const |
virtual void | OpenGLDraw (const RubiksCornerState &, const RubiksCornerState &, float) const |
Draw the transition at some percentage 0...1 between two states. More... | |
virtual void | OpenGLDraw (const RubiksCornerState &, const RubiksCornersAction &) const |
void | OpenGLDrawCube (const RubiksCornerState &s, int cube) const |
Public Member Functions inherited from SearchEnvironment< RubiksCornerState, RubiksCornersAction > | |
virtual | ~SearchEnvironment () |
virtual int | GetNumSuccessors (const RubiksCornerState &stateID) const |
virtual void | UndoAction (RubiksCornerState &s, RubiksCornersAction a) const |
virtual void | StoreGoal (RubiksCornerState &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 double | HCost (const RubiksCornerState &node1, const RubiksCornerState &node2, double parentHCost) const |
virtual uint64_t | GetMaxHash () const |
virtual double | GetPathLength (std::vector< RubiksCornerState > &neighbors) |
virtual double | GetPathLength (const RubiksCornerState &start, std::vector< RubiksCornersAction > &neighbors) |
virtual OccupancyInterface< RubiksCornerState, RubiksCornersAction > * | GetOccupancyInfo () |
virtual void | SetOccupancyInfo (OccupancyInterface< RubiksCornerState, RubiksCornersAction > *) |
virtual void | OpenGLDraw () const |
virtual void | GLLabelState (const RubiksCornerState &, const char *) const |
virtual void | GLDrawLine (const RubiksCornerState &x, const RubiksCornerState &y) const |
virtual void | GLDrawPath (const std::vector< RubiksCornerState > &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 RubiksCornerState &) const |
virtual void | DrawLine (Graphics::Display &display, const RubiksCornerState &x, const RubiksCornerState &y, float width=1.0) const |
Public Member Functions inherited from Heuristic< RubiksCornerState > | |
Heuristic () | |
virtual | ~Heuristic () |
Private Member Functions | |
void | SetFaceColor (int face, const RubiksCornerState &) const |
Static Private Member Functions | |
static uint64_t | MRRank (int n, uint64_t perm, uint64_t dual) |
static void | MRUnrank2 (int n, uint64_t r, uint64_t &perm) |
Private Attributes | |
RubikCornerMove | moves [18] |
Additional Inherited Members | |
Public Attributes inherited from Heuristic< RubiksCornerState > | |
std::vector< HeuristicTreeNode > | lookups |
std::vector< Heuristic * > | heuristics |
uint64_t | histogram [256] |
Protected Attributes inherited from SearchEnvironment< RubiksCornerState, RubiksCornersAction > | |
bool | bValidSearchGoal |
RubiksCornerState | searchGoal |
rgbColor | color |
GLfloat | transparency |
Definition at line 114 of file RubiksCubeCorners.h.
|
inline |
Definition at line 117 of file RubiksCubeCorners.h.
References RubikCornerMove::act, moves, and RubikCornerMove::next.
|
inline |
Definition at line 127 of file RubiksCubeCorners.h.
|
virtual |
Implements SearchEnvironment< RubiksCornerState, RubiksCornersAction >.
Definition at line 315 of file RubiksCubeCorners.cpp.
References RubiksCornerStateArray::GetCubeInLoc(), RubiksCornerStateArray::GetCubeOrientation(), RubiksCornerStateArray::Rotate(), RubiksCornerStateArray::SetCubeOrientation(), and RubiksCornerStateArray::Swap().
Referenced by RubiksCube::ApplyAction(), ApplyMove(), GetNextState(), RubiksCube::UndoAction(), and UndoMove().
void RubiksCorner::ApplyMove | ( | RubiksCornerState & | s, |
RubikCornerMove * | a | ||
) |
Definition at line 494 of file RubiksCubeCorners.cpp.
References RubikCornerMove::act, and ApplyAction().
|
inline |
Definition at line 145 of file RubiksCubeCorners.h.
|
inlinevirtual |
Implements SearchEnvironment< RubiksCornerState, RubiksCornersAction >.
Definition at line 168 of file RubiksCubeCorners.h.
|
inlinevirtual |
Implements SearchEnvironment< RubiksCornerState, RubiksCornersAction >.
Definition at line 167 of file RubiksCubeCorners.h.
|
virtual |
Reimplemented from SearchEnvironment< RubiksCornerState, RubiksCornersAction >.
Definition at line 308 of file RubiksCubeCorners.cpp.
|
inlinevirtual |
Implements SearchEnvironment< RubiksCornerState, RubiksCornersAction >.
Definition at line 177 of file RubiksCubeCorners.h.
|
virtual |
Implements SearchEnvironment< RubiksCornerState, RubiksCornersAction >.
Definition at line 299 of file RubiksCubeCorners.cpp.
int64_t RubiksCorner::getMaxSinglePlayerRank | ( | ) |
Definition at line 512 of file RubiksCubeCorners.cpp.
int64_t RubiksCorner::getMaxSinglePlayerRank2 | ( | ) |
Definition at line 522 of file RubiksCubeCorners.cpp.
int64_t RubiksCorner::getMaxSinglePlayerRank2 | ( | int64_t | firstIndex | ) |
Definition at line 526 of file RubiksCubeCorners.cpp.
|
inline |
Definition at line 144 of file RubiksCubeCorners.h.
References moves.
|
virtual |
Reimplemented from SearchEnvironment< RubiksCornerState, RubiksCornersAction >.
Definition at line 460 of file RubiksCubeCorners.cpp.
References ApplyAction().
Referenced by GetSuccessors().
|
virtual |
Reimplemented from SearchEnvironment< RubiksCornerState, RubiksCornersAction >.
Definition at line 670 of file RubiksCubeCorners.cpp.
References bits(), Factorial(), get(), MRUnrank2(), and set().
Referenced by RubiksCube::GetStateFromHash(), RubikCornerPDB::GetStateFromHash(), and unrankPlayer().
|
virtual |
Implements SearchEnvironment< RubiksCornerState, RubiksCornersAction >.
Definition at line 586 of file RubiksCubeCorners.cpp.
References Factorial(), MRRank(), and set().
Referenced by RubiksCube::GetCornerHash(), RubiksCube::GetStateHash(), RubikCornerPDB::GetStateHash(), and rankPlayer().
|
virtual |
Implements SearchEnvironment< RubiksCornerState, RubiksCornersAction >.
Definition at line 289 of file RubiksCubeCorners.cpp.
References GetNextState().
|
inlinevirtual |
Implements SearchEnvironment< RubiksCornerState, RubiksCornersAction >.
Definition at line 169 of file RubiksCubeCorners.h.
References GoalTest().
Referenced by GoalTest().
|
virtual |
Goal Test if the goal is stored.
Reimplemented from SearchEnvironment< RubiksCornerState, RubiksCornersAction >.
Definition at line 486 of file RubiksCubeCorners.cpp.
|
virtual |
Goal Test if the goal is stored.
Definition at line 481 of file RubiksCubeCorners.cpp.
|
inlinevirtual |
Heuristic value between node and the stored goal.
Asserts that the goal is stored
Reimplemented from SearchEnvironment< RubiksCornerState, RubiksCornersAction >.
Definition at line 164 of file RubiksCubeCorners.h.
|
inlinevirtual |
Heuristic value between two arbitrary nodes.
Implements SearchEnvironment< RubiksCornerState, RubiksCornersAction >.
Definition at line 160 of file RubiksCubeCorners.h.
|
virtual |
Implements SearchEnvironment< RubiksCornerState, RubiksCornersAction >.
Definition at line 467 of file RubiksCubeCorners.cpp.
|
staticprivate |
Definition at line 640 of file RubiksCubeCorners.cpp.
Referenced by GetStateHash(), and rankPlayerRemaining().
|
staticprivate |
Definition at line 731 of file RubiksCubeCorners.cpp.
References swap().
Referenced by GetStateFromHash().
|
virtual |
Definition at line 741 of file RubiksCubeCorners.cpp.
Referenced by RubiksCube::OpenGLDraw(), and RubiksCube::OpenGLDrawCorners().
|
virtual |
Reimplemented from SearchEnvironment< RubiksCornerState, RubiksCornersAction >.
Definition at line 746 of file RubiksCubeCorners.cpp.
References OpenGLDrawCube().
|
virtual |
Reimplemented from SearchEnvironment< RubiksCornerState, RubiksCornersAction >.
Definition at line 1125 of file RubiksCubeCorners.cpp.
|
virtual |
Draw the transition at some percentage 0...1 between two states.
Reimplemented from SearchEnvironment< RubiksCornerState, RubiksCornersAction >.
Definition at line 1120 of file RubiksCubeCorners.cpp.
void RubiksCorner::OpenGLDrawCube | ( | const RubiksCornerState & | s, |
int | cube | ||
) | const |
Definition at line 766 of file RubiksCubeCorners.cpp.
References SetFaceColor().
Referenced by OpenGLDraw(), and RubiksCube::OpenGLDraw().
|
inline |
Definition at line 147 of file RubiksCubeCorners.h.
References GetStateHash().
|
inline |
Definition at line 151 of file RubiksCubeCorners.h.
References rankPlayerFirstTwo(), and rankPlayerRemaining().
void RubiksCorner::rankPlayerFirstTwo | ( | const RubiksCornerState & | s, |
int | who, | ||
int64_t & | rank | ||
) |
Definition at line 531 of file RubiksCubeCorners.cpp.
References RubiksCornerStateArray::GetCubeOrientation().
Referenced by rankPlayer().
void RubiksCorner::rankPlayerRemaining | ( | const RubiksCornerState & | s, |
int | who, | ||
int64_t & | rank | ||
) |
Definition at line 536 of file RubiksCubeCorners.cpp.
References Factorial(), MRRank(), and set().
Referenced by rankPlayer().
|
private |
Definition at line 1130 of file RubiksCubeCorners.cpp.
References RubiksCornerStateArray::GetFaceInLoc().
Referenced by OpenGLDrawCube().
void RubiksCorner::UndoMove | ( | RubiksCornerState & | s, |
RubikCornerMove * | a | ||
) |
Definition at line 498 of file RubiksCubeCorners.cpp.
References RubikCornerMove::act, and ApplyAction().
|
inline |
Definition at line 135 of file RubiksCubeCorners.h.
References d, and GetStateFromHash().
|
private |
Definition at line 191 of file RubiksCubeCorners.h.
Referenced by getMoves(), and RubiksCorner().