This class can be used to install PeriodicSender applications on a wide range of nodes. More...
#include "periodic-sender-helper.h"
Public Member Functions | |
PeriodicSenderHelper () | |
Default constructor. | |
~PeriodicSenderHelper () | |
Destructor. | |
ApplicationContainer | Install (NodeContainer c) const |
Install a PeriodicSender application on each node of the input container configured with all the attributes set with SetAttribute or other functions of this class. | |
ApplicationContainer | Install (Ptr< Node > node) const |
Install a PeriodicSender application on the input Node configured with all the attributes set with SetAttribute or other functions of this class. | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Helper function used to set the underlying application attributes. | |
void | SetPacketSize (uint8_t size) |
Set the base value for applications packet size in bytes. | |
void | SetPacketSizeRandomVariable (Ptr< RandomVariableStream > rv) |
Set a random variable to enable a random size to be added to the base packet size for each new transmission of PacketSender applications. | |
void | SetPeriod (Time period) |
Set the period to be used by the applications created by this helper. | |
Private Member Functions | |
Ptr< Application > | InstallPriv (Ptr< Node > node) const |
Install a PeriodicSender application on the input Node configured with all the attributes set with SetAttribute or other functions of this class. | |
Private Attributes | |
ObjectFactory | m_factory |
The factory to create PeriodicSender applications. | |
Ptr< UniformRandomVariable > | m_initialDelay |
The random variable used to extract a start off delay for each PeriodicSender application. | |
Ptr< UniformRandomVariable > | m_intervalProb |
The random variable used to pick inter-transmission intervals of different applications from a discrete probability distribution. | |
Time | m_period |
The base period with which the application will be set to send messages. | |
uint8_t | m_pktSize |
The base packet size. | |
Ptr< RandomVariableStream > | m_pktSizeRV |
Whether or not a random component is added to the packet size. | |
This class can be used to install PeriodicSender applications on a wide range of nodes.
Definition at line 34 of file periodic-sender-helper.h.
ns3::lorawan::PeriodicSenderHelper::PeriodicSenderHelper | ( | ) |
Default constructor.
Definition at line 26 of file periodic-sender-helper.cc.
References ns3::CreateObject(), m_factory, m_initialDelay, m_intervalProb, m_pktSize, m_pktSizeRV, and ns3::ObjectFactory::SetTypeId().
ns3::lorawan::PeriodicSenderHelper::~PeriodicSenderHelper | ( | ) |
Destructor.
Definition at line 44 of file periodic-sender-helper.cc.
ApplicationContainer ns3::lorawan::PeriodicSenderHelper::Install | ( | NodeContainer | c | ) | const |
Install a PeriodicSender application on each node of the input container configured with all the attributes set with SetAttribute or other functions of this class.
c | NodeContainer of the set of nodes on which an PeriodicSender will be installed. |
Definition at line 61 of file periodic-sender-helper.cc.
References ns3::ApplicationContainer::Add(), ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), and InstallPriv().
ApplicationContainer ns3::lorawan::PeriodicSenderHelper::Install | ( | Ptr< Node > | node | ) | const |
Install a PeriodicSender application on the input Node configured with all the attributes set with SetAttribute or other functions of this class.
node | The node on which a PeriodicSender will be installed. |
Definition at line 55 of file periodic-sender-helper.cc.
References InstallPriv().
|
private |
Install a PeriodicSender application on the input Node configured with all the attributes set with SetAttribute or other functions of this class.
node | The node on which a PeriodicSender will be installed. |
Definition at line 73 of file periodic-sender-helper.cc.
References ns3::ObjectFactory::Create(), ns3::Days(), ns3::Hours(), m_factory, m_initialDelay, m_intervalProb, m_period, m_pktSize, m_pktSizeRV, ns3::Minutes(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Seconds().
Referenced by Install(), and Install().
void ns3::lorawan::PeriodicSenderHelper::SetAttribute | ( | std::string | name, |
const AttributeValue & | value ) |
Helper function used to set the underlying application attributes.
name | The name of the application attribute to set. |
value | The value of the application attribute to set. |
Definition at line 49 of file periodic-sender-helper.cc.
References m_factory, and ns3::ObjectFactory::Set().
void ns3::lorawan::PeriodicSenderHelper::SetPacketSize | ( | uint8_t | size | ) |
Set the base value for applications packet size in bytes.
size | The packet size in bytes. |
Definition at line 137 of file periodic-sender-helper.cc.
References m_pktSize.
void ns3::lorawan::PeriodicSenderHelper::SetPacketSizeRandomVariable | ( | Ptr< RandomVariableStream > | rv | ) |
Set a random variable to enable a random size to be added to the base packet size for each new transmission of PacketSender applications.
rv | The random variable. |
Definition at line 131 of file periodic-sender-helper.cc.
References m_pktSizeRV.
void ns3::lorawan::PeriodicSenderHelper::SetPeriod | ( | Time | period | ) |
Set the period to be used by the applications created by this helper.
A value of Seconds (0) results in randomly generated periods according to the model contained in the TR 45.820 document.
period | The period to set. |
Definition at line 125 of file periodic-sender-helper.cc.
References m_period.
|
private |
The factory to create PeriodicSender applications.
Definition at line 102 of file periodic-sender-helper.h.
Referenced by PeriodicSenderHelper(), InstallPriv(), and SetAttribute().
|
private |
The random variable used to extract a start off delay for each PeriodicSender application.
Definition at line 103 of file periodic-sender-helper.h.
Referenced by PeriodicSenderHelper(), and InstallPriv().
|
private |
The random variable used to pick inter-transmission intervals of different applications from a discrete probability distribution.
Definition at line 106 of file periodic-sender-helper.h.
Referenced by PeriodicSenderHelper(), and InstallPriv().
|
private |
The base period with which the application will be set to send messages.
Definition at line 108 of file periodic-sender-helper.h.
Referenced by InstallPriv(), and SetPeriod().
|
private |
The base packet size.
Definition at line 111 of file periodic-sender-helper.h.
Referenced by PeriodicSenderHelper(), InstallPriv(), and SetPacketSize().
|
private |
Whether or not a random component is added to the packet size.
Definition at line 110 of file periodic-sender-helper.h.
Referenced by PeriodicSenderHelper(), InstallPriv(), and SetPacketSizeRandomVariable().