HOG2
|
#include <Map2DConstrainedEnvironment.h>
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< constraint > | constraints |
MapEnvironment * | mapEnv |
Additional Inherited Members | |
Public Attributes inherited from Heuristic< xytLoc > | |
std::vector< HeuristicTreeNode > | lookups |
std::vector< Heuristic * > | heuristics |
uint64_t | histogram [256] |
Protected Attributes inherited from SearchEnvironment< xytLoc, tDirection > | |
bool | bValidSearchGoal |
xytLoc | searchGoal |
rgbColor | color |
GLfloat | transparency |
Definition at line 37 of file Map2DConstrainedEnvironment.h.
Map2DConstrainedEnvironment::Map2DConstrainedEnvironment | ( | Map * | m | ) |
Definition at line 19 of file Map2DConstrainedEnvironment.cpp.
References mapEnv, and MapEnvironment::SetFourConnected().
void Map2DConstrainedEnvironment::AddConstraint | ( | constraint | c | ) |
Definition at line 25 of file Map2DConstrainedEnvironment.cpp.
References constraints.
Referenced by AddConstraint().
void Map2DConstrainedEnvironment::AddConstraint | ( | xytLoc | loc | ) |
Definition at line 30 of file Map2DConstrainedEnvironment.cpp.
References AddConstraint(), and kTeleport.
void Map2DConstrainedEnvironment::AddConstraint | ( | xytLoc | loc, |
tDirection | dir | ||
) |
Definition at line 35 of file Map2DConstrainedEnvironment.cpp.
References constraints, constraint::dir, and constraint::loc.
|
virtual |
Implements SearchEnvironment< xytLoc, tDirection >.
Definition at line 109 of file Map2DConstrainedEnvironment.cpp.
References MapEnvironment::ApplyAction(), xytLoc::l, mapEnv, and xytLoc::t.
void Map2DConstrainedEnvironment::ClearConstraints | ( | ) |
Definition at line 43 of file Map2DConstrainedEnvironment.cpp.
References constraints.
|
inlinevirtual |
Implements SearchEnvironment< xytLoc, tDirection >.
Definition at line 57 of file Map2DConstrainedEnvironment.h.
|
inlinevirtual |
Implements SearchEnvironment< xytLoc, tDirection >.
Definition at line 56 of file Map2DConstrainedEnvironment.h.
|
virtual |
Reimplemented from SearchEnvironment< xytLoc, tDirection >.
Definition at line 104 of file Map2DConstrainedEnvironment.cpp.
References MapEnvironment::GetAction(), xytLoc::l, and mapEnv.
|
virtual |
Implements SearchEnvironment< xytLoc, tDirection >.
Definition at line 154 of file Map2DConstrainedEnvironment.cpp.
|
virtual |
Implements SearchEnvironment< xytLoc, tDirection >.
Definition at line 97 of file Map2DConstrainedEnvironment.cpp.
References MapEnvironment::GetActions(), xytLoc::l, and mapEnv.
|
virtual |
Implements SearchEnvironment< xytLoc, tDirection >.
Definition at line 143 of file Map2DConstrainedEnvironment.cpp.
|
virtual |
Implements SearchEnvironment< xytLoc, tDirection >.
Definition at line 48 of file Map2DConstrainedEnvironment.cpp.
References MapEnvironment::GetSuccessors(), xytLoc::l, mapEnv, xytLoc::t, and ViolatesConstraint().
Reimplemented from SearchEnvironment< xytLoc, tDirection >.
Definition at line 191 of file Map2DConstrainedEnvironment.cpp.
References SearchEnvironment< xytLoc, tDirection >::GetColor(), MapEnvironment::GetMap(), Map::GetOpenGLCoord(), xytLoc::l, mapEnv, xytLoc::t, xyLoc::x, and xyLoc::y.
|
virtual |
Implements SearchEnvironment< xytLoc, tDirection >.
Definition at line 137 of file Map2DConstrainedEnvironment.cpp.
|
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.
|
virtual |
Implements SearchEnvironment< xytLoc, tDirection >.
Definition at line 122 of file Map2DConstrainedEnvironment.cpp.
References MapEnvironment::InvertAction(), and mapEnv.
|
virtual |
Definition at line 160 of file Map2DConstrainedEnvironment.cpp.
References constraints, DrawSphere(), MapEnvironment::GetMap(), Map::GetOpenGLCoord(), mapEnv, MapEnvironment::OpenGLDraw(), and loc::x.
|
virtual |
Reimplemented from SearchEnvironment< xytLoc, tDirection >.
Definition at line 175 of file Map2DConstrainedEnvironment.cpp.
References DrawSphere(), SearchEnvironment< xytLoc, tDirection >::GetColor(), MapEnvironment::GetMap(), Map::GetOpenGLCoord(), xytLoc::l, mapEnv, xytLoc::t, xyLoc::x, and xyLoc::y.
|
virtual |
Reimplemented from SearchEnvironment< xytLoc, tDirection >.
Definition at line 186 of file Map2DConstrainedEnvironment.cpp.
|
virtual |
Reimplemented from SearchEnvironment< xytLoc, tDirection >.
Definition at line 115 of file Map2DConstrainedEnvironment.cpp.
References xytLoc::l, mapEnv, xytLoc::t, and SearchEnvironment< state, action >::UndoAction().
|
private |
Definition at line 79 of file Map2DConstrainedEnvironment.cpp.
References constraints, kTeleport, mapEnv, and SearchEnvironment< state, action >::UndoAction().
Referenced by GetSuccessors().
|
private |
Definition at line 70 of file Map2DConstrainedEnvironment.h.
Referenced by AddConstraint(), ClearConstraints(), OpenGLDraw(), and ViolatesConstraint().
|
private |
Definition at line 71 of file Map2DConstrainedEnvironment.h.
Referenced by ApplyAction(), GetAction(), GetActions(), GetSuccessors(), GLDrawLine(), HCost(), InvertAction(), Map2DConstrainedEnvironment(), OpenGLDraw(), UndoAction(), and ViolatesConstraint().