A Discrete-Event Network Simulator
API
three-gpp-propagation-loss-model.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2019 SIGNET Lab, Department of Information Engineering,
4  * University of Padova
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */
19 
20 #ifndef THREE_GPP_PROPAGATION_LOSS_MODEL_H
21 #define THREE_GPP_PROPAGATION_LOSS_MODEL_H
22 
23 #include "ns3/propagation-loss-model.h"
24 #include "ns3/channel-condition-model.h"
25 
26 namespace ns3 {
27 
32 {
33 public:
38  static TypeId GetTypeId (void);
39 
44 
48  virtual ~ThreeGppPropagationLossModel () override;
49 
56 
62 
67  void SetFrequency (double f);
68 
73  double GetFrequency (void) const;
74 
81 
89 
90 private:
100  virtual double DoCalcRxPower (double txPowerDbm,
102  Ptr<MobilityModel> b) const override;
103 
113  virtual int64_t DoAssignStreams (int64_t stream) override;
114 
124  virtual double GetLossLos (double distance2D, double distance3D, double hUt, double hBs) const = 0;
125 
135  virtual double GetLossNlos (double distance2D, double distance3D, double hUt, double hBs) const = 0;
136 
145  virtual std::pair<double, double> GetUtAndBsHeights (double za, double zb) const;
146 
159 
168 
175 
187  static uint32_t GetKey (Ptr<MobilityModel> a, Ptr<MobilityModel> b);
188 
200 
201 protected:
202  virtual void DoDispose () override;
203 
210  static double Calculate2dDistance (Vector a, Vector b);
211 
213  double m_frequency;
216 
219  {
220  double m_shadowing;
222  Vector m_distance;
223  };
224 
225  mutable std::unordered_map<uint32_t, ShadowingMapItem> m_shadowingMap;
226 };
227 
235 {
236 public:
241  static TypeId GetTypeId (void);
242 
247 
251  virtual ~ThreeGppRmaPropagationLossModel () override;
252 
259 
267 
268 private:
278  virtual double GetLossLos (double distance2D, double distance3D, double hUt, double hBs) const override;
279 
289  virtual double GetLossNlos (double distance2D, double distance3D, double hUt, double hBs) const override;
290 
299 
305  virtual double GetShadowingCorrelationDistance (ChannelCondition::LosConditionValue cond) const override;
306 
315  static double Pl1 (double frequency, double distance3D, double h, double w);
316 
324  static double GetBpDistance (double frequency, double hA, double hB);
325 
326  double m_h;
327  double m_w;
328 };
329 
337 {
338 public:
343  static TypeId GetTypeId (void);
344 
349 
353  virtual ~ThreeGppUmaPropagationLossModel () override;
354 
361 
369 
370 private:
380  virtual int64_t DoAssignStreams (int64_t stream) override;
381 
391  double GetLossLos (double distance2D, double distance3D, double hUt, double hBs) const override;
392 
402  double GetLossNlos (double distance2D, double distance3D, double hUt, double hBs) const override;
403 
412 
418  virtual double GetShadowingCorrelationDistance (ChannelCondition::LosConditionValue cond) const override;
419 
427  double GetBpDistance (double hUt, double hBs, double distance2D) const;
428 
430 };
431 
439 {
440 public:
445  static TypeId GetTypeId (void);
446 
451 
456 
463 
471 
472 private:
482  double GetLossLos (double distance2D, double distance3D, double hUt, double hBs) const override;
483 
493  double GetLossNlos (double distance2D, double distance3D, double hUt, double hBs) const override;
494 
503 
509  virtual double GetShadowingCorrelationDistance (ChannelCondition::LosConditionValue cond) const override;
510 
518  double GetBpDistance (double hUt, double hBs, double distance2D) const;
519 
526  std::pair<double, double> GetUtAndBsHeights (double za, double zb) const override;
527 };
528 
536 {
537 public:
542  static TypeId GetTypeId (void);
543 
548 
552  virtual ~ThreeGppIndoorOfficePropagationLossModel () override;
553 
560 
568 
569 private:
579  double GetLossLos (double distance2D, double distance3D, double hUt, double hBs) const override;
580 
590  double GetLossNlos (double distance2D, double distance3D, double hUt, double hBs) const override;
591 
600 
606  virtual double GetShadowingCorrelationDistance (ChannelCondition::LosConditionValue cond) const override;
607 };
608 
609 } // namespace ns3
610 
611 #endif /* THREE_GPP_PROPAGATION_LOSS_MODEL_H */
std::unordered_map< uint32_t, ShadowingMapItem > m_shadowingMap
map to store the shadowing values
Implements the pathloss model defined in 3GPP TR 38.901, Table 7.4.1-1 for the UMi-Street Canyon scen...
Ptr< ChannelConditionModel > m_channelConditionModel
pointer to the channel condition model
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
ChannelCondition::LosConditionValue m_condition
the LOS/NLOS condition
virtual int64_t DoAssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
virtual double GetShadowingCorrelationDistance(ChannelCondition::LosConditionValue cond) const =0
Returns the shadow fading correlation distance.
double GetLossNlos(double distance2D, double distance3D, double hUt, double hBs) const override
Computes the pathloss between a and b considering that the line of sight is obstructed.
virtual double GetShadowingStd(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading standard deviation.
virtual double GetLossLos(double distance2D, double distance3D, double hUt, double hBs) const =0
Computes the pathloss between a and b considering that the line of sight is not obstructed.
virtual double GetShadowingStd(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading standard deviation.
static double GetBpDistance(double frequency, double hA, double hB)
Computes the breakpoint distance for the RMa scenario.
virtual ~ThreeGppUmaPropagationLossModel() override
Destructor.
ThreeGppRmaPropagationLossModel & operator=(const ThreeGppRmaPropagationLossModel &)=delete
Copy constructor.
virtual double GetShadowingCorrelationDistance(ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading correlation distance.
virtual double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the received power by applying the pathloss model described in 3GPP TR 38.901.
static TypeId GetTypeId(void)
Get the type ID.
ThreeGppUmiStreetCanyonPropagationLossModel & operator=(const ThreeGppUmiStreetCanyonPropagationLossModel &)=delete
Copy constructor.
double GetBpDistance(double hUt, double hBs, double distance2D) const
Computes the breakpoint distance.
double GetLossNlos(double distance2D, double distance3D, double hUt, double hBs) const override
Computes the pathloss between a and b considering that the line of sight is obstructed.
double GetBpDistance(double hUt, double hBs, double distance2D) const
Computes the breakpoint distance.
virtual double GetShadowingStd(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading standard deviation.
static double Calculate2dDistance(Vector a, Vector b)
Computes the 2D distance between two 3D vectors.
virtual double GetShadowingCorrelationDistance(ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading correlation distance.
virtual double GetLossNlos(double distance2D, double distance3D, double hUt, double hBs) const =0
Computes the pathloss between a and b considering that the line of sight is obstructed.
Implements the pathloss model defined in 3GPP TR 38.901, Table 7.4.1-1 for the RMa scenario...
double GetFrequency(void) const
Return the current central frequency.
double GetLossLos(double distance2D, double distance3D, double hUt, double hBs) const override
Computes the pathloss between a and b considering that the line of sight is not obstructed.
double m_w
average street width in meters
Define a struct for the m_shadowingMap entries.
double f(double x, void *params)
Definition: 80211b.c:70
virtual double GetShadowingCorrelationDistance(ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading correlation distance.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void DoDispose() override
Destructor implementation.
virtual double GetLossLos(double distance2D, double distance3D, double hUt, double hBs) const override
Computes the pathloss between a and b considering that the line of sight is not obstructed.
static Vector GetVectorDifference(Ptr< MobilityModel > a, Ptr< MobilityModel > b)
Get the difference between the node position.
double GetShadowing(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const
Retrieves the shadowing value by looking at m_shadowingMap.
static double Pl1(double frequency, double distance3D, double h, double w)
Computes the PL1 formula for the RMa scenario.
ThreeGppIndoorOfficePropagationLossModel & operator=(const ThreeGppIndoorOfficePropagationLossModel &)=delete
Copy constructor.
static TypeId GetTypeId(void)
Get the type ID.
Ptr< ChannelConditionModel > GetChannelConditionModel(void) const
Returns the associated channel condition model.
Models the propagation loss through a transmission medium.
std::pair< double, double > GetUtAndBsHeights(double za, double zb) const override
Determines hUT and hBS.
double GetLossNlos(double distance2D, double distance3D, double hUt, double hBs) const override
Computes the pathloss between a and b considering that the line of sight is obstructed.
void SetFrequency(double f)
Set the central frequency of the model.
void SetChannelConditionModel(Ptr< ChannelConditionModel > model)
Set the channel condition model used to determine the channel state (e.g., the LOS/NLOS condition) ...
double GetLossLos(double distance2D, double distance3D, double hUt, double hBs) const override
Computes the pathloss between a and b considering that the line of sight is not obstructed.
ThreeGppPropagationLossModel & operator=(const ThreeGppPropagationLossModel &)=delete
Copy constructor.
double m_frequency
operating frequency in Hz
virtual double GetShadowingCorrelationDistance(ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading correlation distance.
virtual double GetShadowingStd(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading standard deviation.
Base class for the 3GPP propagation models.
virtual int64_t DoAssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
virtual double GetLossNlos(double distance2D, double distance3D, double hUt, double hBs) const override
Computes the pathloss between a and b considering that the line of sight is obstructed.
double m_h
average building height in meters
static TypeId GetTypeId(void)
Get the type ID.
static uint32_t GetKey(Ptr< MobilityModel > a, Ptr< MobilityModel > b)
Returns an unique key for the channel between a and b.
LosConditionValue
Possible values for Line-of-Sight condition.
virtual std::pair< double, double > GetUtAndBsHeights(double za, double zb) const
Determines hUT and hBS.
a unique identifier for an interface.
Definition: type-id.h:58
Ptr< UniformRandomVariable > m_uniformVar
a uniform random variable used for the computation of the breakpoint distance
Implements the pathloss model defined in 3GPP TR 38.901, Table 7.4.1-1 for the UMa scenario...
double GetLossLos(double distance2D, double distance3D, double hUt, double hBs) const override
Computes the pathloss between a and b considering that the line of sight is not obstructed.
Implements the pathloss model defined in 3GPP TR 38.901, Table 7.4.1-1 for the Indoor Office scenario...
ThreeGppUmaPropagationLossModel & operator=(const ThreeGppUmaPropagationLossModel &)=delete
Copy constructor.
virtual ~ThreeGppPropagationLossModel() override
Destructor.
virtual ~ThreeGppRmaPropagationLossModel() override
Destructor.
virtual double GetShadowingStd(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const =0
Returns the shadow fading standard deviation.
Ptr< NormalRandomVariable > m_normRandomVariable
normal random variable