A Discrete-Event Network Simulator
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 * 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: Marco Miozzo <marco.miozzo@cttc.es>
18 * Nicola Baldo <nbaldo@cttc.es>
19 *
20 */
21
22#ifndef BUILDINGS_PROPAGATION_LOSS_MODEL_H_
23#define BUILDINGS_PROPAGATION_LOSS_MODEL_H_
24
25#include "building.h"
27
28#include "ns3/nstime.h"
29#include "ns3/propagation-loss-model.h"
30#include "ns3/random-variable-stream.h"
31
32namespace ns3
33{
34
35class ShadowingLossModel;
36class JakesFadingLossModel;
37
38/**
39 * \ingroup buildings
40 * \ingroup propagation
41 *
42 * This model provides means for simulating the following propagation
43 * phenomena in the presence of buildings:
44 *
45 * - shadowing (indoor, outdoor)
46 * - external wall penetration loss
47 * - internal wall penetration loss
48 *
49 * The distance-dependent component of propagation loss is deferred
50 * to derived classes which are expected to implement the GetLoss method.
51 *
52 * \warning This model works only when MobilityBuildingInfo is aggreegated
53 * to the mobility model
54 *
55 */
56
58{
59 public:
60 /**
61 * \brief Get the type ID.
62 * \return The object TypeId.
63 */
64 static TypeId GetTypeId();
65
67 /**
68 * \param a the mobility model of the source
69 * \param b the mobility model of the destination
70 * \returns the propagation loss (in dBm)
71 */
72 virtual double GetLoss(Ptr<MobilityModel> a, Ptr<MobilityModel> b) const = 0;
73
74 // inherited from PropagationLossModel
75 double DoCalcRxPower(double txPowerDbm,
77 Ptr<MobilityModel> b) const override;
78
79 protected:
80 /**
81 * Calculate the external wall loss
82 * \param a Building data
83 * \returns the propagation loss (in dBm)
84 */
86 /**
87 * Calculate the height loss
88 * \param n Building data
89 * \returns the propagation loss (in dBm)
90 */
92 /**
93 * Calculate the internal wall loss
94 * \param a Room A data
95 * \param b Room B data
96 * \returns the propagation loss (in dBm)
97 */
99
100 /**
101 * Calculate the shadowing loss
102 * \param a Room A data
103 * \param b Room B data
104 * \returns the propagation loss (in dBm)
105 */
107
108 double m_lossInternalWall; //!< loss from internal walls (in dBm)
109
110 /**
111 * \ingroup propagation
112 *
113 * This model allows the computation of shadowing loss
114 */
116 {
117 public:
119 /**
120 * Constructor
121 * \param shadowingValue Value for shadowing
122 * \param receiver Receiver position
123 */
124 ShadowingLoss(double shadowingValue, Ptr<MobilityModel> receiver);
125 /**
126 * \returns the loss (in dBm)
127 */
128 double GetLoss() const;
129 /**
130 * \returns the receiver mobility model
131 */
133
134 protected:
135 double m_shadowingValue; //!< Shadowing value
136 Ptr<MobilityModel> m_receiver; //!< The receiver mobility model
137 };
138
139 /// Map of the shadowng loss
140 mutable std::map<Ptr<MobilityModel>, std::map<Ptr<MobilityModel>, ShadowingLoss>>
142 /**
143 * Calculate the Standard deviation of the normal distribution used to calculate the shadowing
144 * \param a Room A data
145 * \param b Room B data
146 * \return the Standard deviation of the normal distribution
147 */
149
150 /// Standard deviation of the normal distribution used to calculate the shadowing due to ext
151 /// walls
153 /// Standard deviation of the normal distribution used to calculate the shadowing for outdoor
154 /// nodes
156 /// Standard deviation of the normal distribution used to calculate the shadowing for indoor
157 /// nodes
160
161 int64_t DoAssignStreams(int64_t stream) override;
162};
163
164} // namespace ns3
165
166#endif /* BUILDINGS_PROPAGATION_LOSS_MODEL_H_ */
This model allows the computation of shadowing loss.
Ptr< MobilityModel > m_receiver
The receiver mobility model.
This model provides means for simulating the following propagation phenomena in the presence of build...
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
std::map< Ptr< MobilityModel >, std::map< Ptr< MobilityModel >, ShadowingLoss > > m_shadowingLossMap
Map of the shadowng loss.
double GetShadowing(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Calculate the shadowing loss.
double HeightLoss(Ptr< MobilityBuildingInfo > n) const
Calculate the height loss.
double m_shadowingSigmaOutdoor
Standard deviation of the normal distribution used to calculate the shadowing for outdoor nodes.
virtual double GetLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const =0
double m_shadowingSigmaExtWalls
Standard deviation of the normal distribution used to calculate the shadowing due to ext walls.
double m_shadowingSigmaIndoor
Standard deviation of the normal distribution used to calculate the shadowing for indoor nodes.
double ExternalWallLoss(Ptr< MobilityBuildingInfo > a) const
Calculate the external wall loss.
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
double m_lossInternalWall
loss from internal walls (in dBm)
double EvaluateSigma(Ptr< MobilityBuildingInfo > a, Ptr< MobilityBuildingInfo > b) const
Calculate the Standard deviation of the normal distribution used to calculate the shadowing.
Ptr< NormalRandomVariable > m_randVariable
Random variable.
double InternalWallsLoss(Ptr< MobilityBuildingInfo > a, Ptr< MobilityBuildingInfo > b) const
Calculate the internal wall loss.
Models the propagation loss through a transmission medium.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.