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 * 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"
16
17#include "ns3/nstime.h"
18#include "ns3/propagation-loss-model.h"
19#include "ns3/random-variable-stream.h"
20
21namespace ns3
22{
23
24class ShadowingLossModel;
25class 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
47{
48 public:
49 /**
50 * \brief Get the type ID.
51 * \return The object TypeId.
52 */
53 static TypeId GetTypeId();
54
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,
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 */
75 /**
76 * Calculate the height loss
77 * \param n Building data
78 * \returns the propagation loss (in dBm)
79 */
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 */
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 */
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 */
105 {
106 public:
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 */
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>>
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 */
138
139 /// Standard deviation of the normal distribution used to calculate the shadowing due to ext
140 /// walls
142 /// Standard deviation of the normal distribution used to calculate the shadowing for outdoor
143 /// nodes
145 /// Standard deviation of the normal distribution used to calculate the shadowing for indoor
146 /// nodes
149
150 int64_t DoAssignStreams(int64_t stream) override;
151};
152
153} // namespace ns3
154
155#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.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.