11#include "ns3/double.h"
13#include "ns3/periodic-sender.h"
14#include "ns3/random-variable-stream.h"
15#include "ns3/simulator.h"
16#include "ns3/string.h"
17#include "ns3/trace-source-accessor.h"
64 for (
auto i = c.
Begin(); i != c.
End(); ++i)
86 if (intervalProb < 0.4)
90 else if (0.4 <= intervalProb && intervalProb < 0.8)
94 else if (0.8 <= intervalProb && intervalProb < 0.95)
108 app->SetInterval(interval);
109 NS_LOG_DEBUG(
"Created an application with interval = " << interval.GetHours() <<
" hours");
119 node->AddApplication(app);
holds a vector of ns3::Application pointers.
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container.
Hold a value for an Attribute.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
keep track of a set of node pointers.
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
Iterator Begin() const
Get an iterator which refers to the first Node in the container.
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
Ptr< RandomVariableStream > m_pktSizeRV
Whether or not a random component is added to the packet size.
uint8_t m_pktSize
The base packet size.
void SetPeriod(Time period)
Set the period to be used by the applications created by this helper.
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.
Ptr< Application > InstallPriv(Ptr< Node > node) const
Install a PeriodicSender application on the input Node configured with all the attributes set with Se...
Ptr< UniformRandomVariable > m_intervalProb
The random variable used to pick inter-transmission intervals of different applications from a discre...
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...
Time m_period
The base period with which the application will be set to send messages.
~PeriodicSenderHelper()
Destructor.
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.
ApplicationContainer Install(NodeContainer c) const
Install a PeriodicSender application on each node of the input container configured with all the attr...
PeriodicSenderHelper()
Default constructor.
Implements a sender application generating packets following a periodic point process.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time Days(double value)
Construct a Time in the indicated unit.
Time Hours(double value)
Construct a Time in the indicated unit.
Time Minutes(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.