Helper for LoraPhy that manages interference calculations. More...
#include "lora-interference-helper.h"
Classes | |
class | Event |
A class representing a signal in time. More... | |
Public Types | |
enum | CollisionMatrix { GOURSAUD , ALOHA } |
Enumeration of types of collision matrices. More... | |
Public Member Functions | |
LoraInterferenceHelper () | |
Default constructor. | |
virtual | ~LoraInterferenceHelper () |
Destructor. | |
Ptr< LoraInterferenceHelper::Event > | Add (Time duration, double rxPower, uint8_t spreadingFactor, Ptr< Packet > packet, uint32_t frequencyHz) |
Add an event to the InterferenceHelper. | |
void | CleanOldEvents () |
Delete old events in this LoraInterferenceHelper. | |
void | ClearAllEvents () |
Delete all events in the LoraInterferenceHelper. | |
std::list< Ptr< LoraInterferenceHelper::Event > > | GetInterferers () |
Get a list of the interferers currently registered at this InterferenceHelper. | |
Time | GetOverlapTime (Ptr< LoraInterferenceHelper::Event > event1, Ptr< LoraInterferenceHelper::Event > event2) |
Compute the time duration in which two given events are overlapping. | |
uint8_t | IsDestroyedByInterference (Ptr< LoraInterferenceHelper::Event > event) |
Determine whether the event was destroyed by interference or not. | |
void | PrintEvents (std::ostream &stream) |
Print the events that are saved in this helper in a human readable format. | |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Register this type. | |
Static Public Attributes | |
static CollisionMatrix | collisionMatrix |
Collision matrix type set by the constructor. | |
static std::vector< std::vector< double > > | collisionSnirAloha |
ALOHA collision matrix. | |
static std::vector< std::vector< double > > | collisionSnirGoursaud |
GOURSAUD collision matrix. | |
Private Member Functions | |
void | SetCollisionMatrix (enum CollisionMatrix collisionMatrix) |
Set the collision matrix. | |
Private Attributes | |
std::vector< std::vector< double > > | m_collisionSnir |
The matrix containing information about how packets survive interference. | |
std::list< Ptr< LoraInterferenceHelper::Event > > | m_events |
List of the events this LoraInterferenceHelper is keeping track of. | |
Static Private Attributes | |
static Time | oldEventThreshold = Seconds(2) |
The threshold after which an event is considered old and removed from the list. | |
Helper for LoraPhy that manages interference calculations.
This class keeps a list of signals that are impinging on the antenna of the device, in order to compute which ones can be correctly received and which ones are lost due to interference.
Definition at line 37 of file lora-interference-helper.h.
Enumeration of types of collision matrices.
Enumerator | |
---|---|
GOURSAUD | |
ALOHA |
Definition at line 134 of file lora-interference-helper.h.
ns3::lorawan::LoraInterferenceHelper::LoraInterferenceHelper | ( | ) |
Default constructor.
Definition at line 168 of file lora-interference-helper.cc.
References LoraInterferenceHelper(), collisionMatrix, collisionSnirGoursaud, m_collisionSnir, NS_LOG_FUNCTION, and SetCollisionMatrix().
Referenced by LoraInterferenceHelper().
|
virtual |
Ptr< LoraInterferenceHelper::Event > ns3::lorawan::LoraInterferenceHelper::Add | ( | Time | duration, |
double | rxPower, | ||
uint8_t | spreadingFactor, | ||
Ptr< Packet > | packet, | ||
uint32_t | frequencyHz ) |
Add an event to the InterferenceHelper.
duration | The duration of the packet. |
rxPower | The received power in dBm. |
spreadingFactor | The spreading factor used by the transmission. |
packet | The packet carried by this transmission. |
frequencyHz | The frequency [Hz] this event was sent at. |
Definition at line 184 of file lora-interference-helper.cc.
References ns3::Time::As(), CleanOldEvents(), ns3::Create(), m_events, ns3::Time::MS, and NS_LOG_FUNCTION.
Referenced by InterferenceTest::DoRun().
void ns3::lorawan::LoraInterferenceHelper::CleanOldEvents | ( | ) |
Delete old events in this LoraInterferenceHelper.
Definition at line 214 of file lora-interference-helper.cc.
References m_events, ns3::Now(), NS_LOG_FUNCTION, and oldEventThreshold.
Referenced by Add().
void ns3::lorawan::LoraInterferenceHelper::ClearAllEvents | ( | ) |
Delete all events in the LoraInterferenceHelper.
Definition at line 365 of file lora-interference-helper.cc.
References m_events, and NS_LOG_FUNCTION_NOARGS.
Referenced by InterferenceTest::DoRun().
std::list< Ptr< LoraInterferenceHelper::Event > > ns3::lorawan::LoraInterferenceHelper::GetInterferers | ( | ) |
Get a list of the interferers currently registered at this InterferenceHelper.
Definition at line 233 of file lora-interference-helper.cc.
References m_events.
Time ns3::lorawan::LoraInterferenceHelper::GetOverlapTime | ( | Ptr< LoraInterferenceHelper::Event > | event1, |
Ptr< LoraInterferenceHelper::Event > | event2 ) |
Compute the time duration in which two given events are overlapping.
event1 | The first event. |
event2 | The second event. |
Definition at line 373 of file lora-interference-helper.cc.
References NS_LOG_FUNCTION_NOARGS.
Referenced by InterferenceTest::DoRun(), and IsDestroyedByInterference().
|
static |
Register this type.
Definition at line 160 of file lora-interference-helper.cc.
References ns3::TypeId::SetParent().
uint8_t ns3::lorawan::LoraInterferenceHelper::IsDestroyedByInterference | ( | Ptr< LoraInterferenceHelper::Event > | event | ) |
Determine whether the event was destroyed by interference or not.
This is the method where the SNIR tables come into play and the computations regarding power are performed.
event | The event for which to check the outcome. |
Definition at line 253 of file lora-interference-helper.cc.
References ns3::Time::As(), GetOverlapTime(), ns3::Time::GetSeconds(), m_collisionSnir, m_events, ns3::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, and ns3::Time::S.
Referenced by InterferenceTest::DoRun().
void ns3::lorawan::LoraInterferenceHelper::PrintEvents | ( | std::ostream & | stream | ) |
Print the events that are saved in this helper in a human readable format.
stream | The output stream. |
Definition at line 239 of file lora-interference-helper.cc.
References m_events, and NS_LOG_FUNCTION_NOARGS.
|
private |
Set the collision matrix.
collisionMatrix | The type of collision matrix to set. |
Definition at line 143 of file lora-interference-helper.cc.
References ALOHA, collisionMatrix, collisionSnirAloha, collisionSnirGoursaud, GOURSAUD, m_collisionSnir, and NS_LOG_DEBUG.
Referenced by LoraInterferenceHelper().
|
static |
Collision matrix type set by the constructor.
Definition at line 212 of file lora-interference-helper.h.
Referenced by LoraInterferenceHelper(), and SetCollisionMatrix().
|
static |
ALOHA collision matrix.
Definition at line 214 of file lora-interference-helper.h.
Referenced by SetCollisionMatrix().
|
static |
GOURSAUD collision matrix.
Definition at line 215 of file lora-interference-helper.h.
Referenced by LoraInterferenceHelper(), and SetCollisionMatrix().
|
private |
The matrix containing information about how packets survive interference.
Definition at line 227 of file lora-interference-helper.h.
Referenced by LoraInterferenceHelper(), IsDestroyedByInterference(), and SetCollisionMatrix().
|
private |
List of the events this LoraInterferenceHelper is keeping track of.
Definition at line 230 of file lora-interference-helper.h.
Referenced by Add(), CleanOldEvents(), ClearAllEvents(), GetInterferers(), IsDestroyedByInterference(), and PrintEvents().
The threshold after which an event is considered old and removed from the list.
Definition at line 231 of file lora-interference-helper.h.
Referenced by CleanOldEvents().