A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::lorawan::CorrelatedShadowingPropagationLossModel::ShadowingMap Class Reference

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"

+ Inheritance diagram for ns3::lorawan::CorrelatedShadowingPropagationLossModel::ShadowingMap:
+ Collaboration diagram for ns3::lorawan::CorrelatedShadowingPropagationLossModel::ShadowingMap:

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.
 
SimpleRefCountoperator= (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, doublem_shadowingMap
 For each Position, this map gives a corresponding loss.
 
Ptr< NormalRandomVariablem_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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ShadowingMap()

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.

◆ ~ShadowingMap()

ns3::lorawan::CorrelatedShadowingPropagationLossModel::ShadowingMap::~ShadowingMap ( )

Destructor.

Definition at line 151 of file correlated-shadowing-propagation-loss-model.cc.

References NS_LOG_FUNCTION_NOARGS.

Member Function Documentation

◆ GetLoss()

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.

Parameters
positionThe Position instance.
Returns
The loss as a double.

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.

Member Data Documentation

◆ m_correlationDistance

double ns3::lorawan::CorrelatedShadowingPropagationLossModel::ShadowingMap::m_correlationDistance
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.

◆ m_kInv

const double ns3::lorawan::CorrelatedShadowingPropagationLossModel::ShadowingMap::m_kInv
staticprivate
Initial value:
= {
{1.27968707244633, -0.366414485833771, -0.0415206295795327, -0.366414485833771},
{-0.366414485833771, 1.27968707244633, -0.366414485833771, -0.0415206295795327},
{-0.0415206295795327, -0.366414485833771, 1.27968707244633, -0.366414485833771},
{-0.366414485833771, -0.0415206295795327, -0.366414485833771, 1.27968707244633}}

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.

◆ m_shadowingMap

std::map<CorrelatedShadowingPropagationLossModel::Position, double> ns3::lorawan::CorrelatedShadowingPropagationLossModel::ShadowingMap::m_shadowingMap
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.

◆ m_shadowingValue

Ptr<NormalRandomVariable> ns3::lorawan::CorrelatedShadowingPropagationLossModel::ShadowingMap::m_shadowingValue
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().


The documentation for this class was generated from the following files: