Go to the documentation of this file.
9 #ifndef __hog2_glut__RubikEdge__
10 #define __hog2_glut__RubikEdge__
67 for (
int x = 0; x < 24; x++)
76 for (
int x = 0; x < 12; x++)
85 for (
int x = 0; x < 12; x++)
106 for (
int x = 0; x < 12; x++)
107 result ^= (s.
state[x])<<(x);
108 for (
int x = 12; x < 24; x++)
109 result ^= (s.
state[x])<<((x-12)*4+12);
131 for (
int x = 0; x < 18; x++)
190 static void MRUnrank(
int n, uint64_t r, uint64_t &perm);
191 static void MRUnrank2(
int n, uint64_t r, uint64_t &perm);
192 static uint64_t
MRRank(
int n, uint64_t perm, uint64_t dual);
193 static uint64_t
MRRank2(
int n, uint64_t perm, uint64_t dual);
214 bool Load(
const char *prefix);
215 void Save(
const char *prefix);
227 mutable std::vector<std::vector<int> >
puzzles;
244 bool Load(
const char *prefix);
245 void Save(
const char *prefix);
void GetStateFromPDBHash(uint64_t hash, RubikEdgeState &s, int threadID=0) const
uint64_t GetPDBSize() const
int GetCubeInLoc(int whichLoc) const
static void GetStateFromHash(RubikEdgeState &s, uint64_t hash)
size_t operator()(const RubikEdgeStateArray &s) const
RubikEdgeState GetStateFromAbstractState(RubikEdgeState &s) const
std::string GetFileName(const char *prefix)
virtual bool InvertAction(RubikEdgeAction &a) const
virtual void UndoAction(RubikEdgeStateArray &s, RubikEdgeAction a) const
static uint64_t GetStateHash(const RubikEdgeState &s)
void FlipCubeOrientation(int whichLoc)
bool Load(const char *prefix)
virtual void OpenGLDraw() const
RubikEdgeMove * getMoves(RubikEdgeState &)
static uint64_t GetStateHash(const RubikEdgeState &s)
void GetStateFromPDBHash(uint64_t hash, RubikEdgeState &s, int threadID=0) const
std::string GetFileName(const char *prefix)
void freeMove(RubikEdgeMove *m)
RubikEdgeState RotateRubikEdgeClockwise(const RubikEdgeState &in, int step)
Implementation details:
void SetCubeInLoc(int whichLoc, int cube)
static void MRUnrank(int n, uint64_t r, uint64_t &perm)
void FlipCubeOrientation(int whichLoc)
virtual double HCost(const RubikEdgeState &node1, const RubikEdgeState &node2) const
Heuristic value between two arbitrary nodes.
void rankPlayerFirstTwo(const RubikEdgeState &s, int who, int64_t &rank)
virtual void GetNextState(const RubikEdgeState &, RubikEdgeAction, RubikEdgeState &) const
virtual bool GoalTest(const RubikEdgeState &node, const RubikEdgeState &goal) const
static uint64_t MRRank(int n, uint64_t perm, uint64_t dual)
static uint64_t Factorial(int val)
int GetCubeInLoc(int whichLoc) const
void GetDual(RubikEdgeStateBits &s) const
RubikEdgeState GetStateFromAbstractState(RubikEdgeState &s) const
void SetCubeInLoc(int whichLoc, int cube)
void rankPlayerRemaining(const RubikEdgeState &s, int who, int64_t &rank)
void SetCubeOrientation(int whichLoc, bool flip)
uint64_t GetPDBHash(const RubikEdgeState &s, int threadID=0) const
int64_t getMaxSinglePlayerRank() const
void OpenGLDrawCube(const RubikEdgeState &s, int cube) const
void unrankPlayer(uint64_t d, RubikEdgeState &s, int who)
int64_t rankPlayer(RubikEdgeState &s, int who)
virtual void ApplyAction(RubikEdgeStateArray &s, RubikEdgeAction a) const
static void MRUnrank2(int n, uint64_t r, uint64_t &perm)
static std::ostream & operator<<(std::ostream &out, const RubikEdgeStateArray &s)
static uint64_t GetStateSpaceSize()
virtual void GetSuccessors(const RubikEdgeState &nodeID, std::vector< RubikEdgeState > &neighbors) const
size_t operator()(const RubikEdgeStateBits &s) const
static uint64_t MRRank2(int n, uint64_t perm, uint64_t dual)
virtual RubikEdgeAction GetAction(const RubikEdgeState &s1, const RubikEdgeState &s2) const
void SetCubeColor(int which, bool face, const RubikEdgeState &) const
bool GetCubeOrientation(int whichLoc) const
void rankPlayer(const RubikEdgeState &s, int who, int64_t &index1, int64_t &index2)
void ApplyMove(RubikEdgeState &s, RubikEdgeMove *a)
void SetCubeOrientation(int whichLoc, bool flip)
int64_t getMaxSinglePlayerRank2()
RubikEdgePDB(RubikEdge *e, const RubikEdgeState &s, std::vector< int > &distinctEdges)
std::vector< std::vector< int > > puzzles
static void GetStateFromHash(RubikEdgeState &s, uint64_t hash)
virtual uint64_t GetAbstractHash(const RubikEdgeState &s, int threadID=0) const
RubikEdgeStateArray RubikEdgeState
static uint64_t FactorialUpperK(int n, int k)
static uint64_t GetStateSpaceSize()
virtual void GetActions(const RubikEdgeState &nodeID, std::vector< RubikEdgeAction > &actions) const
virtual double GCost(const RubikEdgeState &node, const RubikEdgeAction &act) const
bool GetCubeOrientation(int whichLoc) const
uint64_t GetPDBSize() const
RubikEdgeOrientationPDB(RubikEdge *e, const RubikEdgeState &s)
void UndoMove(RubikEdgeState &s, RubikEdgeMove *a)
virtual uint64_t GetStateHash(const RubikEdgeState &node) const
void Save(const char *prefix)
uint64_t GetPDBHash(const RubikEdgeState &s, int threadID=0) const
static bool operator==(const RubikEdgeStateBits &l1, const RubikEdgeStateBits &l2)
bool Load(const char *prefix)
virtual double GCost(const RubikEdgeState &node1, const RubikEdgeState &node2) const
void GetDual(RubikEdgeStateArray &s) const
virtual uint64_t GetActionHash(RubikEdgeAction act) const
Nodes to be stored within a Graph.
virtual void GetStateFromHash(uint64_t hash, RubikEdgeState &node) const
void Save(const char *prefix)
virtual uint64_t GetAbstractHash(const RubikEdgeState &s, int threadID=0) const