|
INET Framework for OMNeT++/OMNEST
|
#include <QuadTreeNeighborCache.h>
◆ Radios
◆ QuadTreeNeighborCache()
| inet::physicallayer::QuadTreeNeighborCache::QuadTreeNeighborCache |
( |
| ) |
|
◆ ~QuadTreeNeighborCache()
| inet::physicallayer::QuadTreeNeighborCache::~QuadTreeNeighborCache |
( |
| ) |
|
◆ addRadio()
| void inet::physicallayer::QuadTreeNeighborCache::addRadio |
( |
const IRadio * |
radio | ) |
|
|
overridevirtual |
Implements inet::physicallayer::INeighborCache.
68 Coord radioPos = radio->getAntenna()->getMobility()->getCurrentPosition();
72 Coord newConstraintAreaMin =
radioMedium->getMediumLimitCache()->getMinConstraintArea();
73 Coord newConstraintAreaMax =
radioMedium->getMediumLimitCache()->getMaxConstraintArea();
81 else if (initialized())
82 quadTree->
insert(check_and_cast<const cObject *>(radio), radioPos);
◆ fillQuadTreeWithRadios()
| void inet::physicallayer::QuadTreeNeighborCache::fillQuadTreeWithRadios |
( |
| ) |
|
|
protected |
118 for (
auto& elem :
radios) {
119 Coord radioPos = elem->getAntenna()->getMobility()->getCurrentPosition();
120 if (!
quadTree->
insert(check_and_cast<const cObject *>(elem), radioPos))
121 throw cRuntimeError(
"Unsuccessful QuadTree building");
Referenced by rebuildQuadTree().
◆ handleMessage()
| void inet::physicallayer::QuadTreeNeighborCache::handleMessage |
( |
cMessage * |
msg | ) |
|
|
overrideprotectedvirtual |
49 if (!msg->isSelfMessage())
50 throw cRuntimeError(
"This module only handles self messages");
◆ initialize()
| void inet::physicallayer::QuadTreeNeighborCache::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
32 radioMedium.reference(
this,
"radioMediumModule",
true);
◆ numInitStages()
| virtual int inet::physicallayer::QuadTreeNeighborCache::numInitStages |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ printToStream()
| std::ostream & inet::physicallayer::QuadTreeNeighborCache::printToStream |
( |
std::ostream & |
stream, |
|
|
int |
level, |
|
|
int |
evFlags = 0 |
|
) |
| const |
|
overridevirtual |
Prints this object to the provided output stream.
Reimplemented from inet::IPrintableObject.
57 stream <<
"QuadTreeNeighborCache";
◆ rebuildQuadTree()
| void inet::physicallayer::QuadTreeNeighborCache::rebuildQuadTree |
( |
| ) |
|
|
protected |
◆ removeRadio()
| void inet::physicallayer::QuadTreeNeighborCache::removeRadio |
( |
const IRadio * |
radio | ) |
|
|
overridevirtual |
Implements inet::physicallayer::INeighborCache.
90 Coord newConstraintAreaMin =
radioMedium->getMediumLimitCache()->getMinConstraintArea();
91 Coord newConstraintAreaMax =
radioMedium->getMediumLimitCache()->getMaxConstraintArea();
98 else if (initialized())
105 throw cRuntimeError(
"You can't remove radio: %d because it is not in our radio container", radio->getId());
◆ sendToNeighbors()
| void inet::physicallayer::QuadTreeNeighborCache::sendToNeighbors |
( |
IRadio * |
transmitter, |
|
|
const IWirelessSignal * |
signal, |
|
|
double |
range |
|
) |
| const |
|
overridevirtual |
Sends the provided frame (using the radio medium) to all neighbors within the given range.
Implements inet::physicallayer::INeighborCache.
111 Coord transmitterPos = transmitter->getAntenna()->getMobility()->getCurrentPosition();
112 QuadTreeNeighborCacheVisitor visitor(
radioMedium, transmitter, signal);
◆ constraintAreaMax
| Coord inet::physicallayer::QuadTreeNeighborCache::constraintAreaMax |
|
protected |
◆ constraintAreaMin
| Coord inet::physicallayer::QuadTreeNeighborCache::constraintAreaMin |
|
protected |
◆ maxNumOfPointsPerQuadrant
| unsigned int inet::physicallayer::QuadTreeNeighborCache::maxNumOfPointsPerQuadrant |
|
protected |
◆ maxSpeed
| double inet::physicallayer::QuadTreeNeighborCache::maxSpeed |
|
protected |
◆ quadTree
| QuadTree* inet::physicallayer::QuadTreeNeighborCache::quadTree |
|
protected |
◆ radioMedium
◆ radios
| Radios inet::physicallayer::QuadTreeNeighborCache::radios |
|
protected |
◆ rebuildQuadTreeTimer
| cMessage* inet::physicallayer::QuadTreeNeighborCache::rebuildQuadTreeTimer |
|
protected |
◆ refillPeriod
| double inet::physicallayer::QuadTreeNeighborCache::refillPeriod |
|
protected |
The documentation for this class was generated from the following files:
Coord constraintAreaMin
Definition: QuadTreeNeighborCache.h:41
cMessage * rebuildQuadTreeTimer
Definition: QuadTreeNeighborCache.h:40
unsigned int maxNumOfPointsPerQuadrant
Definition: QuadTreeNeighborCache.h:42
void fillQuadTreeWithRadios()
Definition: QuadTreeNeighborCache.cc:116
std::vector< T >::iterator find(std::vector< T > &v, const Tk &a)
Definition: stlutils.h:44
ModuleRefByPar< RadioMedium > radioMedium
Definition: QuadTreeNeighborCache.h:39
Coord constraintAreaMax
Definition: QuadTreeNeighborCache.h:41
void rangeQuery(const Coord &pos, double range, const IVisitor *visitor) const
Definition: QuadTree.cc:96
bool remove(const cObject *point)
Definition: QuadTree.cc:142
#define EV_FIELD(...)
Definition: INETDefs.h:112
Radios radios
Definition: QuadTreeNeighborCache.h:38
#define NaN
Definition: INETMath.h:91
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
double refillPeriod
Definition: QuadTreeNeighborCache.h:43
@ PRINT_LEVEL_TRACE
Definition: IPrintableObject.h:22
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
double maxSpeed
Definition: QuadTreeNeighborCache.h:44
QuadTree * quadTree
Definition: QuadTreeNeighborCache.h:37
INET_API InitStage INITSTAGE_PHYSICAL_LAYER_NEIGHBOR_CACHE
Initialization of physical layer neighbor cache.
bool insert(const cObject *point, const Coord &pos)
Definition: QuadTree.cc:14
static const Coord NIL
Constant with all values set to 0.
Definition: Coord.h:26
void rebuildQuadTree()
Definition: QuadTreeNeighborCache.cc:125