A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
periodic-sender-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017 University of Padova
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Davide Magrin <magrinda@dei.unipd.it>
7
*/
8
9
#ifndef PERIODIC_SENDER_HELPER_H
10
#define PERIODIC_SENDER_HELPER_H
11
12
#include "ns3/application-container.h"
13
#include "ns3/node-container.h"
14
#include "ns3/object-factory.h"
15
16
namespace
ns3
17
{
18
namespace
lorawan
19
{
20
21
/**
22
* @ingroup lorawan
23
*
24
* This class can be used to install PeriodicSender applications on a wide
25
* range of nodes.
26
*/
27
class
PeriodicSenderHelper
28
{
29
public
:
30
PeriodicSenderHelper
();
//!< Default constructor
31
~PeriodicSenderHelper
();
//!< Destructor
32
33
/**
34
* Helper function used to set the underlying application attributes.
35
*
36
* @param name The name of the application attribute to set.
37
* @param value The value of the application attribute to set.
38
*/
39
void
SetAttribute
(std::string name,
const
AttributeValue
& value);
40
41
/**
42
* Install a PeriodicSender application on each node of the input container
43
* configured with all the attributes set with SetAttribute or other functions of this class.
44
*
45
* @param c NodeContainer of the set of nodes on which an PeriodicSender
46
* will be installed.
47
* @return Container of Ptr to the applications installed.
48
*/
49
ApplicationContainer
Install
(
NodeContainer
c)
const
;
50
51
/**
52
* Install a PeriodicSender application on the input Node configured with all the attributes set
53
* with SetAttribute or other functions of this class.
54
*
55
* @param node The node on which a PeriodicSender will be installed.
56
* @return Container of the Ptr to the application installed.
57
*/
58
ApplicationContainer
Install
(
Ptr<Node>
node)
const
;
59
60
/**
61
* Set the period to be used by the applications created by this helper.
62
*
63
* A value of Seconds (0) results in randomly generated periods according to
64
* the model contained in the TR 45.820 document.
65
*
66
* @param period The period to set.
67
*/
68
void
SetPeriod
(
Time
period);
69
70
/**
71
* Set a random variable to enable a random size to be added to the base packet size for
72
* each new transmission of PacketSender applications.
73
*
74
* @param rv The random variable.
75
*/
76
void
SetPacketSizeRandomVariable
(
Ptr<RandomVariableStream>
rv);
77
78
/**
79
* Set the base value for applications packet size in bytes.
80
*
81
* @param size The packet size in bytes.
82
*/
83
void
SetPacketSize
(uint8_t size);
84
85
private
:
86
/**
87
* Install a PeriodicSender application on the input Node configured with all the attributes set
88
* with SetAttribute or other functions of this class.
89
*
90
* @param node The node on which a PeriodicSender will be installed.
91
* @return A pointer to the application installed.
92
*/
93
Ptr<Application>
InstallPriv
(
Ptr<Node>
node)
const
;
94
95
ObjectFactory
m_factory
;
//!< The factory to create PeriodicSender applications
96
Ptr<UniformRandomVariable>
m_initialDelay
;
//!< The random variable used to extract a start
97
//!< off delay for each PeriodicSender application
98
Ptr<UniformRandomVariable>
99
m_intervalProb
;
//!< The random variable used to pick inter-transmission intervals of
100
//!< different applications from a discrete probability distribution
101
Time
m_period
;
//!< The base period with which the application will be set to send messages
102
Ptr<RandomVariableStream>
103
m_pktSizeRV
;
//!< Whether or not a random component is added to the packet size.
104
uint8_t
m_pktSize
;
//!< The base packet size.
105
};
106
107
}
// namespace lorawan
108
}
// namespace ns3
109
110
#endif
/* PERIODIC_SENDER_HELPER_H */
ns3::ApplicationContainer
holds a vector of ns3::Application pointers.
Definition
application-container.h:33
ns3::AttributeValue
Hold a value for an Attribute.
Definition
attribute.h:59
ns3::NodeContainer
keep track of a set of node pointers.
Definition
node-container.h:29
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition
object-factory.h:37
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:70
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:95
ns3::lorawan::PeriodicSenderHelper::m_pktSizeRV
Ptr< RandomVariableStream > m_pktSizeRV
Whether or not a random component is added to the packet size.
Definition
periodic-sender-helper.h:103
ns3::lorawan::PeriodicSenderHelper::m_pktSize
uint8_t m_pktSize
The base packet size.
Definition
periodic-sender-helper.h:104
ns3::lorawan::PeriodicSenderHelper::SetPeriod
void SetPeriod(Time period)
Set the period to be used by the applications created by this helper.
Definition
periodic-sender-helper.cc:120
ns3::lorawan::PeriodicSenderHelper::SetAttribute
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
Definition
periodic-sender-helper.cc:44
ns3::lorawan::PeriodicSenderHelper::SetPacketSize
void SetPacketSize(uint8_t size)
Set the base value for applications packet size in bytes.
Definition
periodic-sender-helper.cc:132
ns3::lorawan::PeriodicSenderHelper::InstallPriv
Ptr< Application > InstallPriv(Ptr< Node > node) const
Install a PeriodicSender application on the input Node configured with all the attributes set with Se...
Definition
periodic-sender-helper.cc:68
ns3::lorawan::PeriodicSenderHelper::m_intervalProb
Ptr< UniformRandomVariable > m_intervalProb
The random variable used to pick inter-transmission intervals of different applications from a discre...
Definition
periodic-sender-helper.h:99
ns3::lorawan::PeriodicSenderHelper::SetPacketSizeRandomVariable
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 transm...
Definition
periodic-sender-helper.cc:126
ns3::lorawan::PeriodicSenderHelper::m_period
Time m_period
The base period with which the application will be set to send messages.
Definition
periodic-sender-helper.h:101
ns3::lorawan::PeriodicSenderHelper::~PeriodicSenderHelper
~PeriodicSenderHelper()
Destructor.
Definition
periodic-sender-helper.cc:39
ns3::lorawan::PeriodicSenderHelper::m_factory
ObjectFactory m_factory
The factory to create PeriodicSender applications.
Definition
periodic-sender-helper.h:95
ns3::lorawan::PeriodicSenderHelper::m_initialDelay
Ptr< UniformRandomVariable > m_initialDelay
The random variable used to extract a start off delay for each PeriodicSender application.
Definition
periodic-sender-helper.h:96
ns3::lorawan::PeriodicSenderHelper::Install
ApplicationContainer Install(NodeContainer c) const
Install a PeriodicSender application on each node of the input container configured with all the attr...
Definition
periodic-sender-helper.cc:56
ns3::lorawan::PeriodicSenderHelper::PeriodicSenderHelper
PeriodicSenderHelper()
Default constructor.
Definition
periodic-sender-helper.cc:21
ns3::lorawan
Definition
forwarder-helper.cc:19
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lorawan
helper
periodic-sender-helper.h
Generated on
for ns-3 by
1.15.0