This initializes the shadowing map with a grid of independent shadowing values, one m_correlationDistance meters apart from the next one. More...
#include "correlated-shadowing-propagation-loss-model.h"
Public Member Functions | |
ShadowingMap () | |
Default constructor. | |
~ShadowingMap () | |
Destructor. | |
double | GetLoss (CorrelatedShadowingPropagationLossModel::Position position) |
Get the loss for a certain position. | |
Public Member Functions inherited from ns3::SimpleRefCount< CorrelatedShadowingPropagationLossModel::ShadowingMap > | |
SimpleRefCount () | |
Default constructor. | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. | |
void | Ref () const |
Increment the reference count. | |
void | Unref () const |
Decrement the reference count. | |
Private Attributes | |
double | m_correlationDistance |
The distance after which two samples are to be considered almost uncorrelated. | |
std::map< CorrelatedShadowingPropagationLossModel::Position, double > | m_shadowingMap |
For each Position, this map gives a corresponding loss. | |
Ptr< NormalRandomVariable > | m_shadowingValue |
The normal random variable that is used to obtain shadowing values. | |
Static Private Attributes | |
static const double | m_kInv [4][4] |
The inverted K matrix. | |
This initializes the shadowing map with a grid of independent shadowing values, one m_correlationDistance meters apart from the next one.
The result is something like:
o---o---o---o---o | | | | | o---o---o---o---o | | | | | o---o---o---o---o | | | | | o---o---o---o---o
where at each o we have an independently generated shadowing value. We can then interpolate the 4 values surrounding any point in space in order to get a correlated shadowing value. After generating this value, we will add it to the map so that we don't have to compute it twice. Also, since interpolation is a deterministic operation, we are guaranteed that, as long as the grid doesn't change, also two values generated in the same square will be correlated.
Definition at line 100 of file correlated-shadowing-propagation-loss-model.h.
ns3::lorawan::CorrelatedShadowingPropagationLossModel::ShadowingMap::ShadowingMap | ( | ) |
Default constructor.
Definition at line 139 of file correlated-shadowing-propagation-loss-model.cc.
References m_shadowingValue, and NS_LOG_FUNCTION_NOARGS.
ns3::lorawan::CorrelatedShadowingPropagationLossModel::ShadowingMap::~ShadowingMap | ( | ) |
Destructor.
Definition at line 151 of file correlated-shadowing-propagation-loss-model.cc.
References NS_LOG_FUNCTION_NOARGS.
double ns3::lorawan::CorrelatedShadowingPropagationLossModel::ShadowingMap::GetLoss | ( | CorrelatedShadowingPropagationLossModel::Position | position | ) |
Get the loss for a certain position.
If the position is not already in the map, add it by computing the interpolation of neighboring shadowing values belonging to the grid.
position | The Position instance. |
Definition at line 157 of file correlated-shadowing-propagation-loss-model.cc.
References ns3::lorawan::CorrelatedShadowingPropagationLossModel::m_correlationDistance, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::lorawan::CorrelatedShadowingPropagationLossModel::Position::x, and ns3::lorawan::CorrelatedShadowingPropagationLossModel::Position::y.
|
private |
The distance after which two samples are to be considered almost uncorrelated.
Definition at line 130 of file correlated-shadowing-propagation-loss-model.h.
|
staticprivate |
The inverted K matrix.
This matrix is used to compute the coefficients to be used when interpolating the vertices of a grid square.
Definition at line 142 of file correlated-shadowing-propagation-loss-model.h.
|
private |
For each Position, this map gives a corresponding loss.
The map contains a basic grid that is initialized at construction time, and then newly computed values are added as they are created.
Definition at line 124 of file correlated-shadowing-propagation-loss-model.h.
|
private |
The normal random variable that is used to obtain shadowing values.
Definition at line 135 of file correlated-shadowing-propagation-loss-model.h.
Referenced by ShadowingMap().