HOG2
Public Member Functions | Protected Attributes | List of all members
CanonicalGraphEnvironment Class Reference

#include <CanonicalGraphEnvironment.h>

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

Public Member Functions

 CanonicalGraphEnvironment (Graph *g)
 
 ~CanonicalGraphEnvironment ()
 
void GetSuccessors (const canGraphState &stateID, std::vector< canGraphState > &neighbors) const
 
void GetActions (const canGraphState &stateID, std::vector< graphMove > &actions) const
 
graphMove GetAction (const canGraphState &s1, const canGraphState &s2) const
 
void ApplyAction (canGraphState &s, graphMove a) const
 
bool InvertAction (graphMove &a) const
 
void SetDirected (bool b)
 
double HCost (const canGraphState &state1, const canGraphState &state2) const
 Heuristic value between two arbitrary nodes. More...
 
double GCost (const canGraphState &state1, const canGraphState &state2) const
 
double GCost (const canGraphState &state1, const graphMove &state2) const
 
bool GoalTest (const canGraphState &state, const canGraphState &goal) const
 
uint64_t GetMaxHash () const
 
uint64_t GetStateHash (const canGraphState &state) const
 
uint64_t GetActionHash (graphMove act) const
 
void OpenGLDraw () const
 
void OpenGLDraw (const canGraphState &s) const
 
void OpenGLDraw (const canGraphState &s, const graphMove &gm) const
 
void OpenGLDraw (const canGraphState &s, const canGraphState &, float) const
 Draw the transition at some percentage 0...1 between two states. More...
 
void GLDrawLine (const canGraphState &x, const canGraphState &y) const
 
GraphGetGraph ()
 
void StoreGoal (canGraphState &)
 Stores the goal for use by single-state HCost. More...
 
void ClearGoal ()
 Clears the goal from memory. More...
 
bool IsGoalStored () const
 
double HCost (const canGraphState &) const
 Heuristic value between node and the stored goal. More...
 
bool GoalTest (const canGraphState &) const
 Goal Test if the goal is stored. More...
 
void SetDrawEdgeCosts (bool val)
 
void SetDrawNodeLabels (bool val)
 
void SetNodeScale (double v)
 
void ComputeOrdering ()
 
- Public Member Functions inherited from SearchEnvironment< canGraphState, graphMove >
virtual ~SearchEnvironment ()
 
virtual int GetNumSuccessors (const canGraphState &stateID) const
 
virtual void UndoAction (canGraphState &s, graphMove a) const
 
virtual void GetNextState (const canGraphState &s1, graphMove a, canGraphState &s2) const
 
virtual bool IsGoalStored () const
 Returns true if the goal is stored and false otherwise. More...
 
virtual double HCost (const canGraphState &node1, const canGraphState &node2, double parentHCost) const
 
virtual uint64_t GetMaxHash () const
 
virtual void GetStateFromHash (uint64_t parent, canGraphState &s) const
 
virtual double GetPathLength (std::vector< canGraphState > &neighbors)
 
virtual double GetPathLength (const canGraphState &start, std::vector< graphMove > &neighbors)
 
virtual OccupancyInterface< canGraphState, graphMove > * GetOccupancyInfo ()
 
virtual void SetOccupancyInfo (OccupancyInterface< canGraphState, graphMove > *)
 
virtual void OpenGLDraw () const
 
virtual void GLLabelState (const canGraphState &, const char *) const
 
virtual void GLDrawPath (const std::vector< canGraphState > &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 canGraphState &) const
 
virtual void DrawLine (Graphics::Display &display, const canGraphState &x, const canGraphState &y, float width=1.0) const
 
- Public Member Functions inherited from Heuristic< canGraphState >
 Heuristic ()
 
virtual ~Heuristic ()
 

Protected Attributes

std::unordered_map< canGraphState, uint8_t > canonicalOrdering
 
bool directed
 
Graphg
 
bool drawEdgeCosts
 
bool drawNodeLabels
 
double nodeScale
 
- Protected Attributes inherited from SearchEnvironment< canGraphState, graphMove >
bool bValidSearchGoal
 
canGraphState searchGoal
 
rgbColor color
 
GLfloat transparency
 

Additional Inherited Members

- Public Attributes inherited from Heuristic< canGraphState >
std::vector< HeuristicTreeNodelookups
 
std::vector< Heuristic * > heuristics
 
uint64_t histogram [256]
 

Detailed Description

Definition at line 45 of file CanonicalGraphEnvironment.h.

Constructor & Destructor Documentation

◆ CanonicalGraphEnvironment()

CanonicalGraphEnvironment::CanonicalGraphEnvironment ( Graph g)

◆ ~CanonicalGraphEnvironment()

CanonicalGraphEnvironment::~CanonicalGraphEnvironment ( )

Definition at line 36 of file CanonicalGraphEnvironment.cpp.

Member Function Documentation

◆ ApplyAction()

void CanonicalGraphEnvironment::ApplyAction ( canGraphState s,
graphMove  a 
) const
virtual

◆ ClearGoal()

void CanonicalGraphEnvironment::ClearGoal ( )
inlinevirtual

Clears the goal from memory.

Reimplemented from SearchEnvironment< canGraphState, graphMove >.

Definition at line 74 of file CanonicalGraphEnvironment.h.

◆ ComputeOrdering()

void CanonicalGraphEnvironment::ComputeOrdering ( )

◆ GCost() [1/2]

double CanonicalGraphEnvironment::GCost ( const canGraphState state1,
const canGraphState state2 
) const
virtual

◆ GCost() [2/2]

double CanonicalGraphEnvironment::GCost ( const canGraphState state1,
const graphMove state2 
) const
virtual

◆ GetAction()

graphMove CanonicalGraphEnvironment::GetAction ( const canGraphState s1,
const canGraphState s2 
) const
virtual

Reimplemented from SearchEnvironment< canGraphState, graphMove >.

Definition at line 104 of file CanonicalGraphEnvironment.cpp.

◆ GetActionHash()

uint64_t CanonicalGraphEnvironment::GetActionHash ( graphMove  act) const
virtual

◆ GetActions()

void CanonicalGraphEnvironment::GetActions ( const canGraphState stateID,
std::vector< graphMove > &  actions 
) const
virtual

◆ GetGraph()

Graph* CanonicalGraphEnvironment::GetGraph ( )
inline

Definition at line 71 of file CanonicalGraphEnvironment.h.

References g.

◆ GetMaxHash()

uint64_t CanonicalGraphEnvironment::GetMaxHash ( ) const

Definition at line 151 of file CanonicalGraphEnvironment.cpp.

References g, and Graph::GetNumNodes().

◆ GetStateHash()

uint64_t CanonicalGraphEnvironment::GetStateHash ( const canGraphState state) const
virtual

◆ GetSuccessors()

void CanonicalGraphEnvironment::GetSuccessors ( const canGraphState stateID,
std::vector< canGraphState > &  neighbors 
) const
virtual

◆ GLDrawLine()

void CanonicalGraphEnvironment::GLDrawLine ( const canGraphState x,
const canGraphState y 
) const
virtual

◆ GoalTest() [1/2]

bool CanonicalGraphEnvironment::GoalTest ( const canGraphState node) const
inlinevirtual

Goal Test if the goal is stored.

Reimplemented from SearchEnvironment< canGraphState, graphMove >.

Definition at line 81 of file CanonicalGraphEnvironment.h.

◆ GoalTest() [2/2]

bool CanonicalGraphEnvironment::GoalTest ( const canGraphState state,
const canGraphState goal 
) const
virtual

◆ HCost() [1/2]

double CanonicalGraphEnvironment::HCost ( const canGraphState node) const
inlinevirtual

Heuristic value between node and the stored goal.

Asserts that the goal is stored

Reimplemented from SearchEnvironment< canGraphState, graphMove >.

Definition at line 77 of file CanonicalGraphEnvironment.h.

◆ HCost() [2/2]

double CanonicalGraphEnvironment::HCost ( const canGraphState node1,
const canGraphState node2 
) const
virtual

Heuristic value between two arbitrary nodes.

Implements SearchEnvironment< canGraphState, graphMove >.

Definition at line 127 of file CanonicalGraphEnvironment.cpp.

◆ InvertAction()

bool CanonicalGraphEnvironment::InvertAction ( graphMove a) const
virtual

◆ IsGoalStored()

bool CanonicalGraphEnvironment::IsGoalStored ( ) const
inline

Definition at line 75 of file CanonicalGraphEnvironment.h.

◆ OpenGLDraw() [1/4]

void CanonicalGraphEnvironment::OpenGLDraw ( ) const

◆ OpenGLDraw() [2/4]

void CanonicalGraphEnvironment::OpenGLDraw ( const canGraphState s) const
virtual

◆ OpenGLDraw() [3/4]

void CanonicalGraphEnvironment::OpenGLDraw ( const canGraphState ,
const canGraphState ,
float   
) const
inlinevirtual

Draw the transition at some percentage 0...1 between two states.

Reimplemented from SearchEnvironment< canGraphState, graphMove >.

Definition at line 68 of file CanonicalGraphEnvironment.h.

References OpenGLDraw().

Referenced by OpenGLDraw().

◆ OpenGLDraw() [4/4]

void CanonicalGraphEnvironment::OpenGLDraw ( const canGraphState s,
const graphMove gm 
) const
virtual

Reimplemented from SearchEnvironment< canGraphState, graphMove >.

Definition at line 286 of file CanonicalGraphEnvironment.cpp.

◆ SetDirected()

void CanonicalGraphEnvironment::SetDirected ( bool  b)
inline

Definition at line 56 of file CanonicalGraphEnvironment.h.

References directed.

◆ SetDrawEdgeCosts()

void CanonicalGraphEnvironment::SetDrawEdgeCosts ( bool  val)
inline

Definition at line 85 of file CanonicalGraphEnvironment.h.

References drawEdgeCosts.

◆ SetDrawNodeLabels()

void CanonicalGraphEnvironment::SetDrawNodeLabels ( bool  val)
inline

Definition at line 86 of file CanonicalGraphEnvironment.h.

References drawNodeLabels.

◆ SetNodeScale()

void CanonicalGraphEnvironment::SetNodeScale ( double  v)
inline

Definition at line 87 of file CanonicalGraphEnvironment.h.

References nodeScale.

◆ StoreGoal()

void CanonicalGraphEnvironment::StoreGoal ( canGraphState s)
inlinevirtual

Stores the goal for use by single-state HCost.

Reimplemented from SearchEnvironment< canGraphState, graphMove >.

Definition at line 73 of file CanonicalGraphEnvironment.h.

Member Data Documentation

◆ canonicalOrdering

std::unordered_map<canGraphState, uint8_t> CanonicalGraphEnvironment::canonicalOrdering
protected

Definition at line 90 of file CanonicalGraphEnvironment.h.

Referenced by ComputeOrdering(), and GetSuccessors().

◆ directed

bool CanonicalGraphEnvironment::directed
protected

Definition at line 91 of file CanonicalGraphEnvironment.h.

Referenced by CanonicalGraphEnvironment(), and SetDirected().

◆ drawEdgeCosts

bool CanonicalGraphEnvironment::drawEdgeCosts
protected

◆ drawNodeLabels

bool CanonicalGraphEnvironment::drawNodeLabels
protected

◆ g

Graph* CanonicalGraphEnvironment::g
protected

◆ nodeScale

double CanonicalGraphEnvironment::nodeScale
protected

Definition at line 95 of file CanonicalGraphEnvironment.h.

Referenced by CanonicalGraphEnvironment(), OpenGLDraw(), and SetNodeScale().


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