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

#include <Map2DConstrainedEnvironment.h>

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

Public Member Functions

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

Private Member Functions

bool ViolatesConstraint (const xyLoc &from, const xyLoc &to, int time) const
 

Private Attributes

std::vector< constraintconstraints
 
MapEnvironmentmapEnv
 

Additional Inherited Members

- Public Attributes inherited from Heuristic< xytLoc >
std::vector< HeuristicTreeNodelookups
 
std::vector< Heuristic * > heuristics
 
uint64_t histogram [256]
 
- Protected Attributes inherited from SearchEnvironment< xytLoc, tDirection >
bool bValidSearchGoal
 
xytLoc searchGoal
 
rgbColor color
 
GLfloat transparency
 

Detailed Description

Definition at line 37 of file Map2DConstrainedEnvironment.h.

Constructor & Destructor Documentation

◆ Map2DConstrainedEnvironment()

Map2DConstrainedEnvironment::Map2DConstrainedEnvironment ( Map m)

Definition at line 19 of file Map2DConstrainedEnvironment.cpp.

References mapEnv, and MapEnvironment::SetFourConnected().

Member Function Documentation

◆ AddConstraint() [1/3]

void Map2DConstrainedEnvironment::AddConstraint ( constraint  c)

Definition at line 25 of file Map2DConstrainedEnvironment.cpp.

References constraints.

Referenced by AddConstraint().

◆ AddConstraint() [2/3]

void Map2DConstrainedEnvironment::AddConstraint ( xytLoc  loc)

Definition at line 30 of file Map2DConstrainedEnvironment.cpp.

References AddConstraint(), and kTeleport.

◆ AddConstraint() [3/3]

void Map2DConstrainedEnvironment::AddConstraint ( xytLoc  loc,
tDirection  dir 
)

Definition at line 35 of file Map2DConstrainedEnvironment.cpp.

References constraints, constraint::dir, and constraint::loc.

◆ ApplyAction()

void Map2DConstrainedEnvironment::ApplyAction ( xytLoc s,
tDirection  a 
) const
virtual

◆ ClearConstraints()

void Map2DConstrainedEnvironment::ClearConstraints ( )

Definition at line 43 of file Map2DConstrainedEnvironment.cpp.

References constraints.

◆ GCost() [1/2]

virtual double Map2DConstrainedEnvironment::GCost ( const xytLoc node,
const tDirection act 
) const
inlinevirtual

◆ GCost() [2/2]

virtual double Map2DConstrainedEnvironment::GCost ( const xytLoc node1,
const xytLoc node2 
) const
inlinevirtual

◆ GetAction()

tDirection Map2DConstrainedEnvironment::GetAction ( const xytLoc s1,
const xytLoc s2 
) const
virtual

◆ GetActionHash()

uint64_t Map2DConstrainedEnvironment::GetActionHash ( tDirection  act) const
virtual

◆ GetActions()

void Map2DConstrainedEnvironment::GetActions ( const xytLoc nodeID,
std::vector< tDirection > &  actions 
) const
virtual

◆ GetStateHash()

uint64_t Map2DConstrainedEnvironment::GetStateHash ( const xytLoc node) const
virtual

◆ GetSuccessors()

void Map2DConstrainedEnvironment::GetSuccessors ( const xytLoc nodeID,
std::vector< xytLoc > &  neighbors 
) const
virtual

◆ GLDrawLine()

void Map2DConstrainedEnvironment::GLDrawLine ( const xytLoc x,
const xytLoc y 
) const
virtual

◆ GoalTest()

bool Map2DConstrainedEnvironment::GoalTest ( const xytLoc node,
const xytLoc goal 
) const
virtual

Implements SearchEnvironment< xytLoc, tDirection >.

Definition at line 137 of file Map2DConstrainedEnvironment.cpp.

References xytLoc::l, and xytLoc::t.

◆ HCost()

double Map2DConstrainedEnvironment::HCost ( const xytLoc node1,
const xytLoc node2 
) const
virtual

Heuristic value between two arbitrary nodes.

Implements SearchEnvironment< xytLoc, tDirection >.

Definition at line 129 of file Map2DConstrainedEnvironment.cpp.

References MapEnvironment::HCost(), xytLoc::l, mapEnv, max, and xytLoc::t.

◆ InvertAction()

bool Map2DConstrainedEnvironment::InvertAction ( tDirection a) const
virtual

◆ OpenGLDraw() [1/3]

void Map2DConstrainedEnvironment::OpenGLDraw ( ) const
virtual

◆ OpenGLDraw() [2/3]

void Map2DConstrainedEnvironment::OpenGLDraw ( const xytLoc l) const
virtual

◆ OpenGLDraw() [3/3]

void Map2DConstrainedEnvironment::OpenGLDraw ( const xytLoc ,
const tDirection  
) const
virtual

Reimplemented from SearchEnvironment< xytLoc, tDirection >.

Definition at line 186 of file Map2DConstrainedEnvironment.cpp.

◆ UndoAction()

void Map2DConstrainedEnvironment::UndoAction ( xytLoc s,
tDirection  a 
) const
virtual

◆ ViolatesConstraint()

bool Map2DConstrainedEnvironment::ViolatesConstraint ( const xyLoc from,
const xyLoc to,
int  time 
) const
private

Member Data Documentation

◆ constraints

std::vector<constraint> Map2DConstrainedEnvironment::constraints
private

◆ mapEnv

MapEnvironment* Map2DConstrainedEnvironment::mapEnv
private

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