Go to the documentation of this file.
41 if ((from == 0) || (to == 0) || (!aMap->
Pathable(from, to)) || (from == to))
46 std::vector<node *> closedList;
61 closedList.push_back(n);
62 n->
key = closedList.size()-1;
74 if ((which = e->getFrom()) == n->
GetNum()) which = e->getTo();
79 if (openList->
IsIn(nextChild))
88 closedList.push_back(nextChild);
89 nextChild->
key = closedList.size()-1;
93 else if ((nextChild->
key >= closedList.size()) ||
94 (closedList[nextChild->
key] != nextChild))
99 openList->
Add(nextChild);
101 printf(
"Adding neighbor/child %d\n", which);
111 if (n == 0) {
delete openList;
return 0; }
145 if (
verbose) printf(
"%d <- ", current);
153 current = e->
getTo();
158 if (
verbose) printf(
"%d\n", current);
A generic class for basic operations on Graph abstractions.
path * extractBestPath(Graph *g, unsigned int current)
void SetLabelF(unsigned int index, double val) const
unsigned int getFrom() const
unsigned int getTo() const
path * GetPath(GraphAbstraction *aMap, node *from, node *to, reservationProvider *rp=0)
Graph * GetAbstractGraph(int level)
return the abstract Graph at the given level
void setMarked(bool marked)
std::vector< edge * >::const_iterator edge_iterator
void DecreaseKey(graph_object *val)
Indicate that the key for a particular object has decreased.
void relaxEdge(Heap *nodeHeap, Graph *g, edge *e, int source, int nextNode, node *to)
node * GetNode(unsigned long num)
edge_iterator getEdgeIter() const
virtual double h(node *a, node *b)=0
heuristic cost between any two nodes
void SetKeyLabel(int which)
virtual bool Pathable(node *from, node *to)=0
is there a legal path between these 2 nodes?
bool fless(double a, double b)
graph_object * Remove()
Remove the item with the lowest key from the Heap & re-heapify.
void Add(graph_object *val)
Add object into Heap.
aStarOld(double _w=1.0, bool _doPathDraw=true)
std::vector< xyLoc > path
double GetLabelF(unsigned int index) const
A simple & efficient Heap class which uses Graph objects.
unsigned int GetNum() const
A generic algorithm which can be used for pathfinding.
long GetLabelL(unsigned int index) const
A linked list of nodes which form a continuous path.
virtual bool nodeOccupied(node *)=0
bool fequal(double a, double b, double tolerance=TOLERANCE)
edge * edgeIterNext(edge_iterator &) const
Nodes to be stored within a Graph.
bool IsIn(graph_object *val)
Returns true if the object is in the Heap.
Edge class for connections between node in a Graph.