HOG2
|
#include <GraphEnvironment.h>
Public Member Functions | |
GraphDistanceHeuristic (Graph *graph) | |
~GraphDistanceHeuristic () | |
virtual double | HCost (const graphState &state1, const graphState &state2) const |
void | AddHeuristic (node *n=0) |
int | GetNumHeuristics () |
void | SetPlacement (placementScheme s) |
Graph * | GetGraph () |
void | ChooseStartGoal (graphState &start, graphState &goal) |
virtual void | OpenGLDraw () const |
Public Member Functions inherited from GraphHeuristic | |
virtual | ~GraphHeuristic () |
Protected Member Functions | |
void | GetOptimalDistances (node *n, std::vector< double > &values) |
void | AddHeuristic (std::vector< double > &values, graphState location) |
node * | FindFarNode (node *n) |
node * | FindAvoidNode (node *n) |
node * | FindBestChild (int best, std::vector< double > &dist, std::vector< double > &weight) |
void | ComputeSizes (node *n, std::vector< double > &dist, std::vector< double > &weight, std::vector< double > &sizes) |
Protected Attributes | |
placementScheme | placement |
Graph * | g |
std::vector< std::vector< double > > | heuristics |
std::vector< graphState > | locations |
std::vector< double > | dist |
std::vector< double > | weight |
std::vector< double > | sizes |
Definition at line 222 of file GraphEnvironment.h.
|
inline |
Definition at line 224 of file GraphEnvironment.h.
References kRandomPlacement, and placement.
|
inline |
Definition at line 225 of file GraphEnvironment.h.
void GraphDistanceHeuristic::AddHeuristic | ( | node * | n = 0 | ) |
Definition at line 1564 of file GraphEnvironment.cpp.
References FindAvoidNode(), FindFarNode(), g, node::GetNum(), GetOptimalDistances(), Graph::GetRandomNode(), kAvoidPlacement, kFarPlacement, and placement.
Referenced by GraphPuzzleDistanceHeuristic< width, height >::GraphPuzzleDistanceHeuristic(), MyPathfindingKeyHandler(), and MyRandomUnitKeyHandler().
|
protected |
Definition at line 1579 of file GraphEnvironment.cpp.
References heuristics, and locations.
|
virtual |
Reimplemented from GraphHeuristic.
Definition at line 1540 of file GraphEnvironment.cpp.
References heuristics.
|
protected |
Definition at line 1695 of file GraphEnvironment.cpp.
References dist, fequal(), Graph::FindEdge(), g, node::getNeighborIter(), Graph::GetNode(), node::GetNum(), edge::GetWeight(), locations, node::nodeNeighborNext(), sizes, and weight.
Referenced by FindAvoidNode().
Definition at line 1630 of file GraphEnvironment.cpp.
References ComputeSizes(), dist, FindBestChild(), FindFarNode(), fless(), g, Graph::GetNode(), node::GetNum(), GetOptimalDistances(), Graph::GetRandomNode(), HCost(), heuristics, locations, max, MAXINT, sizes, and weight.
Referenced by AddHeuristic().
|
protected |
Definition at line 1743 of file GraphEnvironment.cpp.
References dist, fequal(), Graph::FindEdge(), fless(), g, node::getNeighborIter(), Graph::GetNode(), node::GetNum(), edge::GetWeight(), node::nodeNeighborNext(), and sizes.
Referenced by FindAvoidNode().
Definition at line 1778 of file GraphEnvironment.cpp.
References Heap::Add(), Heap::DecreaseKey(), Heap::Empty(), fgreater(), Graph::FindEdge(), g, node::GetLabelF(), node::getNeighborIter(), Graph::GetNode(), node::GetNum(), Graph::GetNumNodes(), edge::GetWeight(), Heap::IsIn(), GraphAbstractionConstants::kTemporaryLabel, locations, node::nodeNeighborNext(), Heap::Remove(), node::SetKeyLabel(), and node::SetLabelF().
Referenced by AddHeuristic(), and FindAvoidNode().
|
inlinevirtual |
Implements GraphHeuristic.
Definition at line 230 of file GraphEnvironment.h.
References g.
Referenced by MyRandomUnitKeyHandler().
|
inline |
Definition at line 228 of file GraphEnvironment.h.
References heuristics.
Referenced by GraphMapInconsistentHeuristic::SetNumUsedHeuristics().
|
protected |
Definition at line 1587 of file GraphEnvironment.cpp.
References Heap::Add(), Heap::DecreaseKey(), Heap::Empty(), fgreater(), Graph::FindEdge(), g, node::GetLabelF(), node::getNeighborIter(), Graph::GetNode(), node::GetNum(), Graph::GetNumNodes(), edge::GetWeight(), Heap::IsIn(), GraphAbstractionConstants::kTemporaryLabel, node::nodeNeighborNext(), Heap::Remove(), node::SetKeyLabel(), and node::SetLabelF().
Referenced by AddHeuristic(), and FindAvoidNode().
|
virtual |
Implements GraphHeuristic.
Reimplemented in GraphMapInconsistentHeuristic, and GraphPuzzleDistanceHeuristic< width, height >.
Definition at line 1526 of file GraphEnvironment.cpp.
References fgreater(), and heuristics.
Referenced by FindAvoidNode(), and MyRandomUnitKeyHandler().
|
virtual |
Reimplemented from GraphHeuristic.
Reimplemented in GraphMapInconsistentHeuristic.
Definition at line 1477 of file GraphEnvironment.cpp.
References dist, DrawSphere(), g, node::GetLabelF(), Graph::GetNode(), Graph::GetNumNodes(), heuristics, GraphSearchConstants::kXCoordinate, GraphSearchConstants::kYCoordinate, GraphSearchConstants::kZCoordinate, locations, sizes, and weight.
Referenced by MyFrameHandler().
|
inline |
Definition at line 229 of file GraphEnvironment.h.
References placement.
Referenced by MyPathfindingKeyHandler(), and MyRandomUnitKeyHandler().
|
protected |
Definition at line 249 of file GraphEnvironment.h.
Referenced by ComputeSizes(), FindAvoidNode(), FindBestChild(), and OpenGLDraw().
|
protected |
Definition at line 244 of file GraphEnvironment.h.
Referenced by AddHeuristic(), ComputeSizes(), GraphMapInconsistentHeuristic::FillInCache(), FindAvoidNode(), FindBestChild(), FindFarNode(), GetGraph(), GetOptimalDistances(), GraphMapInconsistentHeuristic::HCost(), OpenGLDraw(), and GraphMapInconsistentHeuristic::OpenGLDraw().
|
protected |
Definition at line 245 of file GraphEnvironment.h.
Referenced by AddHeuristic(), ChooseStartGoal(), GraphMapInconsistentHeuristic::Compress(), GraphMapInconsistentHeuristic::FillInCache(), FindAvoidNode(), GetNumHeuristics(), HCost(), GraphMapInconsistentHeuristic::HCost(), GraphMapInconsistentHeuristic::IncreaseDisplayHeuristic(), OpenGLDraw(), and GraphMapInconsistentHeuristic::OpenGLDraw().
|
protected |
Definition at line 246 of file GraphEnvironment.h.
Referenced by AddHeuristic(), ComputeSizes(), FindAvoidNode(), FindFarNode(), and OpenGLDraw().
|
protected |
Definition at line 243 of file GraphEnvironment.h.
Referenced by AddHeuristic(), GraphDistanceHeuristic(), and SetPlacement().
|
protected |
Definition at line 251 of file GraphEnvironment.h.
Referenced by ComputeSizes(), FindAvoidNode(), FindBestChild(), and OpenGLDraw().
|
protected |
Definition at line 250 of file GraphEnvironment.h.
Referenced by ComputeSizes(), FindAvoidNode(), and OpenGLDraw().