Go to the documentation of this file.
33 :MapAbstraction(_m), nodeLimit(_NodeLimit)
48 if ((!from) || (!to) ||
57 if ((from == 0) || (to == 0))
103 while (abstractions.back()->GetNumEdges() > 0)
108 abstractions.push_back(g);
114 int count = abstractions.back()->GetNumNodes();
118 node *next = abstractions.back()->GetRandomNode();
125 assert(parent!=NULL);
139 Graph *g = abstractions.back();
147 if ((from != to) && (!(f = aGraph->
FindEdge(to, from))))
150 f =
new edge(from, to, weight);
160 std::vector<node *> q;
161 Graph *g = GetAbstractGraph(which);
168 for (
unsigned int x = 0; x < q.size(); x++)
174 for (
int next = q[x]->nodeNeighborNext(ni); next != -1; next = q[x]->nodeNeighborNext(ni))
211 assert(GetAbstractionLevel(n)+1 == GetAbstractionLevel(parent));
void SetLabelL(unsigned int index, long val) const
void SetLabelF(unsigned int index, double val) const
edge * FindEdge(unsigned int from, unsigned int to)
Finds an edge between nodes with ids from and to, no matter which direction.
unsigned int neighbor_iterator
void buildNodeIntoParent(node *n, node *parent)
std::vector< edge * >::const_iterator edge_iterator
virtual void RepairAbstraction()
This must be called after any of the above add/remove operations.
virtual bool Pathable(node *from, node *to)
node * GetNode(unsigned long num)
edge * edgeIterNext(edge_iterator &) const
NodeLimitAbstraction(Map *, int nodeLimit)
long GetLabelL(unsigned int index) const
virtual void RemoveEdge(edge *e, unsigned int absLevel)
remove edge from abstraction
Graph * GetMapGraph(Map *m)
GetMapGraph(map)
edge_iterator getEdgeIter() const
void abstractionBFS(node *which, node *parent, int depth)
virtual void VerifyHierarchy()
verify that the hierarchy is consistent
void SetLabelL(unsigned int index, long val)
virtual void AddNode(node *n)
add node to abstraction
unsigned int GetNum() const
long GetLabelL(unsigned int index) const
virtual void AddEdge(edge *e, unsigned int absLevel)
add edge to abstraction
const double kUnknownPosition
virtual void RemoveNode(node *n)
remove node from abstraction
Nodes to be stored within a Graph.
A tile-based representation of the world.
Edge class for connections between node in a Graph.