Go to the documentation of this file.
115 if ((one == 0) || (two == 0))
126 if ((tmp == 0) && (one == two))
205 std::vector<node*> nodes;
207 for (
unsigned int x = 0; x < nodes.size(); x++)
225 nodes.push_back(goal);
227 for (
unsigned int x = 0; x < nodes.size(); x++)
229 node *gNode = nodes[x];
244 nodes.push_back(gNeighbor);
266 return new path(gNode, 0);
378 std::vector<node *> aChildren;
379 std::vector<node *> gChildren;
387 for (
unsigned int x = 0; x < aChildren.size(); x++)
389 gChildren.push_back(
new node(
"child"));
397 for (
unsigned int x = 0; x < gChildren.size(); x++)
399 for (
unsigned int y = 0; y < gChildren.size(); y++)
404 if ((e = aGraph->
findDirectedEdge(aChildren[x]->GetNum(), aChildren[y]->GetNum())) != 0)
406 g->
AddEdge(
new edge(gChildren[x]->GetNum(), gChildren[y]->GetNum(), 1.0));
421 for (
unsigned int x = 0; x < gChildren.size(); x++)
433 for (
unsigned int x = 0; x < aChildren.size(); x++)
440 for (
unsigned int x = 0; x < aChildren.size(); x++)
485 glColor3f(1.0, 0.0, 1.0);
491 glColor3f(1.0, 1.0, 0);
493 glColor3f(0.5, 0.5, 0.5);
498 glVertex3f(rv.
x, rv.
y, rv.
z);
502 glColor3f(1.0, 0.0, 1.0);
508 glColor3f(1.0, 1.0, 0);
510 glColor3f(0.5, 0.5, 0.5);
516 glVertex3f(rv.
x, rv.
y, rv.
z);
A generic class for basic operations on Graph abstractions.
void SetLabelL(unsigned int index, long val) const
void SetLabelF(unsigned int index, double val) const
node * RemoveNode(node *, unsigned int &)
IRDijkstraConstants::NodeLookupTable closedList
edge * FindEdge(unsigned int from, unsigned int to)
Finds an edge between nodes with ids from and to, no matter which direction.
A generic vector (essentially the same as a point, but offers normalization)
unsigned int neighbor_iterator
Graph * GetAbstractGraph(int level)
return the abstract Graph at the given level
void DecreaseKey(OBJ val)
Indicate that the key for a particular object has decreased.
node * FindTopLevelNode(node *one, node *two, GraphAbstraction *aMap)
std::vector< edge * >::const_iterator edge_iterator
node * GetNthChild(node *which, int n)
bool IsIn(const OBJ val) const
Returns true if the object is in the OpenClosedList.
node * GetNode(unsigned long num)
edge * edgeIterNext(edge_iterator &) const
bool ShouldAddEdge(node *aLowerNode, node *aHigherNode)
long GetAbstractionLevel(node *which)
edge_iterator getEdgeIter() const
void Add(OBJ val)
Add object into OpenClosedList.
bool fless(double a, double b)
long GetNumChildren(node *which)
IRDijkstraConstants::PQueue q
bool fgreater(double a, double b)
GraphAbstraction * absGraph
int nodeNeighborNext(neighbor_iterator &) const
bool InitializeSearch(GraphAbstraction *aMap, node *from, node *to)
unsigned int getNumAbstractGraphs()
return the total number of graphs in the hierarchy
std::vector< xyLoc > path
path * ExtractAndRefinePath()
double GetLabelF(unsigned int index) const
void RefineNode(node *gNode)
unsigned int GetNum() const
virtual const char * GetName()
path * GetSolution(node *gNode)
A generic algorithm which can be used for pathfinding.
bool IsParentOf(node *parent, node *child)
return true if the first node is a parent of or is equal two the second node
virtual recVec GetNodeLoc(node *) const
long GetLabelL(unsigned int index) const
A linked list of nodes which form a continuous path.
neighbor_iterator getNeighborIter() const
void ExpandNeighbors(node *gNode)
edge * findDirectedEdge(unsigned int from, unsigned int to)
bool fequal(double a, double b, double tolerance=TOLERANCE)
node * GetParent(node *which)
void reset()
Remove all objects from queue.
node * GetRealNode(node *gNode) const
void SetInitialValues(node *gNewNode, node *aRealNode, node *gParent)
Nodes to be stored within a Graph.
void GetAllSolutionNodes(node *goal, std::vector< node * > &nodes)
virtual path * GetPath(GraphAbstraction *aMap, node *from, node *to, reservationProvider *rp=0)
Edge class for connections between node in a Graph.