HOG2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Rubik7Edge Class Reference

#include <RubiksCube7Edges.h>

Inheritance diagram for Rubik7Edge:
Inheritance graph
[legend]
Collaboration diagram for Rubik7Edge:
Collaboration graph
[legend]

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)
 
Rubik7EdgeMovegetMoves (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< HeuristicTreeNodelookups
 
std::vector< Heuristic * > heuristics
 
uint64_t histogram [256]
 
- Protected Attributes inherited from SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >
bool bValidSearchGoal
 
Rubik7EdgeState searchGoal
 
rgbColor color
 
GLfloat transparency
 

Detailed Description

Definition at line 102 of file RubiksCube7Edges.h.

Constructor & Destructor Documentation

◆ Rubik7Edge()

Rubik7Edge::Rubik7Edge ( )
inline

Definition at line 105 of file RubiksCube7Edges.h.

References Rubik7EdgeMove::act, moves, and Rubik7EdgeMove::next.

◆ ~Rubik7Edge()

Rubik7Edge::~Rubik7Edge ( )
inline

Definition at line 114 of file RubiksCube7Edges.h.

Member Function Documentation

◆ ApplyAction()

void Rubik7Edge::ApplyAction ( Rubik7EdgeState s,
Rubik7EdgeAction  a 
) const
virtual

◆ ApplyMove()

void Rubik7Edge::ApplyMove ( Rubik7EdgeState s,
Rubik7EdgeMove a 
)

Definition at line 53 of file RubiksCube7Edges.cpp.

References Rubik7EdgeMove::act, and ApplyAction().

◆ freeMove()

void Rubik7Edge::freeMove ( Rubik7EdgeMove m)
inline

Definition at line 140 of file RubiksCube7Edges.h.

◆ GCost() [1/2]

virtual double Rubik7Edge::GCost ( const Rubik7EdgeState node,
const Rubik7EdgeAction act 
) const
inlinevirtual

◆ GCost() [2/2]

virtual double Rubik7Edge::GCost ( const Rubik7EdgeState node1,
const Rubik7EdgeState node2 
) const
inlinevirtual

◆ GetAction()

Rubik7EdgeAction Rubik7Edge::GetAction ( const Rubik7EdgeState s1,
const Rubik7EdgeState s2 
) const
virtual

Reimplemented from SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.

Definition at line 46 of file RubiksCube7Edges.cpp.

◆ GetActionHash()

virtual uint64_t Rubik7Edge::GetActionHash ( Rubik7EdgeAction  act) const
inlinevirtual

◆ GetActions()

void Rubik7Edge::GetActions ( const Rubik7EdgeState nodeID,
std::vector< Rubik7EdgeAction > &  actions 
) const
virtual

◆ getMaxSinglePlayerRank()

int64_t Rubik7Edge::getMaxSinglePlayerRank ( ) const

Definition at line 371 of file RubiksCube7Edges.cpp.

References Factorial(), and pieces.

◆ getMaxSinglePlayerRank2() [1/2]

int64_t Rubik7Edge::getMaxSinglePlayerRank2 ( )

Definition at line 382 of file RubiksCube7Edges.cpp.

References pieces.

◆ getMaxSinglePlayerRank2() [2/2]

int64_t Rubik7Edge::getMaxSinglePlayerRank2 ( int64_t  firstIndex)

Definition at line 391 of file RubiksCube7Edges.cpp.

References Factorial(), and pieces.

◆ getMoves()

Rubik7EdgeMove* Rubik7Edge::getMoves ( Rubik7EdgeState )
inline

Definition at line 139 of file RubiksCube7Edges.h.

References moves.

◆ GetNextState()

void Rubik7Edge::GetNextState ( const Rubik7EdgeState s0,
Rubik7EdgeAction  a,
Rubik7EdgeState s1 
) const
virtual

Reimplemented from SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.

Definition at line 329 of file RubiksCube7Edges.cpp.

References ApplyAction().

Referenced by GetSuccessors().

◆ GetStateFromHash()

void Rubik7Edge::GetStateFromHash ( uint64_t  hash,
Rubik7EdgeState node 
) const
virtual

Reimplemented from SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.

Definition at line 469 of file RubiksCube7Edges.cpp.

References bits(), Factorial(), and pieces.

Referenced by unrankPlayer().

◆ GetStateHash()

uint64_t Rubik7Edge::GetStateHash ( const Rubik7EdgeState node) const
virtual

Implements SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.

Definition at line 438 of file RubiksCube7Edges.cpp.

References Factorial(), and pieces.

Referenced by rankPlayer().

◆ GetSuccessors()

void Rubik7Edge::GetSuccessors ( const Rubik7EdgeState nodeID,
std::vector< Rubik7EdgeState > &  neighbors 
) const
virtual

◆ GoalTest()

virtual bool Rubik7Edge::GoalTest ( const Rubik7EdgeState node,
const Rubik7EdgeState goal 
) const
inlinevirtual

◆ HCost()

virtual double Rubik7Edge::HCost ( const Rubik7EdgeState node1,
const Rubik7EdgeState node2 
) const
inlinevirtual

Heuristic value between two arbitrary nodes.

Implements SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.

Definition at line 121 of file RubiksCube7Edges.h.

◆ InvertAction()

virtual bool Rubik7Edge::InvertAction ( Rubik7EdgeAction a) const
inlinevirtual

◆ MRUnrank()

void Rubik7Edge::MRUnrank ( int  n,
uint64_t  r,
uint64_t &  perm 
) const
private

◆ MRUnrank2()

void Rubik7Edge::MRUnrank2 ( int  n,
uint64_t  r,
uint64_t &  perm 
) const
private

◆ OpenGLDraw() [1/4]

void Rubik7Edge::OpenGLDraw ( ) const
virtual

Definition at line 530 of file RubiksCube7Edges.cpp.

◆ OpenGLDraw() [2/4]

void Rubik7Edge::OpenGLDraw ( const Rubik7EdgeState s) const
virtual

Reimplemented from SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.

Definition at line 535 of file RubiksCube7Edges.cpp.

References SetCubeColor().

◆ OpenGLDraw() [3/4]

void Rubik7Edge::OpenGLDraw ( const Rubik7EdgeState ,
const Rubik7EdgeAction  
) const
virtual

Reimplemented from SearchEnvironment< Rubik7EdgeState, Rubik7EdgeAction >.

Definition at line 727 of file RubiksCube7Edges.cpp.

◆ OpenGLDraw() [4/4]

void Rubik7Edge::OpenGLDraw ( const Rubik7EdgeState ,
const Rubik7EdgeState ,
float   
) const
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.

◆ rankPlayer() [1/2]

void Rubik7Edge::rankPlayer ( const Rubik7EdgeState s,
int  who,
int64_t &  index1,
int64_t &  index2 
)
inline

Definition at line 159 of file RubiksCube7Edges.h.

References rankPlayerFirstTwo(), and rankPlayerRemaining().

◆ rankPlayer() [2/2]

int64_t Rubik7Edge::rankPlayer ( Rubik7EdgeState s,
int  who 
)
inline

Definition at line 155 of file RubiksCube7Edges.h.

References GetStateHash().

◆ rankPlayerFirstTwo()

void Rubik7Edge::rankPlayerFirstTwo ( const Rubik7EdgeState s,
int  who,
int64_t &  rank 
)

Definition at line 399 of file RubiksCube7Edges.cpp.

References pieces.

Referenced by rankPlayer().

◆ rankPlayerRemaining()

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().

◆ SetCubeColor()

void Rubik7Edge::SetCubeColor ( int  which,
bool  face,
const Rubik7EdgeState s 
) const
private

◆ UndoMove()

void Rubik7Edge::UndoMove ( Rubik7EdgeState s,
Rubik7EdgeMove a 
)

Definition at line 58 of file RubiksCube7Edges.cpp.

References Rubik7EdgeMove::act, and ApplyAction().

◆ unrankPlayer()

void Rubik7Edge::unrankPlayer ( uint64_t  d,
Rubik7EdgeState s,
int  who 
)
inline

Definition at line 130 of file RubiksCube7Edges.h.

References d, and GetStateFromHash().

Member Data Documentation

◆ moves

Rubik7EdgeMove Rubik7Edge::moves[18]
private

Definition at line 176 of file RubiksCube7Edges.h.

Referenced by getMoves(), and Rubik7Edge().


The documentation for this class was generated from the following files: