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  double GetLoss (Ptr<ChannelCondition> cond, double distance2D, double distance3D, double hUt, double hBs) const;
125 
135  virtual double GetLossLos (double distance2D, double distance3D, double hUt, double hBs) const = 0;
136 
146  virtual double GetLossNlos (double distance2D, double distance3D, double hUt, double hBs) const = 0;
147 
158  virtual double GetLossNlosv (double distance2D, double distance3D, double hUt, double hBs) const;
159 
168  virtual std::pair<double, double> GetUtAndBsHeights (double za, double zb) const;
169 
182 
191 
198 
210  static uint32_t GetKey (Ptr<MobilityModel> a, Ptr<MobilityModel> b);
211 
223 
224 protected:
225  virtual void DoDispose () override;
226 
233  static double Calculate2dDistance (Vector a, Vector b);
234 
236  double m_frequency;
239 
242  {
243  double m_shadowing;
245  Vector m_distance;
246  };
247 
248  mutable std::unordered_map<uint32_t, ShadowingMapItem> m_shadowingMap;
249 };
250 
258 {
259 public:
264  static TypeId GetTypeId (void);
265 
270 
274  virtual ~ThreeGppRmaPropagationLossModel () override;
275 
282 
290 
291 private:
301  virtual double GetLossLos (double distance2D, double distance3D, double hUt, double hBs) const override;
302 
312  virtual double GetLossNlos (double distance2D, double distance3D, double hUt, double hBs) const override;
313 
322 
328  virtual double GetShadowingCorrelationDistance (ChannelCondition::LosConditionValue cond) const override;
329 
338  static double Pl1 (double frequency, double distance3D, double h, double w);
339 
347  static double GetBpDistance (double frequency, double hA, double hB);
348 
349  double m_h;
350  double m_w;
351 };
352 
360 {
361 public:
366  static TypeId GetTypeId (void);
367 
372 
376  virtual ~ThreeGppUmaPropagationLossModel () override;
377 
384 
392 
393 private:
403  virtual int64_t DoAssignStreams (int64_t stream) override;
404 
414  double GetLossLos (double distance2D, double distance3D, double hUt, double hBs) const override;
415 
425  double GetLossNlos (double distance2D, double distance3D, double hUt, double hBs) const override;
426 
435 
441  virtual double GetShadowingCorrelationDistance (ChannelCondition::LosConditionValue cond) const override;
442 
450  double GetBpDistance (double hUt, double hBs, double distance2D) const;
451 
453 };
454 
462 {
463 public:
468  static TypeId GetTypeId (void);
469 
474 
479 
486 
494 
495 private:
505  double GetLossLos (double distance2D, double distance3D, double hUt, double hBs) const override;
506 
516  double GetLossNlos (double distance2D, double distance3D, double hUt, double hBs) const override;
517 
526 
532  virtual double GetShadowingCorrelationDistance (ChannelCondition::LosConditionValue cond) const override;
533 
541  double GetBpDistance (double hUt, double hBs, double distance2D) const;
542 
549  std::pair<double, double> GetUtAndBsHeights (double za, double zb) const override;
550 };
551 
559 {
560 public:
565  static TypeId GetTypeId (void);
566 
571 
575  virtual ~ThreeGppIndoorOfficePropagationLossModel () override;
576 
583 
591 
592 private:
602  double GetLossLos (double distance2D, double distance3D, double hUt, double hBs) const override;
603 
613  double GetLossNlos (double distance2D, double distance3D, double hUt, double hBs) const override;
614 
623 
629  virtual double GetShadowingCorrelationDistance (ChannelCondition::LosConditionValue cond) const override;
630 };
631 
632 } // namespace ns3
633 
634 #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 GetLoss(Ptr< ChannelCondition > cond, double distance2D, double distance3D, double hUt, double hBs) const
Computes the pathloss between a and b.
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.
virtual double GetLossNlosv(double distance2D, double distance3D, double hUt, double hBs) const
Computes the pathloss between a and b considering that the line of sight is obstructed by a vehicle...
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