HOG2
|
#include <RubiksCubeEdges.h>
Public Member Functions | |
RubikEdge () | |
~RubikEdge () | |
virtual void | GetSuccessors (const RubikEdgeState &nodeID, std::vector< RubikEdgeState > &neighbors) const |
virtual void | GetActions (const RubikEdgeState &nodeID, std::vector< RubikEdgeAction > &actions) const |
virtual RubikEdgeAction | GetAction (const RubikEdgeState &s1, const RubikEdgeState &s2) const |
virtual void | ApplyAction (RubikEdgeStateArray &s, RubikEdgeAction a) const |
virtual void | UndoAction (RubikEdgeStateArray &s, RubikEdgeAction a) const |
virtual void | ApplyAction (RubikEdgeStateBits &s, RubikEdgeAction a) const |
virtual void | UndoAction (RubikEdgeStateBits &s, RubikEdgeAction a) const |
virtual double | HCost (const RubikEdgeState &node1, const RubikEdgeState &node2) const |
Heuristic value between two arbitrary nodes. More... | |
virtual double | GCost (const RubikEdgeState &node1, const RubikEdgeState &node2) const |
virtual double | GCost (const RubikEdgeState &node, const RubikEdgeAction &act) const |
virtual bool | GoalTest (const RubikEdgeState &node, const RubikEdgeState &goal) const |
bool | GoalTest (const RubikEdgeStateBits &) const |
bool | GoalTest (const RubikEdgeStateArray &) const |
Goal Test if the goal is stored. More... | |
void | ApplyMove (RubikEdgeState &s, RubikEdgeMove *a) |
void | UndoMove (RubikEdgeState &s, RubikEdgeMove *a) |
void | unrankPlayer (uint64_t d, RubikEdgeState &s, int who) |
int64_t | getMaxSinglePlayerRank () const |
int64_t | getMaxSinglePlayerRank2 () |
int64_t | getMaxSinglePlayerRank2 (int64_t firstIndex) |
RubikEdgeMove * | getMoves (RubikEdgeState &) |
void | freeMove (RubikEdgeMove *m) |
virtual void | GetNextState (const RubikEdgeState &, RubikEdgeAction, RubikEdgeState &) const |
virtual bool | InvertAction (RubikEdgeAction &a) const |
int64_t | rankPlayer (RubikEdgeState &s, int who) |
void | rankPlayerFirstTwo (const RubikEdgeState &s, int who, int64_t &rank) |
void | rankPlayerRemaining (const RubikEdgeState &s, int who, int64_t &rank) |
void | rankPlayer (const RubikEdgeState &s, int who, int64_t &index1, int64_t &index2) |
virtual uint64_t | GetStateHash (const RubikEdgeState &node) const |
virtual uint64_t | GetActionHash (RubikEdgeAction act) const |
virtual void | GetStateFromHash (uint64_t hash, RubikEdgeState &node) const |
virtual void | OpenGLDraw () const |
virtual void | OpenGLDraw (const RubikEdgeState &) const |
virtual void | OpenGLDraw (const RubikEdgeState &, const RubikEdgeState &, float) const |
Draw the transition at some percentage 0...1 between two states. More... | |
virtual void | OpenGLDraw (const RubikEdgeState &, const RubikEdgeAction &) const |
void | OpenGLDrawCube (const RubikEdgeState &s, int cube) const |
Public Member Functions inherited from SearchEnvironment< RubikEdgeState, RubikEdgeAction > | |
virtual | ~SearchEnvironment () |
virtual int | GetNumSuccessors (const RubikEdgeState &stateID) const |
virtual void | StoreGoal (RubikEdgeState &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 RubikEdgeState &node1, const RubikEdgeState &node2, double parentHCost) const |
virtual double | HCost (const RubikEdgeState &node) const |
Heuristic value between node and the stored goal. More... | |
virtual uint64_t | GetMaxHash () const |
virtual double | GetPathLength (std::vector< RubikEdgeState > &neighbors) |
virtual double | GetPathLength (const RubikEdgeState &start, std::vector< RubikEdgeAction > &neighbors) |
virtual OccupancyInterface< RubikEdgeState, RubikEdgeAction > * | GetOccupancyInfo () |
virtual void | SetOccupancyInfo (OccupancyInterface< RubikEdgeState, RubikEdgeAction > *) |
virtual void | OpenGLDraw () const |
virtual void | GLLabelState (const RubikEdgeState &, const char *) const |
virtual void | GLDrawLine (const RubikEdgeState &x, const RubikEdgeState &y) const |
virtual void | GLDrawPath (const std::vector< RubikEdgeState > &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 RubikEdgeState &) const |
virtual void | DrawLine (Graphics::Display &display, const RubikEdgeState &x, const RubikEdgeState &y, float width=1.0) const |
Public Member Functions inherited from Heuristic< RubikEdgeState > | |
Heuristic () | |
virtual | ~Heuristic () |
Static Public Member Functions | |
static void | MRUnrank (int n, uint64_t r, uint64_t &perm) |
static void | MRUnrank2 (int n, uint64_t r, uint64_t &perm) |
static uint64_t | MRRank (int n, uint64_t perm, uint64_t dual) |
static uint64_t | MRRank2 (int n, uint64_t perm, uint64_t dual) |
Private Member Functions | |
void | SetCubeColor (int which, bool face, const RubikEdgeState &) const |
Private Attributes | |
int | piecesToRank |
RubikEdgeMove | moves [18] |
Additional Inherited Members | |
Public Attributes inherited from Heuristic< RubikEdgeState > | |
std::vector< HeuristicTreeNode > | lookups |
std::vector< Heuristic * > | heuristics |
uint64_t | histogram [256] |
Protected Attributes inherited from SearchEnvironment< RubikEdgeState, RubikEdgeAction > | |
bool | bValidSearchGoal |
RubikEdgeState | searchGoal |
rgbColor | color |
GLfloat | transparency |
Definition at line 125 of file RubiksCubeEdges.h.
|
inline |
Definition at line 128 of file RubiksCubeEdges.h.
References RubikEdgeMove::act, moves, RubikEdgeMove::next, and piecesToRank.
|
inline |
Definition at line 138 of file RubiksCubeEdges.h.
|
virtual |
Implements SearchEnvironment< RubikEdgeState, RubikEdgeAction >.
Definition at line 516 of file RubiksCubeEdges.cpp.
Referenced by RubiksCube::ApplyAction(), ApplyMove(), GetNextState(), RubiksCube::UndoAction(), UndoAction(), and UndoMove().
|
virtual |
Definition at line 521 of file RubiksCubeEdges.cpp.
void RubikEdge::ApplyMove | ( | RubikEdgeState & | s, |
RubikEdgeMove * | a | ||
) |
Definition at line 211 of file RubiksCubeEdges.cpp.
References RubikEdgeMove::act, and ApplyAction().
|
inline |
Definition at line 168 of file RubiksCubeEdges.h.
|
inlinevirtual |
Implements SearchEnvironment< RubikEdgeState, RubikEdgeAction >.
Definition at line 151 of file RubiksCubeEdges.h.
|
inlinevirtual |
Implements SearchEnvironment< RubikEdgeState, RubikEdgeAction >.
Definition at line 150 of file RubiksCubeEdges.h.
|
virtual |
Reimplemented from SearchEnvironment< RubikEdgeState, RubikEdgeAction >.
Definition at line 204 of file RubiksCubeEdges.cpp.
|
inlinevirtual |
Implements SearchEnvironment< RubikEdgeState, RubikEdgeAction >.
Definition at line 181 of file RubiksCubeEdges.h.
|
virtual |
Implements SearchEnvironment< RubikEdgeState, RubikEdgeAction >.
Definition at line 195 of file RubiksCubeEdges.cpp.
int64_t RubikEdge::getMaxSinglePlayerRank | ( | ) | const |
Definition at line 598 of file RubiksCubeEdges.cpp.
References Factorial().
Referenced by RubiksCube::GetStateFromHash(), and RubiksCube::GetStateHash().
int64_t RubikEdge::getMaxSinglePlayerRank2 | ( | ) |
Definition at line 609 of file RubiksCubeEdges.cpp.
int64_t RubikEdge::getMaxSinglePlayerRank2 | ( | int64_t | firstIndex | ) |
Definition at line 614 of file RubiksCubeEdges.cpp.
References Factorial().
|
inline |
Definition at line 167 of file RubiksCubeEdges.h.
References moves.
|
virtual |
Reimplemented from SearchEnvironment< RubikEdgeState, RubikEdgeAction >.
Definition at line 527 of file RubiksCubeEdges.cpp.
References ApplyAction().
Referenced by GetSuccessors().
|
virtual |
Reimplemented from SearchEnvironment< RubikEdgeState, RubikEdgeAction >.
Definition at line 715 of file RubiksCubeEdges.cpp.
References bits(), Factorial(), get(), MRUnrank2(), and set().
Referenced by RubiksCube::GetStateFromHash(), and unrankPlayer().
|
virtual |
Implements SearchEnvironment< RubikEdgeState, RubikEdgeAction >.
Definition at line 647 of file RubiksCubeEdges.cpp.
References Factorial(), MRRank(), and set().
Referenced by RubiksCube::GetEdgeHash(), RubiksCube::GetStateHash(), and rankPlayer().
|
virtual |
Implements SearchEnvironment< RubikEdgeState, RubikEdgeAction >.
Definition at line 185 of file RubiksCubeEdges.cpp.
References GetNextState().
|
inlinevirtual |
Implements SearchEnvironment< RubikEdgeState, RubikEdgeAction >.
Definition at line 152 of file RubiksCubeEdges.h.
References GoalTest().
Referenced by GoalTest().
|
virtual |
Goal Test if the goal is stored.
Reimplemented from SearchEnvironment< RubikEdgeState, RubikEdgeAction >.
Definition at line 553 of file RubiksCubeEdges.cpp.
bool RubikEdge::GoalTest | ( | const RubikEdgeStateBits & | b | ) | const |
Definition at line 547 of file RubiksCubeEdges.cpp.
References RubikEdgeStateBits::state.
|
inlinevirtual |
Heuristic value between two arbitrary nodes.
Implements SearchEnvironment< RubikEdgeState, RubikEdgeAction >.
Definition at line 149 of file RubiksCubeEdges.h.
|
virtual |
Implements SearchEnvironment< RubikEdgeState, RubikEdgeAction >.
Definition at line 533 of file RubiksCubeEdges.cpp.
|
static |
Definition at line 668 of file RubiksCubeEdges.cpp.
Referenced by GetStateHash(), RubikEdgePDB::GetStateHash(), and rankPlayerRemaining().
|
static |
Definition at line 705 of file RubiksCubeEdges.cpp.
|
static |
Definition at line 747 of file RubiksCubeEdges.cpp.
References swap().
|
static |
Definition at line 758 of file RubiksCubeEdges.cpp.
References swap().
Referenced by GetStateFromHash(), and RubikEdgePDB::GetStateFromHash().
|
virtual |
Definition at line 834 of file RubiksCubeEdges.cpp.
Referenced by RubiksCube::OpenGLDraw(), RubiksCube::OpenGLDrawEdgeDual(), and RubiksCube::OpenGLDrawEdges().
|
virtual |
Reimplemented from SearchEnvironment< RubikEdgeState, RubikEdgeAction >.
Definition at line 839 of file RubiksCubeEdges.cpp.
References OpenGLDrawCube().
|
virtual |
Reimplemented from SearchEnvironment< RubikEdgeState, RubikEdgeAction >.
Definition at line 861 of file RubiksCubeEdges.cpp.
|
virtual |
Draw the transition at some percentage 0...1 between two states.
Reimplemented from SearchEnvironment< RubikEdgeState, RubikEdgeAction >.
Definition at line 856 of file RubiksCubeEdges.cpp.
void RubikEdge::OpenGLDrawCube | ( | const RubikEdgeState & | s, |
int | cube | ||
) | const |
Definition at line 866 of file RubiksCubeEdges.cpp.
References SetCubeColor().
Referenced by RubiksCube::OpenGLDraw(), and OpenGLDraw().
|
inline |
Definition at line 177 of file RubiksCubeEdges.h.
References rankPlayerFirstTwo(), and rankPlayerRemaining().
|
inline |
Definition at line 173 of file RubiksCubeEdges.h.
References GetStateHash().
Referenced by RubiksCube::Edge12PDBDist().
void RubikEdge::rankPlayerFirstTwo | ( | const RubikEdgeState & | s, |
int | who, | ||
int64_t & | rank | ||
) |
Definition at line 619 of file RubiksCubeEdges.cpp.
References RubikEdgeStateArray::GetCubeOrientation().
Referenced by rankPlayer().
void RubikEdge::rankPlayerRemaining | ( | const RubikEdgeState & | s, |
int | who, | ||
int64_t & | rank | ||
) |
Definition at line 628 of file RubiksCubeEdges.cpp.
References Factorial(), MRRank(), and set().
Referenced by rankPlayer().
|
private |
Definition at line 1225 of file RubiksCubeEdges.cpp.
References RubikEdgeStateArray::GetCubeInLoc(), and RubikEdgeStateArray::GetCubeOrientation().
Referenced by OpenGLDrawCube().
|
virtual |
Reimplemented from SearchEnvironment< RubikEdgeState, RubikEdgeAction >.
Definition at line 244 of file RubiksCubeEdges.cpp.
References ApplyAction().
|
virtual |
Definition at line 230 of file RubiksCubeEdges.cpp.
References ApplyAction().
void RubikEdge::UndoMove | ( | RubikEdgeState & | s, |
RubikEdgeMove * | a | ||
) |
Definition at line 216 of file RubiksCubeEdges.cpp.
References RubikEdgeMove::act, and ApplyAction().
|
inline |
Definition at line 158 of file RubiksCubeEdges.h.
References d, and GetStateFromHash().
|
private |
Definition at line 199 of file RubiksCubeEdges.h.
Referenced by getMoves(), and RubikEdge().
|
private |
Definition at line 196 of file RubiksCubeEdges.h.
Referenced by RubikEdge().