A Discrete-Event Network Simulator
QKDNetSim v2.0 (NS-3 v3.41) @ (+)
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
w
Enumerator
a
b
c
d
e
f
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
Related Functions
:
a
b
c
d
e
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
Enumerations
Enumerator
c
e
i
l
o
r
s
t
v
Macros
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
constant-spectrum-propagation-loss.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Manuel Requena <manuel.requena@cttc.es>
18
*/
19
20
#include "
constant-spectrum-propagation-loss.h
"
21
22
#include "
spectrum-signal-parameters.h
"
23
24
#include "ns3/double.h"
25
#include "ns3/log.h"
26
27
#include <cmath>
28
29
namespace
ns3
30
{
31
32
NS_LOG_COMPONENT_DEFINE
(
"ConstantSpectrumPropagationLossModel"
);
33
34
NS_OBJECT_ENSURE_REGISTERED
(ConstantSpectrumPropagationLossModel);
35
36
ConstantSpectrumPropagationLossModel::ConstantSpectrumPropagationLossModel
()
37
{
38
NS_LOG_FUNCTION
(
this
);
39
}
40
41
ConstantSpectrumPropagationLossModel::~ConstantSpectrumPropagationLossModel
()
42
{
43
NS_LOG_FUNCTION
(
this
);
44
}
45
46
TypeId
47
ConstantSpectrumPropagationLossModel::GetTypeId
()
48
{
49
static
TypeId
tid =
50
TypeId
(
"ns3::ConstantSpectrumPropagationLossModel"
)
51
.
SetParent
<
SpectrumPropagationLossModel
>()
52
.SetGroupName(
"Spectrum"
)
53
.AddConstructor<
ConstantSpectrumPropagationLossModel
>()
54
.AddAttribute(
"Loss"
,
55
"Path loss (dB) between transmitter and receiver"
,
56
DoubleValue
(1.0),
57
MakeDoubleAccessor
(&
ConstantSpectrumPropagationLossModel::SetLossDb
,
58
&
ConstantSpectrumPropagationLossModel::GetLossDb
),
59
MakeDoubleChecker<double>());
60
return
tid;
61
}
62
63
void
64
ConstantSpectrumPropagationLossModel::SetLossDb
(
double
lossDb)
65
{
66
NS_LOG_FUNCTION
(
this
);
67
m_lossDb
= lossDb;
68
m_lossLinear
= std::pow(10,
m_lossDb
/ 10);
69
}
70
71
double
72
ConstantSpectrumPropagationLossModel::GetLossDb
()
const
73
{
74
NS_LOG_FUNCTION
(
this
);
75
return
m_lossDb
;
76
}
77
78
Ptr<SpectrumValue>
79
ConstantSpectrumPropagationLossModel::DoCalcRxPowerSpectralDensity
(
80
Ptr<const SpectrumSignalParameters>
params
,
81
Ptr<const MobilityModel>
a,
82
Ptr<const MobilityModel>
b)
const
83
{
84
NS_LOG_FUNCTION
(
this
);
85
86
Ptr<SpectrumValue>
rxPsd = Copy<SpectrumValue>(
params
->psd);
87
auto
vit = rxPsd->
ValuesBegin
();
88
auto
fit
= rxPsd->
ConstBandsBegin
();
89
90
while
(vit != rxPsd->
ValuesEnd
())
91
{
92
NS_ASSERT
(
fit
!= rxPsd->
ConstBandsEnd
());
93
NS_LOG_LOGIC
(
"Ptx = "
<< *vit);
94
*vit /=
m_lossLinear
;
// Prx = Ptx / loss
95
NS_LOG_LOGIC
(
"Prx = "
<< *vit);
96
++vit;
97
++
fit
;
98
}
99
return
rxPsd;
100
}
101
102
int64_t
103
ConstantSpectrumPropagationLossModel::DoAssignStreams
(int64_t stream)
104
{
105
return
0;
106
}
107
108
}
// namespace ns3
ns3::ConstantSpectrumPropagationLossModel
A Constant (fixed) propagation loss.
Definition:
constant-spectrum-propagation-loss.h:34
ns3::ConstantSpectrumPropagationLossModel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
constant-spectrum-propagation-loss.cc:47
ns3::ConstantSpectrumPropagationLossModel::SetLossDb
void SetLossDb(double lossDb)
Set the propagation loss.
Definition:
constant-spectrum-propagation-loss.cc:64
ns3::ConstantSpectrumPropagationLossModel::GetLossDb
double GetLossDb() const
Get the propagation loss.
Definition:
constant-spectrum-propagation-loss.cc:72
ns3::ConstantSpectrumPropagationLossModel::~ConstantSpectrumPropagationLossModel
~ConstantSpectrumPropagationLossModel() override
Definition:
constant-spectrum-propagation-loss.cc:41
ns3::ConstantSpectrumPropagationLossModel::m_lossDb
double m_lossDb
Propagation loss [dB].
Definition:
constant-spectrum-propagation-loss.h:61
ns3::ConstantSpectrumPropagationLossModel::DoCalcRxPowerSpectralDensity
Ptr< SpectrumValue > DoCalcRxPowerSpectralDensity(Ptr< const SpectrumSignalParameters > params, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Definition:
constant-spectrum-propagation-loss.cc:79
ns3::ConstantSpectrumPropagationLossModel::DoAssignStreams
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
Definition:
constant-spectrum-propagation-loss.cc:103
ns3::ConstantSpectrumPropagationLossModel::ConstantSpectrumPropagationLossModel
ConstantSpectrumPropagationLossModel()
Definition:
constant-spectrum-propagation-loss.cc:36
ns3::ConstantSpectrumPropagationLossModel::m_lossLinear
double m_lossLinear
Propagation loss (linear)
Definition:
constant-spectrum-propagation-loss.h:62
ns3::DoubleValue
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition:
double.h:42
ns3::Ptr< SpectrumValue >
ns3::SpectrumPropagationLossModel
spectrum-aware propagation loss model
Definition:
spectrum-propagation-loss-model.h:44
ns3::SpectrumValue::ConstBandsEnd
Bands::const_iterator ConstBandsEnd() const
Definition:
spectrum-value.cc:96
ns3::SpectrumValue::ValuesBegin
Values::iterator ValuesBegin()
Definition:
spectrum-value.cc:78
ns3::SpectrumValue::ConstBandsBegin
Bands::const_iterator ConstBandsBegin() const
Definition:
spectrum-value.cc:90
ns3::SpectrumValue::ValuesEnd
Values::iterator ValuesEnd()
Definition:
spectrum-value.cc:84
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition:
type-id.cc:931
constant-spectrum-propagation-loss.h
NS_ASSERT
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition:
assert.h:66
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition:
log.h:202
NS_LOG_LOGIC
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition:
log.h:282
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition:
log-macros-enabled.h:240
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition:
object-base.h:46
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::MakeDoubleAccessor
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Definition:
double.h:43
two-ray-to-three-gpp-ch-calibration.fit
fit
Definition:
two-ray-to-three-gpp-ch-calibration.py:563
two-ray-to-three-gpp-ch-calibration.params
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.
Definition:
two-ray-to-three-gpp-ch-calibration.py:514
spectrum-signal-parameters.h
src
spectrum
model
constant-spectrum-propagation-loss.cc
Generated on Sun Mar 3 2024 17:11:08 for ns-3 by
1.9.1