20 #include "propagation-delay-model.h"
21 #include "ns3/mobility-model.h"
22 #include "ns3/double.h"
23 #include "ns3/string.h"
24 #include "ns3/pointer.h"
28 NS_OBJECT_ENSURE_REGISTERED (PropagationDelayModel);
31 PropagationDelayModel::GetTypeId (
void)
33 static TypeId tid = TypeId (
"ns3::PropagationDelayModel")
39 PropagationDelayModel::~PropagationDelayModel ()
54 RandomPropagationDelayModel::GetTypeId (
void)
56 static TypeId tid =
TypeId (
"ns3::RandomPropagationDelayModel")
58 .AddConstructor<RandomPropagationDelayModel> ()
59 .AddAttribute (
"Variable",
60 "The random variable which generates random delays (s).",
62 MakePointerAccessor (&RandomPropagationDelayModel::m_variable),
63 MakePointerChecker<RandomVariableStream> ())
71 RandomPropagationDelayModel::~RandomPropagationDelayModel ()
90 ConstantSpeedPropagationDelayModel::GetTypeId (
void)
92 static TypeId tid =
TypeId (
"ns3::ConstantSpeedPropagationDelayModel")
94 .AddConstructor<ConstantSpeedPropagationDelayModel> ()
95 .AddAttribute (
"Speed",
"The speed (m/s)",
97 MakeDoubleAccessor (&ConstantSpeedPropagationDelayModel::m_speed),
98 MakeDoubleChecker<double> ())
110 double seconds = distance / m_speed;
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
virtual Time GetDelay(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
RandomPropagationDelayModel()
virtual double GetValue(void)=0
Returns a random double from the underlying distribution.
void SetSpeed(double speed)
virtual int64_t DoAssignStreams(int64_t stream)=0
calculate a propagation delay.
the propagation speed is constant
int64_t AssignStreams(int64_t stream)
virtual int64_t DoAssignStreams(int64_t stream)
the propagation delay is random
Time Seconds(double seconds)
create ns3::Time instances in units of seconds.
ConstantSpeedPropagationDelayModel()
virtual int64_t DoAssignStreams(int64_t stream)
Hold an floating point type.
double GetSpeed(void) const
a unique identifier for an interface.
TypeId SetParent(TypeId tid)