21 #include "ns3/mobility-model.h"
22 #include "ns3/double.h"
23 #include "ns3/string.h"
24 #include "ns3/pointer.h"
34 static TypeId tid =
TypeId (
"ns3::PropagationDelayModel")
58 static TypeId tid =
TypeId (
"ns3::RandomPropagationDelayModel")
60 .AddConstructor<RandomPropagationDelayModel> ()
61 .AddAttribute (
"Variable",
62 "The random variable which generates random delays (s).",
65 MakePointerChecker<RandomVariableStream> ())
95 static TypeId tid =
TypeId (
"ns3::ConstantSpeedPropagationDelayModel")
97 .AddConstructor<ConstantSpeedPropagationDelayModel> ()
98 .AddAttribute (
"Speed",
"The speed (m/s)",
101 MakeDoubleChecker<double> ())
113 double seconds = distance /
m_speed;
114 return Seconds (seconds);
keep track of time values and allow control of global simulation resolution
void SetStream(int64_t stream)
Specifies the stream number for this RNG stream.
double GetDistanceFrom(Ptr< const MobilityModel > position) const
hold variables of type string
virtual Time GetDelay(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
virtual Time GetDelay(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
static TypeId GetTypeId(void)
RandomPropagationDelayModel()
Use the default parameters from PropagationDelayRandomDistribution.
virtual ~PropagationDelayModel()
Ptr< RandomVariableStream > m_variable
virtual double GetValue(void)=0
Returns a random double from the underlying distribution.
void SetSpeed(double speed)
static TypeId GetTypeId(void)
virtual int64_t DoAssignStreams(int64_t stream)=0
Subclasses must implement this; those not using random variables can return zero. ...
calculate a propagation delay.
the propagation speed is constant
int64_t AssignStreams(int64_t stream)
If this delay model uses objects of type RandomVariableStream, set the stream numbers to the integers...
virtual int64_t DoAssignStreams(int64_t stream)
Subclasses must implement this; those not using random variables can return zero. ...
the propagation delay is random
ConstantSpeedPropagationDelayModel()
Use the default parameters from PropagationDelayConstantSpeed.
virtual int64_t DoAssignStreams(int64_t stream)
Subclasses must implement this; those not using random variables can return zero. ...
static TypeId GetTypeId(void)
a base class which provides memory management and object aggregation
Hold a floating point type.
double GetSpeed(void) const
virtual ~RandomPropagationDelayModel()
a unique identifier for an interface.
TypeId SetParent(TypeId tid)