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
buildings-propagation-loss-model.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Marco Miozzo <marco.miozzo@cttc.es>
7
* Nicola Baldo <nbaldo@cttc.es>
8
*
9
*/
10
11
#ifndef BUILDINGS_PROPAGATION_LOSS_MODEL_H_
12
#define BUILDINGS_PROPAGATION_LOSS_MODEL_H_
13
14
#include "
building.h
"
15
#include "
mobility-building-info.h
"
16
17
#include "ns3/nstime.h"
18
#include "ns3/propagation-loss-model.h"
19
#include "ns3/random-variable-stream.h"
20
21
namespace
ns3
22
{
23
24
class
ShadowingLossModel;
25
class
JakesFadingLossModel;
26
27
/**
28
* @ingroup buildings
29
* @ingroup propagation
30
*
31
* This model provides means for simulating the following propagation
32
* phenomena in the presence of buildings:
33
*
34
* - shadowing (indoor, outdoor)
35
* - external wall penetration loss
36
* - internal wall penetration loss
37
*
38
* The distance-dependent component of propagation loss is deferred
39
* to derived classes which are expected to implement the GetLoss method.
40
*
41
* @warning This model works only when MobilityBuildingInfo is aggreegated
42
* to the mobility model
43
*
44
*/
45
46
class
BuildingsPropagationLossModel
:
public
PropagationLossModel
47
{
48
public
:
49
/**
50
* @brief Get the type ID.
51
* @return The object TypeId.
52
*/
53
static
TypeId
GetTypeId
();
54
55
BuildingsPropagationLossModel
();
56
/**
57
* @param a the mobility model of the source
58
* @param b the mobility model of the destination
59
* @returns the propagation loss (in dBm)
60
*/
61
virtual
double
GetLoss
(
Ptr<MobilityModel>
a,
Ptr<MobilityModel>
b)
const
= 0;
62
63
// inherited from PropagationLossModel
64
double
DoCalcRxPower
(
double
txPowerDbm,
65
Ptr<MobilityModel>
a,
66
Ptr<MobilityModel>
b)
const override
;
67
68
protected
:
69
/**
70
* Calculate the external wall loss
71
* @param a Building data
72
* @returns the propagation loss (in dBm)
73
*/
74
double
ExternalWallLoss
(
Ptr<MobilityBuildingInfo>
a)
const
;
75
/**
76
* Calculate the height loss
77
* @param n Building data
78
* @returns the propagation loss (in dBm)
79
*/
80
double
HeightLoss
(
Ptr<MobilityBuildingInfo>
n)
const
;
81
/**
82
* Calculate the internal wall loss
83
* @param a Room A data
84
* @param b Room B data
85
* @returns the propagation loss (in dBm)
86
*/
87
double
InternalWallsLoss
(
Ptr<MobilityBuildingInfo>
a,
Ptr<MobilityBuildingInfo>
b)
const
;
88
89
/**
90
* Calculate the shadowing loss
91
* @param a Room A data
92
* @param b Room B data
93
* @returns the propagation loss (in dBm)
94
*/
95
double
GetShadowing
(
Ptr<MobilityModel>
a,
Ptr<MobilityModel>
b)
const
;
96
97
double
m_lossInternalWall
;
//!< loss from internal walls (in dBm)
98
99
/**
100
* @ingroup propagation
101
*
102
* This model allows the computation of shadowing loss
103
*/
104
class
ShadowingLoss
105
{
106
public
:
107
ShadowingLoss
();
108
/**
109
* Constructor
110
* @param shadowingValue Value for shadowing
111
* @param receiver Receiver position
112
*/
113
ShadowingLoss
(
double
shadowingValue,
Ptr<MobilityModel>
receiver);
114
/**
115
* @returns the loss (in dBm)
116
*/
117
double
GetLoss
()
const
;
118
/**
119
* @returns the receiver mobility model
120
*/
121
Ptr<MobilityModel>
GetReceiver
()
const
;
122
123
protected
:
124
double
m_shadowingValue
;
//!< Shadowing value
125
Ptr<MobilityModel>
m_receiver
;
//!< The receiver mobility model
126
};
127
128
/// Map of the shadowng loss
129
mutable
std::map<Ptr<MobilityModel>, std::map<Ptr<MobilityModel>,
ShadowingLoss
>>
130
m_shadowingLossMap
;
131
/**
132
* Calculate the Standard deviation of the normal distribution used to calculate the shadowing
133
* @param a Room A data
134
* @param b Room B data
135
* @return the Standard deviation of the normal distribution
136
*/
137
double
EvaluateSigma
(
Ptr<MobilityBuildingInfo>
a,
Ptr<MobilityBuildingInfo>
b)
const
;
138
139
/// Standard deviation of the normal distribution used to calculate the shadowing due to ext
140
/// walls
141
double
m_shadowingSigmaExtWalls
;
142
/// Standard deviation of the normal distribution used to calculate the shadowing for outdoor
143
/// nodes
144
double
m_shadowingSigmaOutdoor
;
145
/// Standard deviation of the normal distribution used to calculate the shadowing for indoor
146
/// nodes
147
double
m_shadowingSigmaIndoor
;
148
Ptr<NormalRandomVariable>
m_randVariable
;
//!< Random variable
149
150
int64_t
DoAssignStreams
(int64_t stream)
override
;
151
};
152
153
}
// namespace ns3
154
155
#endif
/* BUILDINGS_PROPAGATION_LOSS_MODEL_H_ */
building.h
ns3::BuildingsPropagationLossModel::ShadowingLoss
This model allows the computation of shadowing loss.
Definition
buildings-propagation-loss-model.h:105
ns3::BuildingsPropagationLossModel::ShadowingLoss::ShadowingLoss
ShadowingLoss()
Definition
buildings-propagation-loss-model.cc:31
ns3::BuildingsPropagationLossModel::ShadowingLoss::GetReceiver
Ptr< MobilityModel > GetReceiver() const
Definition
buildings-propagation-loss-model.cc:50
ns3::BuildingsPropagationLossModel::ShadowingLoss::m_shadowingValue
double m_shadowingValue
Shadowing value.
Definition
buildings-propagation-loss-model.h:124
ns3::BuildingsPropagationLossModel::ShadowingLoss::m_receiver
Ptr< MobilityModel > m_receiver
The receiver mobility model.
Definition
buildings-propagation-loss-model.h:125
ns3::BuildingsPropagationLossModel::ShadowingLoss::GetLoss
double GetLoss() const
Definition
buildings-propagation-loss-model.cc:44
ns3::BuildingsPropagationLossModel::DoCalcRxPower
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
Definition
buildings-propagation-loss-model.cc:214
ns3::BuildingsPropagationLossModel::m_shadowingLossMap
std::map< Ptr< MobilityModel >, std::map< Ptr< MobilityModel >, ShadowingLoss > > m_shadowingLossMap
Map of the shadowng loss.
Definition
buildings-propagation-loss-model.h:130
ns3::BuildingsPropagationLossModel::GetShadowing
double GetShadowing(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Calculate the shadowing loss.
Definition
buildings-propagation-loss-model.cc:146
ns3::BuildingsPropagationLossModel::HeightLoss
double HeightLoss(Ptr< MobilityBuildingInfo > n) const
Calculate the height loss.
Definition
buildings-propagation-loss-model.cc:126
ns3::BuildingsPropagationLossModel::m_shadowingSigmaOutdoor
double m_shadowingSigmaOutdoor
Standard deviation of the normal distribution used to calculate the shadowing for outdoor nodes.
Definition
buildings-propagation-loss-model.h:144
ns3::BuildingsPropagationLossModel::GetLoss
virtual double GetLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const =0
ns3::BuildingsPropagationLossModel::m_shadowingSigmaExtWalls
double m_shadowingSigmaExtWalls
Standard deviation of the normal distribution used to calculate the shadowing due to ext walls.
Definition
buildings-propagation-loss-model.h:141
ns3::BuildingsPropagationLossModel::m_shadowingSigmaIndoor
double m_shadowingSigmaIndoor
Standard deviation of the normal distribution used to calculate the shadowing for indoor nodes.
Definition
buildings-propagation-loss-model.h:147
ns3::BuildingsPropagationLossModel::ExternalWallLoss
double ExternalWallLoss(Ptr< MobilityBuildingInfo > a) const
Calculate the external wall loss.
Definition
buildings-propagation-loss-model.cc:102
ns3::BuildingsPropagationLossModel::BuildingsPropagationLossModel
BuildingsPropagationLossModel()
Definition
buildings-propagation-loss-model.cc:96
ns3::BuildingsPropagationLossModel::DoAssignStreams
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
Definition
buildings-propagation-loss-model.cc:222
ns3::BuildingsPropagationLossModel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
buildings-propagation-loss-model.cc:56
ns3::BuildingsPropagationLossModel::m_lossInternalWall
double m_lossInternalWall
loss from internal walls (in dBm)
Definition
buildings-propagation-loss-model.h:97
ns3::BuildingsPropagationLossModel::EvaluateSigma
double EvaluateSigma(Ptr< MobilityBuildingInfo > a, Ptr< MobilityBuildingInfo > b) const
Calculate the Standard deviation of the normal distribution used to calculate the shadowing.
Definition
buildings-propagation-loss-model.cc:182
ns3::BuildingsPropagationLossModel::m_randVariable
Ptr< NormalRandomVariable > m_randVariable
Random variable.
Definition
buildings-propagation-loss-model.h:148
ns3::BuildingsPropagationLossModel::InternalWallsLoss
double InternalWallsLoss(Ptr< MobilityBuildingInfo > a, Ptr< MobilityBuildingInfo > b) const
Calculate the internal wall loss.
Definition
buildings-propagation-loss-model.cc:136
ns3::PropagationLossModel::PropagationLossModel
PropagationLossModel()
Definition
propagation-loss-model.cc:40
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:66
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:49
mobility-building-info.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
buildings
model
buildings-propagation-loss-model.h
Generated on Wed Jun 11 2025 13:15:27 for ns-3 by
1.13.2