HOG2
|
#include <MapSectorAbstraction.h>
Public Member Functions | |
MapSectorAbstraction (Map *, int, int) | |
Creat a SectorAbstraction of the map. More... | |
MapSectorAbstraction (Map *, int) | |
~MapSectorAbstraction () | |
MapAbstraction * | Clone (Map *_m) |
virtual bool | Pathable (node *from, node *to) |
virtual void | VerifyHierarchy () |
verify that the hierarchy is consistent More... | |
virtual void | RemoveNode (node *n) |
remove node from abstraction More... | |
virtual void | RemoveEdge (edge *e, unsigned int absLevel) |
remove edge from abstraction More... | |
virtual void | AddNode (node *n) |
add node to abstraction More... | |
virtual void | AddEdge (edge *e, unsigned int absLevel) |
add edge to abstraction More... | |
virtual void | RepairAbstraction () |
This must be called after any of the above add/remove operations. More... | |
Private Member Functions | |
void | buildAbstraction () |
void | buildNodeIntoParent (node *n, node *parent) |
void | abstractionBFS (node *which, node *parent, int quadrant) |
int | getQuadrant (node *which) |
void | addEdges (Graph *g) |
void | addNodes (Graph *g) |
Private Attributes | |
int | sectorSize |
int | sectorMultiplier |
Definition at line 17 of file MapSectorAbstraction.h.
MapSectorAbstraction::MapSectorAbstraction | ( | Map * | _m, |
int | _sectorSize, | ||
int | _sectorMultiplier | ||
) |
Creat a SectorAbstraction of the map.
The sector size must be greater than 1
Definition at line 19 of file MapSectorAbstraction.cpp.
References buildAbstraction().
Referenced by Clone().
MapSectorAbstraction::MapSectorAbstraction | ( | Map * | _m, |
int | _sectorSize | ||
) |
Definition at line 27 of file MapSectorAbstraction.cpp.
References buildAbstraction().
MapSectorAbstraction::~MapSectorAbstraction | ( | ) |
Definition at line 34 of file MapSectorAbstraction.cpp.
Definition at line 151 of file MapSectorAbstraction.cpp.
References buildNodeIntoParent(), node::GetLabelL(), node::getNeighborIter(), getQuadrant(), GraphAbstractionConstants::kParent, and node::nodeNeighborNext().
Referenced by addNodes().
|
virtual |
add edge to abstraction
Definition at line 83 of file MapSectorAbstraction.cpp.
|
private |
Definition at line 129 of file MapSectorAbstraction.cpp.
References Graph::AddEdge(), Graph::edgeIterNext(), Graph::FindEdge(), Graph::getEdgeIter(), edge::GetLabelL(), node::GetLabelL(), Graph::GetNode(), GraphAbstractionConstants::kEdgeCapacity, GraphAbstractionConstants::kParent, and edge::SetLabelL().
Referenced by buildAbstraction().
|
virtual |
add node to abstraction
Definition at line 76 of file MapSectorAbstraction.cpp.
|
private |
Definition at line 108 of file MapSectorAbstraction.cpp.
References abstractionBFS(), Graph::AddNode(), getQuadrant(), GraphAbstractionConstants::kAbstractionLevel, GraphAbstractionConstants::kNodeBlocked, GraphAbstractionConstants::kNumAbstractedNodes, GraphAbstractionConstants::kParent, GraphAbstractionConstants::kUnknownPosition, GraphAbstractionConstants::kXCoordinate, node::SetLabelF(), and node::SetLabelL().
Referenced by buildAbstraction().
|
private |
Definition at line 95 of file MapSectorAbstraction.cpp.
References addEdges(), addNodes(), and GetMapGraph().
Referenced by MapSectorAbstraction().
Definition at line 164 of file MapSectorAbstraction.cpp.
References node::GetLabelL(), node::GetNum(), GraphAbstractionConstants::kFirstData, GraphAbstractionConstants::kNumAbstractedNodes, GraphAbstractionConstants::kParent, GraphAbstractionConstants::kUnknownPosition, GraphAbstractionConstants::kXCoordinate, node::SetLabelF(), and node::SetLabelL().
Referenced by abstractionBFS().
|
inline |
Definition at line 23 of file MapSectorAbstraction.h.
References MapSectorAbstraction(), and sectorSize.
|
private |
Definition at line 173 of file MapSectorAbstraction.cpp.
References node::GetLabelL(), GraphAbstractionConstants::kAbstractionLevel, GraphAbstractionConstants::kFirstData, sectorMultiplier, and sectorSize.
Referenced by abstractionBFS(), and addNodes().
Definition at line 38 of file MapSectorAbstraction.cpp.
References node::GetLabelL(), GraphAbstractionConstants::kAbstractionLevel, and GraphAbstractionConstants::kParent.
|
virtual |
remove edge from abstraction
Definition at line 70 of file MapSectorAbstraction.cpp.
|
virtual |
remove node from abstraction
Definition at line 64 of file MapSectorAbstraction.cpp.
|
virtual |
This must be called after any of the above add/remove operations.
But the operations can be stacked followed by a single RepairAbstraction call.
Definition at line 91 of file MapSectorAbstraction.cpp.
|
virtual |
verify that the hierarchy is consistent
Definition at line 58 of file MapSectorAbstraction.cpp.
|
private |
Definition at line 52 of file MapSectorAbstraction.h.
Referenced by getQuadrant().
|
private |
Definition at line 52 of file MapSectorAbstraction.h.
Referenced by Clone(), and getQuadrant().