HOG2
Public Member Functions | Public Attributes | Private Attributes | List of all members
TOH< disks > Class Template Reference

#include <TOH.h>

Inheritance diagram for TOH< disks >:
Inheritance graph
[legend]
Collaboration diagram for TOH< disks >:
Collaboration graph
[legend]

Public Member Functions

 TOH ()
 
 ~TOH ()
 
void GetSuccessors (const TOHState< disks > &nodeID, std::vector< TOHState< disks >> &neighbors) const
 
void GetActions (const TOHState< disks > &nodeID, std::vector< TOHMove > &actions) const
 
void ApplyAction (TOHState< disks > &s, TOHMove a) const
 
bool InvertAction (TOHMove &a) const
 
double HCost (const TOHState< disks > &node1, const TOHState< disks > &node2) const
 Heuristic value between two arbitrary nodes. More...
 
double GCost (const TOHState< disks > &node1, const TOHState< disks > &node2) const
 
double GCost (const TOHState< disks > &node, const TOHMove &act) const
 
bool GoalTest (const TOHState< disks > &node, const TOHState< disks > &goal) const
 
uint64_t GetStateHash (const TOHState< disks > &node) const
 
void GetStateFromHash (uint64_t parent, TOHState< disks > &s) const
 
uint64_t GetMaxHash () const
 
uint64_t GetNumStates (TOHState< disks > &s) const
 
uint64_t GetActionHash (TOHMove act) const
 
std::string GetName ()
 
void OpenGLDraw () const
 
void OpenGLDraw (const TOHState< disks > &) const
 
void OpenGLDraw (const TOHState< disks > &, const TOHState< disks > &, float) const
 Draw the transition at some percentage 0...1 between two TOHState<disks>s. More...
 
void OpenGLDraw (const TOHState< disks > &, const TOHMove &) const
 
- Public Member Functions inherited from SearchEnvironment< TOHState< disks >, TOHMove >
virtual ~SearchEnvironment ()
 
virtual void GetSuccessors (const TOHState< disks > &nodeID, std::vector< TOHState< disks > > &neighbors) const=0
 
virtual int GetNumSuccessors (const TOHState< disks > &stateID) const
 
virtual TOHMove GetAction (const TOHState< disks > &s1, const TOHState< disks > &s2) const
 
virtual void UndoAction (TOHState< disks > &s, TOHMove a) const
 
virtual void GetNextState (const TOHState< disks > &s1, TOHMove a, TOHState< disks > &s2) const
 
virtual void StoreGoal (TOHState< disks > &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 TOHState< disks > &node1, const TOHState< disks > &node2, double parentHCost) const
 
virtual double HCost (const TOHState< disks > &node) const
 Heuristic value between node and the stored goal. More...
 
virtual bool GoalTest (const TOHState< disks > &node) const
 Goal Test if the goal is stored. More...
 
virtual uint64_t GetMaxHash () const
 
virtual double GetPathLength (std::vector< TOHState< disks > > &neighbors)
 
virtual double GetPathLength (const TOHState< disks > &start, std::vector< TOHMove > &neighbors)
 
virtual OccupancyInterface< TOHState< disks >, TOHMove > * GetOccupancyInfo ()
 
virtual void SetOccupancyInfo (OccupancyInterface< TOHState< disks >, TOHMove > *)
 
virtual void OpenGLDraw () const
 
virtual void GLLabelState (const TOHState< disks > &, const char *) const
 
virtual void GLDrawLine (const TOHState< disks > &x, const TOHState< disks > &y) const
 
virtual void GLDrawPath (const std::vector< TOHState< disks > > &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 TOHState< disks > &) const
 
virtual void DrawLine (Graphics::Display &display, const TOHState< disks > &x, const TOHState< disks > &y, float width=1.0) const
 
- Public Member Functions inherited from Heuristic< TOHState< disks > >
 Heuristic ()
 
virtual ~Heuristic ()
 

Public Attributes

bool pruneActions
 
- Public Attributes inherited from Heuristic< TOHState< disks > >
std::vector< HeuristicTreeNodelookups
 
std::vector< Heuristic * > heuristics
 
uint64_t histogram [256]
 

Private Attributes

std::vector< TOHMoveacts
 
TOHState< disks > tmp
 

Additional Inherited Members

- Protected Attributes inherited from SearchEnvironment< TOHState< disks >, TOHMove >
bool bValidSearchGoal
 
TOHState< disks > searchGoal
 
rgbColor color
 
GLfloat transparency
 

Detailed Description

template<int disks>
class TOH< disks >

Definition at line 133 of file TOH.h.

Constructor & Destructor Documentation

◆ TOH()

template<int disks>
TOH< disks >::TOH ( )
inline

Definition at line 135 of file TOH.h.

◆ ~TOH()

template<int disks>
TOH< disks >::~TOH ( )
inline

Definition at line 136 of file TOH.h.

Member Function Documentation

◆ ApplyAction()

template<int disks>
void TOH< disks >::ApplyAction ( TOHState< disks > &  s,
TOHMove  a 
) const
virtual

Implements SearchEnvironment< TOHState< disks >, TOHMove >.

Definition at line 261 of file TOH.h.

◆ GCost() [1/2]

template<int disks>
double TOH< disks >::GCost ( const TOHState< disks > &  node,
const TOHMove act 
) const
inlinevirtual

Implements SearchEnvironment< TOHState< disks >, TOHMove >.

Definition at line 145 of file TOH.h.

◆ GCost() [2/2]

template<int disks>
double TOH< disks >::GCost ( const TOHState< disks > &  node1,
const TOHState< disks > &  node2 
) const
inlinevirtual

Implements SearchEnvironment< TOHState< disks >, TOHMove >.

Definition at line 144 of file TOH.h.

◆ GetActionHash()

template<int disks>
uint64_t TOH< disks >::GetActionHash ( TOHMove  act) const
virtual

Implements SearchEnvironment< TOHState< disks >, TOHMove >.

Definition at line 331 of file TOH.h.

◆ GetActions()

template<int disks>
void TOH< disks >::GetActions ( const TOHState< disks > &  nodeID,
std::vector< TOHMove > &  actions 
) const
virtual

Implements SearchEnvironment< TOHState< disks >, TOHMove >.

Definition at line 185 of file TOH.h.

◆ GetMaxHash()

template<int disks>
uint64_t TOH< disks >::GetMaxHash ( ) const
inline

Definition at line 150 of file TOH.h.

◆ GetName()

template<int disks>
std::string TOH< disks >::GetName ( )
inline

Definition at line 154 of file TOH.h.

◆ GetNumStates()

template<int disks>
uint64_t TOH< disks >::GetNumStates ( TOHState< disks > &  s) const

Definition at line 312 of file TOH.h.

◆ GetStateFromHash()

template<int disks>
void TOH< disks >::GetStateFromHash ( uint64_t  parent,
TOHState< disks > &  s 
) const
virtual

◆ GetStateHash()

template<int disks>
uint64_t TOH< disks >::GetStateHash ( const TOHState< disks > &  node) const
virtual

◆ GetSuccessors()

template<int disks>
void TOH< disks >::GetSuccessors ( const TOHState< disks > &  nodeID,
std::vector< TOHState< disks >> &  neighbors 
) const

Definition at line 173 of file TOH.h.

◆ GoalTest()

template<int disks>
bool TOH< disks >::GoalTest ( const TOHState< disks > &  node,
const TOHState< disks > &  goal 
) const
virtual

Implements SearchEnvironment< TOHState< disks >, TOHMove >.

Definition at line 288 of file TOH.h.

◆ HCost()

template<int disks>
double TOH< disks >::HCost ( const TOHState< disks > &  node1,
const TOHState< disks > &  node2 
) const
virtual

Heuristic value between two arbitrary nodes.

Implements SearchEnvironment< TOHState< disks >, TOHMove >.

Definition at line 280 of file TOH.h.

◆ InvertAction()

template<int disks>
bool TOH< disks >::InvertAction ( TOHMove a) const
virtual

Implements SearchEnvironment< TOHState< disks >, TOHMove >.

Definition at line 269 of file TOH.h.

◆ OpenGLDraw() [1/4]

template<int disks>
void TOH< disks >::OpenGLDraw

Definition at line 337 of file TOH.h.

◆ OpenGLDraw() [2/4]

template<int disks>
void TOH< disks >::OpenGLDraw ( const TOHState< disks > &  s) const
virtual

Reimplemented from SearchEnvironment< TOHState< disks >, TOHMove >.

Definition at line 353 of file TOH.h.

◆ OpenGLDraw() [3/4]

template<int disks>
void TOH< disks >::OpenGLDraw ( const TOHState< disks > &  ,
const TOHMove  
) const
virtual

Reimplemented from SearchEnvironment< TOHState< disks >, TOHMove >.

Definition at line 414 of file TOH.h.

◆ OpenGLDraw() [4/4]

template<int disks>
void TOH< disks >::OpenGLDraw ( const TOHState< disks > &  s,
const TOHState< disks > &  s2,
float  interval 
) const
virtual

Draw the transition at some percentage 0...1 between two TOHState<disks>s.

Reimplemented from SearchEnvironment< TOHState< disks >, TOHMove >.

Definition at line 371 of file TOH.h.

Member Data Documentation

◆ acts

template<int disks>
std::vector<TOHMove> TOH< disks >::acts
mutableprivate

Definition at line 165 of file TOH.h.

◆ pruneActions

template<int disks>
bool TOH< disks >::pruneActions

Definition at line 161 of file TOH.h.

◆ tmp

template<int disks>
TOHState<disks> TOH< disks >::tmp
mutableprivate

Definition at line 166 of file TOH.h.


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