Go to the documentation of this file.
20 :MapAbstraction(_m), sectorSize(_sectorSize), sectorMultiplier(_sectorMultiplier)
22 assert(_sectorSize>1);
23 assert(_sectorMultiplier>1);
28 :MapAbstraction(_m), sectorSize(_sectorSize), sectorMultiplier(_sectorSize)
30 assert(_sectorSize>1);
42 if ((!from) || (!to) ||
51 if ((from == 0) || (to == 0))
99 while (abstractions.back()->GetNumEdges() > 0)
104 abstractions.push_back(g);
111 for (
node *next = abstractions.back()->nodeIterNext(ni); next;
112 next = abstractions.back()->nodeIterNext(ni))
115 if (next->GetLabelL(
kParent) == -1)
131 Graph *g = abstractions.back();
140 if ((from != to) && (!(f = aGraph->
FindEdge(to, from))))
143 f =
new edge(from, to, weight);
160 abstractionBFS(abstractions.back()->GetNode(tmp), parent, quadrant);
166 assert(GetAbstractionLevel(n)+1 == GetAbstractionLevel(parent));
178 child = GetNthChild(child, 0);
187 int sectorNum = (GetMap()->GetMapWidth()/absSectorSize)*(yloc/absSectorSize)+(xloc/absSectorSize);
void SetLabelL(unsigned int index, long val) const
virtual bool Pathable(node *from, node *to)
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
virtual void AddEdge(edge *e, unsigned int absLevel)
add edge to abstraction
MapSectorAbstraction(Map *, int, int)
Creat a SectorAbstraction of the map.
int getQuadrant(node *which)
std::vector< edge * >::const_iterator edge_iterator
virtual void AddNode(node *n)
add node to abstraction
void buildNodeIntoParent(node *n, node *parent)
node * GetNode(unsigned long num)
edge * edgeIterNext(edge_iterator &) const
virtual void RemoveNode(node *n)
remove node from abstraction
std::vector< node * >::const_iterator node_iterator
virtual void RemoveEdge(edge *e, unsigned int absLevel)
remove edge from abstraction
long GetLabelL(unsigned int index) const
Graph * GetMapGraph(Map *m)
GetMapGraph(map)
edge_iterator getEdgeIter() const
void SetLabelL(unsigned int index, long val)
virtual void VerifyHierarchy()
verify that the hierarchy is consistent
int nodeNeighborNext(neighbor_iterator &) const
virtual void RepairAbstraction()
This must be called after any of the above add/remove operations.
void abstractionBFS(node *which, node *parent, int quadrant)
unsigned int GetNum() const
long GetLabelL(unsigned int index) const
neighbor_iterator getNeighborIter() const
const double kUnknownPosition
Nodes to be stored within a Graph.
A tile-based representation of the world.
Edge class for connections between node in a Graph.