HOG2
|
#include <RubiksCube7Edges.h>
Public Member Functions | |
Rubik7Edge () | |
~Rubik7Edge () | |
virtual void | GetSuccessors (const Rubik7EdgeState &nodeID, std::vector< Rubik7EdgeState > &neighbors) const |
virtual void | GetActions (const Rubik7EdgeState &nodeID, std::vector< Rubik7EdgeAction > &actions) const |
virtual Rubik7EdgeAction | GetAction (const Rubik7EdgeState &s1, const Rubik7EdgeState &s2) const |
virtual void | ApplyAction (Rubik7EdgeState &s, Rubik7EdgeAction a) const |
virtual double | HCost (const Rubik7EdgeState &node1, const Rubik7EdgeState &node2) const |
Heuristic value between two arbitrary nodes. More... | |
virtual double | GCost (const Rubik7EdgeState &node1, const Rubik7EdgeState &node2) const |
virtual double | GCost (const Rubik7EdgeState &node, const Rubik7EdgeAction &act) const |
virtual bool | GoalTest (const Rubik7EdgeState &node, const Rubik7EdgeState &goal) const |
void | ApplyMove (Rubik7EdgeState &s, Rubik7EdgeMove *a) |
void | UndoMove (Rubik7EdgeState &s, Rubik7EdgeMove *a) |
void | unrankPlayer (uint64_t d, Rubik7EdgeState &s, int who) |
int64_t | getMaxSinglePlayerRank () const |
int64_t | getMaxSinglePlayerRank2 () |
int64_t | getMaxSinglePlayerRank2 (int64_t firstIndex) |
Rubik7EdgeMove * | getMoves (Rubik7EdgeState &) |
void | freeMove (Rubik7EdgeMove *m) |
virtual void | GetNextState (const Rubik7EdgeState &, Rubik7EdgeAction, Rubik7EdgeState &) const |
virtual bool | InvertAction (Rubik7EdgeAction &a) const |
int64_t | rankPlayer (Rubik7EdgeState &s, int who) |
void | rankPlayerFirstTwo (const Rubik7EdgeState &s, int who, int64_t &rank) |
void | rankPlayerRemaining (const Rubik7EdgeState &s, int who, int64_t &rank) |
void | rankPlayer (const Rubik7EdgeState &s, int who, int64_t &index1, int64_t &index2) |
virtual uint64_t | GetStateHash (const Rubik7EdgeState &node) const |
virtual uint64_t | GetActionHash (Rubik7EdgeAction act) const |
virtual void | GetStateFromHash (uint64_t hash, Rubik7EdgeState &node) const |
virtual void | OpenGLDraw () const |
virtual void | OpenGLDraw (const Rubik7EdgeState &) const |
virtual void | OpenGLDraw (const Rubik7EdgeState &, const Rubik7EdgeState &, float) const |
Draw the transition at some percentage 0...1 between two states. More... | |
virtual void | OpenGLDraw (const Rubik7EdgeState &, const Rubik7EdgeAction &) const |
Public Member Functions inherited from SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction > | |
virtual | ~SearchEnvironment () |
virtual int | GetNumSuccessors (const Rubik7EdgeState &stateID) const |
virtual void | UndoAction (Rubik7EdgeState &s, Rubik7EdgeAction a) const |
virtual void | StoreGoal (Rubik7EdgeState &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 Rubik7EdgeState &node1, const Rubik7EdgeState &node2, double parentHCost) const |
virtual double | HCost (const Rubik7EdgeState &node) const |
Heuristic value between node and the stored goal. More... | |
virtual bool | GoalTest (const Rubik7EdgeState &node) const |
Goal Test if the goal is stored. More... | |
virtual uint64_t | GetMaxHash () const |
virtual double | GetPathLength (std::vector< Rubik7EdgeState > &neighbors) |
virtual double | GetPathLength (const Rubik7EdgeState &start, std::vector< Rubik7EdgeAction > &neighbors) |
virtual OccupancyInterface< Rubik7EdgeState, Rubik7EdgeAction > * | GetOccupancyInfo () |
virtual void | SetOccupancyInfo (OccupancyInterface< Rubik7EdgeState, Rubik7EdgeAction > *) |
virtual void | OpenGLDraw () const |
virtual void | GLLabelState (const Rubik7EdgeState &, const char *) const |
virtual void | GLDrawLine (const Rubik7EdgeState &x, const Rubik7EdgeState &y) const |
virtual void | GLDrawPath (const std::vector< Rubik7EdgeState > &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 Rubik7EdgeState &) const |
virtual void | DrawLine (Graphics::Display &display, const Rubik7EdgeState &x, const Rubik7EdgeState &y, float width=1.0) const |
Public Member Functions inherited from Heuristic< Rubik7EdgeState > | |
Heuristic () | |
virtual | ~Heuristic () |
Private Member Functions | |
void | MRUnrank (int n, uint64_t r, uint64_t &perm) const |
void | MRUnrank2 (int n, uint64_t r, uint64_t &perm) const |
void | SetCubeColor (int which, bool face, const Rubik7EdgeState &) const |
Private Attributes | |
Rubik7EdgeMove | moves [18] |
Additional Inherited Members | |
Public Attributes inherited from Heuristic< Rubik7EdgeState > | |
std::vector< HeuristicTreeNode > | lookups |
std::vector< Heuristic * > | heuristics |
uint64_t | histogram [256] |
Protected Attributes inherited from SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction > | |
bool | bValidSearchGoal |
Rubik7EdgeState | searchGoal |
rgbColor | color |
GLfloat | transparency |
Definition at line 102 of file RubiksCube7Edges.h.
|
inline |
Definition at line 105 of file RubiksCube7Edges.h.
References Rubik7EdgeMove::act, moves, and Rubik7EdgeMove::next.
|
inline |
Definition at line 114 of file RubiksCube7Edges.h.
|
virtual |
Implements SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.
Definition at line 72 of file RubiksCube7Edges.cpp.
References d, Rubik7EdgeState::FlipCubeOrientation(), Rubik7EdgeState::GetCubeInLoc(), and Rubik7EdgeState::SetCubeInLoc().
Referenced by ApplyMove(), GetNextState(), and UndoMove().
void Rubik7Edge::ApplyMove | ( | Rubik7EdgeState & | s, |
Rubik7EdgeMove * | a | ||
) |
Definition at line 53 of file RubiksCube7Edges.cpp.
References Rubik7EdgeMove::act, and ApplyAction().
|
inline |
Definition at line 140 of file RubiksCube7Edges.h.
|
inlinevirtual |
Implements SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.
Definition at line 124 of file RubiksCube7Edges.h.
|
inlinevirtual |
Implements SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.
Definition at line 123 of file RubiksCube7Edges.h.
|
virtual |
Reimplemented from SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.
Definition at line 46 of file RubiksCube7Edges.cpp.
|
inlinevirtual |
Implements SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.
Definition at line 163 of file RubiksCube7Edges.h.
|
virtual |
Implements SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.
Definition at line 37 of file RubiksCube7Edges.cpp.
int64_t Rubik7Edge::getMaxSinglePlayerRank | ( | ) | const |
Definition at line 371 of file RubiksCube7Edges.cpp.
References Factorial(), and pieces.
int64_t Rubik7Edge::getMaxSinglePlayerRank2 | ( | ) |
Definition at line 382 of file RubiksCube7Edges.cpp.
References pieces.
int64_t Rubik7Edge::getMaxSinglePlayerRank2 | ( | int64_t | firstIndex | ) |
Definition at line 391 of file RubiksCube7Edges.cpp.
References Factorial(), and pieces.
|
inline |
Definition at line 139 of file RubiksCube7Edges.h.
References moves.
|
virtual |
Reimplemented from SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.
Definition at line 329 of file RubiksCube7Edges.cpp.
References ApplyAction().
Referenced by GetSuccessors().
|
virtual |
Reimplemented from SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.
Definition at line 469 of file RubiksCube7Edges.cpp.
References bits(), Factorial(), and pieces.
Referenced by unrankPlayer().
|
virtual |
Implements SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.
Definition at line 438 of file RubiksCube7Edges.cpp.
References Factorial(), and pieces.
Referenced by rankPlayer().
|
virtual |
Implements SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.
Definition at line 27 of file RubiksCube7Edges.cpp.
References GetNextState().
|
inlinevirtual |
Implements SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.
Definition at line 125 of file RubiksCube7Edges.h.
|
inlinevirtual |
Heuristic value between two arbitrary nodes.
Implements SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.
Definition at line 121 of file RubiksCube7Edges.h.
|
inlinevirtual |
Implements SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.
Definition at line 143 of file RubiksCube7Edges.h.
|
private |
|
private |
|
virtual |
Definition at line 530 of file RubiksCube7Edges.cpp.
|
virtual |
Reimplemented from SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.
Definition at line 535 of file RubiksCube7Edges.cpp.
References SetCubeColor().
|
virtual |
Reimplemented from SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.
Definition at line 727 of file RubiksCube7Edges.cpp.
|
virtual |
Draw the transition at some percentage 0...1 between two states.
Reimplemented from SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.
Definition at line 722 of file RubiksCube7Edges.cpp.
|
inline |
Definition at line 159 of file RubiksCube7Edges.h.
References rankPlayerFirstTwo(), and rankPlayerRemaining().
|
inline |
Definition at line 155 of file RubiksCube7Edges.h.
References GetStateHash().
void Rubik7Edge::rankPlayerFirstTwo | ( | const Rubik7EdgeState & | s, |
int | who, | ||
int64_t & | rank | ||
) |
void Rubik7Edge::rankPlayerRemaining | ( | const Rubik7EdgeState & | s, |
int | who, | ||
int64_t & | rank | ||
) |
Definition at line 411 of file RubiksCube7Edges.cpp.
References Factorial(), and pieces.
Referenced by rankPlayer().
|
private |
Definition at line 732 of file RubiksCube7Edges.cpp.
References Rubik7EdgeState::GetCubeInLoc(), and Rubik7EdgeState::GetCubeOrientation().
Referenced by OpenGLDraw().
void Rubik7Edge::UndoMove | ( | Rubik7EdgeState & | s, |
Rubik7EdgeMove * | a | ||
) |
Definition at line 58 of file RubiksCube7Edges.cpp.
References Rubik7EdgeMove::act, and ApplyAction().
|
inline |
Definition at line 130 of file RubiksCube7Edges.h.
References d, and GetStateFromHash().
|
private |
Definition at line 176 of file RubiksCube7Edges.h.
Referenced by getMoves(), and Rubik7Edge().