OverSim
|
#include <CoordBasedRouting.h>
Public Member Functions | |
CoordBasedRouting () | |
~CoordBasedRouting () | |
OverlayKey | getNodeId (const Coords &coords, uint8_t bpd, uint8_t length, const AP *cap=NULL) const |
returns a NodeID with given length and prefix according to coords' area. | |
uint8_t | getXmlDimensions () const |
returns the number of dimensions set in the XML file. | |
double | getEuclidianDistanceByKeyAndCoords (const OverlayKey &destKey, const std::vector< double > &nodeCoords, uint8_t bpd, const AP *cap=NULL) const |
const AP * | calculateCapFromCcd (const CD &ccd, uint8_t bpd) |
bool | changeIdLater () const |
simtime_t | getChangeIdStart () const |
simtime_t | getChangeIdStop () const |
Protected Member Functions | |
virtual void | initialize () |
CBR is a global module, stuff in initialize() is run once Parsing the area source XML is done here. | |
void | finish () |
Private Member Functions | |
void | parseSource (const char *areaCoordinateSource) |
parses the area source XML and puts the resulting areas into gap | |
std::string | getPrefix (const Coords &coords, const AP *cap=NULL) const |
auxiliary protected function which returns the NodeID prefix of the given coords' area | |
bool | checkDimensions (uint8_t dims) const |
returns if given coords' dimensions value (from underlay or overlay calculations) is matching the dimensions value in the area source XML. | |
void | splitNodes (CD &nodes, const std::string &prefix, const Coords &bottoms, const Coords &tops, uint8_t depth, AP *cap) |
Private Attributes | |
const char * | areaCoordinateSource |
uint8_t | cbrStartAtDigit |
uint8_t | cbrStopAtDigit |
uint8_t | xmlDimensions |
bool | cbrChangeIdLater |
simtime_t | cbrChangeIdStart |
simtime_t | cbrChangeIdStop |
AP * | gap |
GlobalNodeList * | globalNodeList |
uint8_t | ccdDim |
uint16_t | maxPrefix |
Static Private Attributes | |
static const std::string | NOPREFIX = "NOPREFIX" |
Definition at line 66 of file CoordBasedRouting.h.
|
inline |
Definition at line 124 of file CoordBasedRouting.h.
|
inline |
Definition at line 125 of file CoordBasedRouting.h.
Definition at line 188 of file CoordBasedRouting.cc.
Referenced by GlobalViewBuilder::spreadGlobalView().
|
inline |
Definition at line 150 of file CoordBasedRouting.h.
Referenced by NeighborCache::prepareOverlay(), and GlobalViewBuilder::spreadGlobalView().
|
private |
returns if given coords' dimensions value (from underlay or overlay calculations) is matching the dimensions value in the area source XML.
This is mandatory for correct mapping results!
Definition at line 421 of file CoordBasedRouting.cc.
|
protected |
Definition at line 80 of file CoordBasedRouting.cc.
|
inline |
Definition at line 151 of file CoordBasedRouting.h.
Referenced by NeighborCache::prepareOverlay(), and GlobalViewBuilder::spreadGlobalView().
|
inline |
Definition at line 152 of file CoordBasedRouting.h.
Referenced by NeighborCache::prepareOverlay(), and GlobalViewBuilder::spreadGlobalView().
double CoordBasedRouting::getEuclidianDistanceByKeyAndCoords | ( | const OverlayKey & | destKey, |
const std::vector< double > & | nodeCoords, | ||
uint8_t | bpd, | ||
const AP * | cap = NULL |
||
) | const |
Definition at line 378 of file CoordBasedRouting.cc.
OverlayKey CoordBasedRouting::getNodeId | ( | const Coords & | coords, |
uint8_t | bpd, | ||
uint8_t | length, | ||
const AP * | cap = NULL |
||
) | const |
returns a NodeID with given length and prefix according to coords' area.
Takes the parameters CBRstartAtDigit and CBRstopAtDigit into account. Non-prefix bits are currently randomized.
Definition at line 242 of file CoordBasedRouting.cc.
Referenced by NeighborCache::setCbrNodeId().
|
private |
auxiliary protected function which returns the NodeID prefix of the given coords' area
Definition at line 313 of file CoordBasedRouting.cc.
Referenced by getNodeId().
|
inline |
returns the number of dimensions set in the XML file.
Can be strictly regarded as reference whenever it comes to dimensionality
Definition at line 141 of file CoordBasedRouting.h.
Referenced by getEuclidianDistanceByKeyAndCoords().
|
protectedvirtual |
CBR is a global module, stuff in initialize() is run once Parsing the area source XML is done here.
Definition at line 43 of file CoordBasedRouting.cc.
|
private |
parses the area source XML and puts the resulting areas into gap
Definition at line 86 of file CoordBasedRouting.cc.
Referenced by initialize().
|
private |
Definition at line 122 of file CoordBasedRouting.cc.
Referenced by calculateCapFromCcd().
|
private |
Definition at line 71 of file CoordBasedRouting.h.
Referenced by initialize().
|
private |
Definition at line 76 of file CoordBasedRouting.h.
Referenced by changeIdLater(), and initialize().
|
private |
Definition at line 77 of file CoordBasedRouting.h.
Referenced by getChangeIdStart(), and initialize().
|
private |
Definition at line 78 of file CoordBasedRouting.h.
Referenced by getChangeIdStop(), and initialize().
|
private |
Definition at line 72 of file CoordBasedRouting.h.
Referenced by getEuclidianDistanceByKeyAndCoords(), getNodeId(), and initialize().
|
private |
Definition at line 73 of file CoordBasedRouting.h.
Referenced by calculateCapFromCcd(), getEuclidianDistanceByKeyAndCoords(), getNodeId(), and initialize().
|
private |
Definition at line 112 of file CoordBasedRouting.h.
Referenced by calculateCapFromCcd(), and splitNodes().
|
private |
Definition at line 81 of file CoordBasedRouting.h.
Referenced by CoordBasedRouting(), finish(), getEuclidianDistanceByKeyAndCoords(), getPrefix(), initialize(), parseSource(), and ~CoordBasedRouting().
|
private |
Definition at line 83 of file CoordBasedRouting.h.
Referenced by initialize().
|
private |
Definition at line 113 of file CoordBasedRouting.h.
Referenced by calculateCapFromCcd(), and splitNodes().
|
staticprivate |
Definition at line 69 of file CoordBasedRouting.h.
Referenced by getNodeId(), and getPrefix().
|
private |
Definition at line 74 of file CoordBasedRouting.h.
Referenced by checkDimensions(), getXmlDimensions(), and parseSource().