10#include "ns3/double.h"
11#include "ns3/mobility-model.h"
12#include "ns3/pointer.h"
13#include "ns3/string.h"
46 TypeId(
"ns3::RandomPropagationDelayModel")
48 .SetGroupName(
"Propagation")
50 .AddAttribute(
"Variable",
51 "The random variable which generates random delays (s).",
85 TypeId(
"ns3::ConstantSpeedPropagationDelayModel")
87 .SetGroupName(
"Propagation")
89 .AddAttribute(
"Speed",
90 "The propagation speed (m/s) in the propagation medium being considered. "
91 "The default value is the propagation speed of light in the vacuum.",
105 double distance = a->GetDistanceFrom(b);
106 double seconds = distance /
m_speed;
the propagation speed is constant
Time GetDelay(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
void SetSpeed(double speed)
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
ConstantSpeedPropagationDelayModel()
Use the default parameters from PropagationDelayConstantSpeed.
static TypeId GetTypeId()
Get the type ID.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
A base class which provides memory management and object aggregation.
calculate a propagation delay.
static TypeId GetTypeId()
Get the type ID.
~PropagationDelayModel() override
virtual int64_t DoAssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model.
int64_t AssignStreams(int64_t stream)
If this delay model uses objects of type RandomVariableStream, set the stream numbers to the integers...
Smart pointer class similar to boost::intrusive_ptr.
the propagation delay is random
RandomPropagationDelayModel()
Use the default parameters from PropagationDelayRandomDistribution.
Ptr< RandomVariableStream > m_variable
random generator
static TypeId GetTypeId()
Get the type ID.
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
~RandomPropagationDelayModel() override
Time GetDelay(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
virtual double GetValue()=0
Get the next random value drawn from the distribution.
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
Hold variables of type string.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< AttributeChecker > MakePointerChecker()
Create a PointerChecker for a type.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeDoubleChecker()
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)