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
propagation-delay-model.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2005,2006,2007 INRIA
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7
*/
8
#ifndef PROPAGATION_DELAY_MODEL_H
9
#define PROPAGATION_DELAY_MODEL_H
10
11
#include "ns3/nstime.h"
12
#include "ns3/object.h"
13
#include "ns3/ptr.h"
14
#include "ns3/random-variable-stream.h"
15
16
namespace
ns3
17
{
18
19
class
MobilityModel;
20
21
/**
22
* @ingroup propagation
23
*
24
* @brief calculate a propagation delay.
25
*/
26
class
PropagationDelayModel
:
public
Object
27
{
28
public
:
29
/**
30
* @brief Get the type ID.
31
* @return the object TypeId
32
*/
33
static
TypeId
GetTypeId
();
34
~PropagationDelayModel
()
override
;
35
/**
36
* @param a the source
37
* @param b the destination
38
* @returns the calculated propagation delay
39
*
40
* Calculate the propagation delay between the specified
41
* source and destination.
42
*/
43
virtual
Time
GetDelay
(
Ptr<MobilityModel>
a,
Ptr<MobilityModel>
b)
const
= 0;
44
/**
45
* If this delay model uses objects of type RandomVariableStream,
46
* set the stream numbers to the integers starting with the offset
47
* 'stream'. Return the number of streams (possibly zero) that
48
* have been assigned.
49
*
50
* @param stream first stream index to use
51
* @return the number of stream indices assigned by this model
52
*/
53
int64_t
AssignStreams
(int64_t stream);
54
55
protected
:
56
/**
57
* Assign a fixed random variable stream number to the random variables used by this model.
58
*
59
* Subclasses must implement this; those not using random variables
60
* can return zero.
61
*
62
* @param stream first stream index to use
63
* @return the number of stream indices assigned by this model
64
*/
65
virtual
int64_t
DoAssignStreams
(int64_t stream) = 0;
66
};
67
68
/**
69
* @ingroup propagation
70
*
71
* @brief the propagation delay is random
72
*/
73
class
RandomPropagationDelayModel
:
public
PropagationDelayModel
74
{
75
public
:
76
/**
77
* @brief Get the type ID.
78
* @return the object TypeId
79
*/
80
static
TypeId
GetTypeId
();
81
82
/**
83
* Use the default parameters from PropagationDelayRandomDistribution.
84
*/
85
RandomPropagationDelayModel
();
86
~RandomPropagationDelayModel
()
override
;
87
Time
GetDelay
(
Ptr<MobilityModel>
a,
Ptr<MobilityModel>
b)
const override
;
88
89
private
:
90
int64_t
DoAssignStreams
(int64_t stream)
override
;
91
Ptr<RandomVariableStream>
m_variable
;
//!< random generator
92
};
93
94
/**
95
* @ingroup propagation
96
*
97
* @brief the propagation speed is constant
98
*/
99
class
ConstantSpeedPropagationDelayModel
:
public
PropagationDelayModel
100
{
101
public
:
102
/**
103
* @brief Get the type ID.
104
* @return the object TypeId
105
*/
106
static
TypeId
GetTypeId
();
107
108
/**
109
* Use the default parameters from PropagationDelayConstantSpeed.
110
*/
111
ConstantSpeedPropagationDelayModel
();
112
Time
GetDelay
(
Ptr<MobilityModel>
a,
Ptr<MobilityModel>
b)
const override
;
113
/**
114
* @param speed the new speed (m/s)
115
*/
116
void
SetSpeed
(
double
speed);
117
/**
118
* @returns the current propagation speed (m/s).
119
*/
120
double
GetSpeed
()
const
;
121
122
private
:
123
int64_t
DoAssignStreams
(int64_t stream)
override
;
124
double
m_speed
;
//!< speed
125
};
126
127
}
// namespace ns3
128
129
#endif
/* PROPAGATION_DELAY_MODEL_H */
ns3::ConstantSpeedPropagationDelayModel
the propagation speed is constant
Definition
propagation-delay-model.h:100
ns3::ConstantSpeedPropagationDelayModel::GetDelay
Time GetDelay(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Definition
propagation-delay-model.cc:103
ns3::ConstantSpeedPropagationDelayModel::GetSpeed
double GetSpeed() const
Definition
propagation-delay-model.cc:117
ns3::ConstantSpeedPropagationDelayModel::m_speed
double m_speed
speed
Definition
propagation-delay-model.h:124
ns3::ConstantSpeedPropagationDelayModel::SetSpeed
void SetSpeed(double speed)
Definition
propagation-delay-model.cc:111
ns3::ConstantSpeedPropagationDelayModel::DoAssignStreams
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
Definition
propagation-delay-model.cc:123
ns3::ConstantSpeedPropagationDelayModel::ConstantSpeedPropagationDelayModel
ConstantSpeedPropagationDelayModel()
Use the default parameters from PropagationDelayConstantSpeed.
Definition
propagation-delay-model.cc:98
ns3::ConstantSpeedPropagationDelayModel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
propagation-delay-model.cc:82
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::PropagationDelayModel
calculate a propagation delay.
Definition
propagation-delay-model.h:27
ns3::PropagationDelayModel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
propagation-delay-model.cc:21
ns3::PropagationDelayModel::~PropagationDelayModel
~PropagationDelayModel() override
Definition
propagation-delay-model.cc:28
ns3::PropagationDelayModel::DoAssignStreams
virtual int64_t DoAssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model.
ns3::PropagationDelayModel::AssignStreams
int64_t AssignStreams(int64_t stream)
If this delay model uses objects of type RandomVariableStream, set the stream numbers to the integers...
Definition
propagation-delay-model.cc:33
ns3::PropagationDelayModel::GetDelay
virtual Time GetDelay(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const =0
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::RandomPropagationDelayModel
the propagation delay is random
Definition
propagation-delay-model.h:74
ns3::RandomPropagationDelayModel::RandomPropagationDelayModel
RandomPropagationDelayModel()
Use the default parameters from PropagationDelayRandomDistribution.
Definition
propagation-delay-model.cc:58
ns3::RandomPropagationDelayModel::m_variable
Ptr< RandomVariableStream > m_variable
random generator
Definition
propagation-delay-model.h:91
ns3::RandomPropagationDelayModel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
propagation-delay-model.cc:43
ns3::RandomPropagationDelayModel::DoAssignStreams
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
Definition
propagation-delay-model.cc:73
ns3::RandomPropagationDelayModel::~RandomPropagationDelayModel
~RandomPropagationDelayModel() override
Definition
propagation-delay-model.cc:62
ns3::RandomPropagationDelayModel::GetDelay
Time GetDelay(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Definition
propagation-delay-model.cc:67
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
propagation
model
propagation-delay-model.h
Generated on Wed Dec 4 2024 09:20:49 for ns-3 by
1.11.0