Go to the documentation of this file.
14 #define MAXFLOAT ((float)3.40282346638528860e+38)
33 if ((from == 0) || (to == 0) || (!
aMap->
Pathable(from, to)) || (from == to))
44 if (currOpenNode == 0)
49 if (
verbose) printf(
"Expanding %d\n", currOpenNode->
GetNum());
61 if (currOpenNode == to)
74 if ((which = e->getFrom()) == currOpenNode->
GetNum()) which = e->getTo();
93 if (
verbose) printf(
"->Child %d new to search f(%f) g(%f) h(%f)\n",
neighbor->GetNum(),
132 if (
verbose) printf(
"Moved %d to current open list\n", n->
GetNum());
133 (*nextList)[n->
key] = 0;
202 printf(
"setHCost Error: node %d not found!\n", n->
GetNum());
214 printf(
"Error: node %d not found!\n", n->
GetNum());
232 if (
verbose) printf(
"Doing regular path max!\n");
239 if (
verbose) printf(
"-> %d h value raised from %f to %f\n", parent->
GetNum(),
242 if (
verbose) printf(
"Doing reverse path max!\n");
261 if (
verbose) printf(
"Updated g-cost of %d from %f to %f (through %d) -- (%f limit)\n", n->
GetNum(),
304 printf(
"Beginning new iteration, flimit %f, %d items in q\n",
323 if ((which = e->getFrom()) == n->
GetNum()) which = e->getTo();
330 if (
verbose) printf(
"%d h value raised from %f to %f\n",
neighbor->GetNum(),
355 if ((which = e->getFrom()) == n->
GetNum()) which = e->getTo();
371 return aMap->
h(n1, n2);
virtual double h(uint32_t node1, uint32_t node2)=0
void addToOpenList(node *n)
A generic class for basic operations on Graph abstractions.
void SetLabelL(unsigned int index, long val) const
unsigned int getFrom() const
unsigned int getTo() const
double min(double a, double b)
Graph * GetAbstractGraph(int level)
return the abstract Graph at the given level
void propagateGValues(node *n)
void setMarked(bool marked)
void initializeSearch(GraphAbstraction *aGraph, node *from, node *to)
unsigned int nodesReopened
std::vector< edge * >::const_iterator edge_iterator
node * GetNode(unsigned long num)
void addToOpenList2(node *n)
edge_iterator getEdgeIter() const
virtual double h(node *a, node *b)=0
heuristic cost between any two nodes
void addToClosedList(node *n)
virtual bool Pathable(node *from, node *to)=0
is there a legal path between these 2 nodes?
double h(node *n1, node *n2)
virtual path * GetPath(GraphAbstraction *aMap, node *from, node *to, reservationProvider *rp=0)
void updateCosts(node *n, node *parent, edge *e)
void moveToOpenList1(node *n)
bool fless(double a, double b)
void propagateHValues(node *n, int dist=10000)
void addCosts(node *n, node *parent, edge *e)
bool onClosedList(node *n)
bool fgreater(double a, double b)
path * extractBestPath(node *n)
unsigned int nodesHPropagated
std::vector< xyLoc > path
void setHCost(node *n, double val)
unsigned int GetNum() const
void getCosts(node *n, costs &val)
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.
edge * edgeIterNext(edge_iterator &) const
std::vector< node * > nodeList
Nodes to be stored within a Graph.
Edge class for connections between node in a Graph.