Go to the documentation of this file.
12 #include <unordered_map>
119 void Initialize(
int RCpos,
int RCind,
int RCrot);
146 for (
int i = 0; i < 20; i++)
206 for (
int x = 0; x < 20; x++)
215 for (
int x = 0; x < 20; x++)
316 for (
int i = 0; i < 8; i++)
321 for (
int i = 0; i < 12; i++)
327 for (
int i = 0; i < 26; i++)
333 for (
int i = 0; i < 3; i++)
338 for (
int i = 0; i < 9; i++)
340 int in = (i/3)*-9 + (i%3) + 18; in -= in/14;
342 in = (i/3)*9 + (i%3) + 6; in -= in/14;
345 in = (i/3)*3 + (i%3)*-9 + 18; in -= in/14;
347 in = (i/3)*3 + (i%3)*9 + 2; in -= in/14;
351 in = (i/3)*3 - (i%3) + 20; in -= in/14;
356 for (
int i = 0; i < 6; i++)
359 for (
int k = 0; k < 26; k++)
362 for (
int l = 0; l < 9; l++)
466 bool Load(
const char *prefix) {
return false; }
467 void Save(
const char *prefix) {}
468 bool Load(FILE *f){
return false; }
const rgbColor faceColors[6]
uint64_t GetEdgeRotationSize() const
void RotateEdges(int move)
void UndoAction(RCState &s, RCAction a) const
RCAction GetAction(const RCState &s1, const RCState &s2) const
A color; r/g/b are between 0...1.
const int faceOrderByAxis[3][4]
std::string GetFileName(const char *prefix)
void GetStateFromEdgeRotationHash(RCState &s, uint64_t hash) const
void DrawCubiesRotating(Graphics::Display &display) const
int Edge12PDBDist(const RCState &s)
static std::ostream & operator<<(std::ostream &out, RCState &tmp)
void GetStateFromPDBHashCorner(uint64_t hash, RCState &s, int threadID) const
void OpenGLDrawEdges(const RCState &) const
const std::vector< std::vector< float > > projection
void GetStateFromHash(RCState &s, uint64_t hash) const
void GetStateFromHash(uint64_t hash, RCState &node) const
void RotateFace(int face, int move)
uint64_t GetEdgeLocationSize() const
uint64_t GetEdgeRotationHash(const RCState &s) const
const int faceBlackUnderside[6]
const int facesShowing[20][3]
void ShiftPositionsCCW(const int(&arr)[4])
uint64_t GetCornerLocationSize() const
std::vector< int > edgeLocations
void InterpFaceRot(float progress)
void Save(const char *prefix)
void SetPruneSuccessors(bool val)
uint64_t GetCornerRotationSize() const
void OpenGLDrawCorners(const RCState &) const
const int fromFaceToCenter[6]
void OpenGLDrawCubeBackground() const
void GetPrunedActions(const RCState &nodeID, RCAction lastAction, std::vector< RCAction > &actions) const
uint64_t GetEdgeLocationHash(const RCState &s) const
std::vector< std::vector< Graphics::point > > facePoints
void GetStateFromPDBHash(uint64_t hash, RCState &s, int threadID=0) const
uint64_t FactorialUpperK(int n, int k) const
void GetActions(const RCState &nodeID, std::vector< RCAction > &actions) const
void GetStateFromCornerLocationHash(RCState &s, uint64_t hash) const
uint64_t GetStateHash(const RCState &s) const
uint64_t GetPDBHashCorner(const RCState &s, int threadID) const
void RotateCorners(int move)
const int pointsOnFace[6][4]
void SetFaceColor(int face) const
int notInFaceTurning[6][17]
bool GoalTest(const RCState &node, const RCState &goal) const
uint64_t GetCornerLocationHash(const RCState &s) const
void ShiftPositionsCW(const int(&arr)[4])
RCPDB(RC *e, const std::array< bool, 12 > &edgeRotations, const std::array< bool, 12 > &edgeLocations, const std::array< bool, 8 > &cornerRotations, const std::array< bool, 8 > &cornerLocations)
std::vector< int > cornerLocations
std::vector< int > edgeRotations
void Draw(Graphics::Display &display) const
void RotateRelative(const float angle[3])
static bool operator==(const RCState &l1, const RCState &l2)
bool InvertAction(RCAction &a) const
void GetStateFromCornerRotationHash(RCState &s, uint64_t hash) const
void RotateFace(int move)
void RotateFacePos(bool clockwise, int axis)
std::vector< Graphics::point > points
void GetSuccessors(const RCState &nodeID, std::vector< RCState > &neighbors) const
void DrawCubies(Graphics::Display &display) const
std::vector< Graphics::point > basePoints
void OpenGLDrawCube(int cube) const
uint64_t GetPDBHash(const RCState &s, int threadID=0) const
std::vector< int > corners
uint64_t GetStateHash(const RCState &node) const
void ApplyAction(RCState &s, RCAction a) const
void Draw(Graphics::Display &display, const RCState &) const
const int convertStatePos[20]
uint64_t GetStateHashCorner(const RCState &s)
RCState GetStateFromAbstractState(RCState &s) const
void ShiftPositions(const int(&arr)[4], bool forward)
bool Load(const char *prefix)
void RotateBase(float angle[3])
std::vector< std::vector< Graphics::point > > baseFacePoints
double HCost(const RCState &node1, const RCState &node2) const
Heuristic value between two arbitrary nodes.
std::vector< RCAction > history
uint64_t GetPDBSizeCorner() const
void OpenGLDrawCenters() const
uint64_t GetAbstractHash(const RCState &s, int threadID=0) const
void SwapPositions(int p1, int p2)
void DrawFace(Graphics::Display &display, int index) const
void OpenGLDrawEdgeDual(const RCState &) const
void GetStateFromEdgeLocationHash(RCState &s, uint64_t hash) const
void SetFacePositionVisible(bool toggle, int position)
uint64_t GetPDBSize() const
void RotateCubies(float add[3])
uint64_t FactorialUpperK(int n, int k) const
Nodes to be stored within a Graph.
void GetNextState(const RCState &, RCAction, RCState &) const
double GCost(const RCState &node1, const RCState &node2) const
double GCost(const RCState &node, const RCAction &act) const
std::vector< int > cornerRotations
uint64_t GetCornerRotationHash(const RCState &s) const
uint64_t GetActionHash(RCAction act) const