HOG2
|
A graph environment to use with the a graph abstraction. More...
#include <AbstractWeightedSearchAlgorithm.h>
Public Member Functions | |
AbsGraphEnvironment (Graph *_g, GraphHeuristic *gh, AbsMapEnvironment *me, BaseMapOccupancyInterface *bmoi) | |
void | SetAbsGraph (Graph *_g) |
void | SetWeightedEnvironment (WeightedMap2DEnvironment *w) |
~AbsGraphEnvironment () | |
GraphOccupancyInterface * | GetOccupancyInfo () |
void | SetFindExactGoal (bool b) |
Set to true when we want to find the exact goal rather than any child of the parent of the goal. More... | |
bool | GoalTest (const graphState &state, const graphState &goal) |
If exactGoal is set, GoalTest returns true when state is the same as goal. More... | |
double | HCost (const graphState &state1, const graphState &state2) const |
Heuristic value between two arbitrary nodes. More... | |
void | Print (graphState &s) |
virtual double | GCost (const graphState &state1, const graphMove &state2) |
double | GCost (const graphState &state1, const graphState &state2) |
GCost returns a weighted GCost from the WeightedMap2DEnvironment. More... | |
void | SetNoDummyGoal (bool b) |
virtual void | StoreGoal (graphState &) |
Stores the goal for use by single-state HCost. More... | |
virtual void | ClearGoal () |
Clears the goal from memory. More... | |
virtual bool | IsGoalStored () const |
virtual double | HCost (const graphState &) const |
Heuristic value between node and the stored goal. More... | |
bool | GoalTest (const graphState &) |
Public Member Functions inherited from GraphEnvironment | |
GraphEnvironment (Graph *g, GraphHeuristic *gh=0) | |
GraphEnvironment (Map *m, Graph *g, GraphHeuristic *gh=0) | |
virtual | ~GraphEnvironment () |
virtual void | GetSuccessors (const graphState &stateID, std::vector< graphState > &neighbors) const |
virtual int | GetNumSuccessors (const graphState &stateID) const |
virtual void | GetActions (const graphState &stateID, std::vector< graphMove > &actions) const |
virtual graphMove | GetAction (const graphState &s1, const graphState &s2) const |
virtual void | ApplyAction (graphState &s, graphMove a) const |
virtual bool | InvertAction (graphMove &a) const |
void | SetDirected (bool b) |
virtual double | GCost (const graphState &state1, const graphState &state2) const |
virtual double | GCost (const graphState &state1, const graphMove &state2) const |
virtual bool | GoalTest (const graphState &state, const graphState &goal) const |
virtual uint64_t | GetMaxHash () const |
virtual uint64_t | GetStateHash (const graphState &state) const |
virtual void | GetStateFromHash (uint64_t parent, graphState &s) const |
virtual uint64_t | GetActionHash (graphMove act) const |
virtual void | OpenGLDraw () const |
virtual void | OpenGLDraw (const graphState &s) const |
virtual void | OpenGLDraw (const graphState &s, const graphMove &gm) const |
virtual void | OpenGLDraw (const graphState &s, const graphState &, float) const |
Draw the transition at some percentage 0...1 between two states. More... | |
virtual void | GLDrawLine (const graphState &x, const graphState &y) const |
virtual void | GLLabelState (const graphState &, const char *) const |
std::string | SVGHeader () const |
std::string | SVGDraw () const |
std::string | SVGDraw (const graphState &s) const |
std::string | SVGLabelState (const graphState &s, const char *) const |
virtual void | Draw (Graphics::Display &disp) const |
void | DrawLERP (Graphics::Display &disp, Graph *a, Graph *b, float mix) const |
void | DrawLERP (Graphics::Display &disp, Graph *a, Graph *b, float mix, std::function< float(float, float, float)> l1, std::function< float(float, float, float)> l2) const |
void | DrawLERP (Graphics::Display &disp, Graph *a, Graph *b, graphState sa, graphState sb, float mix, std::function< float(float, float, float)> l1, std::function< float(float, float, float)> l2) const |
virtual void | Draw (Graphics::Display &disp, const graphState &l) const |
virtual void | DrawStateLabel (Graphics::Display &disp, const graphState &l1, const char *txt) const |
virtual void | DrawLine (Graphics::Display &disp, const graphState &x, const graphState &y, double width=1.0) const |
virtual void | DrawLine (Graphics::Display &disp, float x1, float y1, float x2, float y2, double width=1.0) const |
Graphics::point | GetLocation (const graphState &s) const |
Graph * | GetGraph () |
virtual bool | GoalTest (const graphState &) const |
Goal Test if the goal is stored. More... | |
void | SetIntegerEdgeCosts (bool val) |
void | SetDrawEdgeCosts (bool val) |
void | SetDrawNodeLabels (bool val) |
void | SetNodeScale (double v) |
double | GetNodeScale () |
Public Member Functions inherited from SearchEnvironment< graphState, graphMove > | |
virtual | ~SearchEnvironment () |
virtual void | UndoAction (graphState &s, graphMove a) const |
virtual void | GetNextState (const graphState &s1, graphMove a, graphState &s2) const |
virtual bool | IsGoalStored () const |
Returns true if the goal is stored and false otherwise. More... | |
virtual double | HCost (const graphState &node1, const graphState &node2, double parentHCost) const |
virtual uint64_t | GetMaxHash () const |
virtual double | GetPathLength (std::vector< graphState > &neighbors) |
virtual double | GetPathLength (const graphState &start, std::vector< graphMove > &neighbors) |
virtual void | SetOccupancyInfo (OccupancyInterface< graphState, graphMove > *) |
virtual void | OpenGLDraw () const |
virtual void | GLDrawPath (const std::vector< graphState > &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 | DrawLine (Graphics::Display &display, const graphState &x, const graphState &y, float width=1.0) const |
Public Member Functions inherited from Heuristic< graphState > | |
Heuristic () | |
virtual | ~Heuristic () |
Private Attributes | |
Graph * | g |
Graph * | abs |
WeightedMap2DEnvironment * | wenv |
GraphHeuristic * | h |
AbsMapEnvironment * | regenv |
GraphOccupancyInterface * | goi |
bool | exactGoal |
bool | noDummyGoal |
Additional Inherited Members | |
Public Attributes inherited from Heuristic< graphState > | |
std::vector< HeuristicTreeNode > | lookups |
std::vector< Heuristic * > | heuristics |
uint64_t | histogram [256] |
Protected Attributes inherited from GraphEnvironment | |
bool | directed |
Map * | m |
Graph * | g |
GraphHeuristic * | h |
bool | drawEdgeCosts |
bool | integerEdgeCosts |
bool | drawNodeLabels |
double | nodeScale |
Protected Attributes inherited from SearchEnvironment< graphState, graphMove > | |
bool | bValidSearchGoal |
graphState | searchGoal |
rgbColor | color |
GLfloat | transparency |
A graph environment to use with the a graph abstraction.
Definition at line 77 of file AbstractWeightedSearchAlgorithm.h.
|
inline |
Definition at line 80 of file AbstractWeightedSearchAlgorithm.h.
References exactGoal, g, goi, h, noDummyGoal, regenv, GraphEnvironment::SetDirected(), and wenv.
|
inline |
Definition at line 84 of file AbstractWeightedSearchAlgorithm.h.
|
inlinevirtual |
Clears the goal from memory.
Reimplemented from GraphEnvironment.
Definition at line 232 of file AbstractWeightedSearchAlgorithm.h.
|
inlinevirtual |
Definition at line 197 of file AbstractWeightedSearchAlgorithm.h.
|
inline |
GCost returns a weighted GCost from the WeightedMap2DEnvironment.
Definition at line 203 of file AbstractWeightedSearchAlgorithm.h.
References g, WeightedMap2DEnvironment::GCost(), node::GetLabelL(), Graph::GetNode(), GraphAbstractionConstants::kAbstractionLevel, GraphAbstractionConstants::kFirstData, wenv, xyLoc::x, and xyLoc::y.
|
inlinevirtual |
Reimplemented from GraphEnvironment.
Definition at line 86 of file AbstractWeightedSearchAlgorithm.h.
References goi.
|
inline |
Definition at line 239 of file AbstractWeightedSearchAlgorithm.h.
|
inline |
If exactGoal is set, GoalTest returns true when state is the same as goal.
If exactGoal is not set, GoalTest returns true if state and goal have the same parent
Definition at line 101 of file AbstractWeightedSearchAlgorithm.h.
References exactGoal, g, node::GetLabelL(), Graph::GetNode(), GraphAbstractionConstants::kParent, and noDummyGoal.
|
inlinevirtual |
Heuristic value between node and the stored goal.
Asserts that the goal is stored
Reimplemented from GraphEnvironment.
Definition at line 235 of file AbstractWeightedSearchAlgorithm.h.
|
inlinevirtual |
Heuristic value between two arbitrary nodes.
Reimplemented from GraphEnvironment.
Definition at line 130 of file AbstractWeightedSearchAlgorithm.h.
References abs, exactGoal, g, node::GetLabelL(), Graph::GetNode(), h, GraphHeuristic::HCost(), GraphAbstractionConstants::kFirstData, GraphAbstractionConstants::kParent, noDummyGoal, regenv, xyLoc::x, and xyLoc::y.
|
inlinevirtual |
Reimplemented from GraphEnvironment.
Definition at line 233 of file AbstractWeightedSearchAlgorithm.h.
|
inline |
Definition at line 168 of file AbstractWeightedSearchAlgorithm.h.
References g, node::GetLabelL(), Graph::GetNode(), and GraphAbstractionConstants::kFirstData.
|
inline |
Definition at line 82 of file AbstractWeightedSearchAlgorithm.h.
References abs.
Referenced by AbstractWeightedSearchAlgorithm< state, action, environment >::GetPath().
|
inline |
Set to true when we want to find the exact goal rather than any child of the parent of the goal.
Definition at line 97 of file AbstractWeightedSearchAlgorithm.h.
References exactGoal.
Referenced by AbstractWeightedSearchAlgorithm< state, action, environment >::GetPath().
|
inline |
Definition at line 229 of file AbstractWeightedSearchAlgorithm.h.
References noDummyGoal.
Referenced by AbstractWeightedSearchAlgorithm< state, action, environment >::GetPath().
|
inline |
Definition at line 83 of file AbstractWeightedSearchAlgorithm.h.
References wenv.
Referenced by AbstractWeightedSearchAlgorithm< state, action, environment >::GetPath().
|
inlinevirtual |
Stores the goal for use by single-state HCost.
Reimplemented from GraphEnvironment.
Definition at line 231 of file AbstractWeightedSearchAlgorithm.h.
|
private |
Definition at line 245 of file AbstractWeightedSearchAlgorithm.h.
Referenced by HCost(), and SetAbsGraph().
|
private |
Definition at line 250 of file AbstractWeightedSearchAlgorithm.h.
Referenced by AbsGraphEnvironment(), GoalTest(), HCost(), and SetFindExactGoal().
|
private |
Definition at line 244 of file AbstractWeightedSearchAlgorithm.h.
Referenced by AbsGraphEnvironment(), GCost(), GoalTest(), HCost(), and Print().
|
private |
Definition at line 249 of file AbstractWeightedSearchAlgorithm.h.
Referenced by AbsGraphEnvironment(), and GetOccupancyInfo().
|
private |
Definition at line 247 of file AbstractWeightedSearchAlgorithm.h.
Referenced by AbsGraphEnvironment(), and HCost().
|
private |
Definition at line 251 of file AbstractWeightedSearchAlgorithm.h.
Referenced by AbsGraphEnvironment(), GoalTest(), HCost(), and SetNoDummyGoal().
|
private |
Definition at line 248 of file AbstractWeightedSearchAlgorithm.h.
Referenced by AbsGraphEnvironment(), and HCost().
|
private |
Definition at line 246 of file AbstractWeightedSearchAlgorithm.h.
Referenced by AbsGraphEnvironment(), GCost(), and SetWeightedEnvironment().