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 
34 {
35 public:
40  static TypeId GetTypeId (void);
41 
46 
50  virtual ~ThreeGppPropagationLossModel () override;
51 
58 
64 
69  void SetFrequency (double f);
70 
75  double GetFrequency (void) const;
76 
83 
91 
92 private:
102  virtual double DoCalcRxPower (double txPowerDbm,
104  Ptr<MobilityModel> b) const override;
105 
106  virtual int64_t DoAssignStreams (int64_t stream) override;
107 
117  double GetLoss (Ptr<ChannelCondition> cond, double distance2D, double distance3D, double hUt, double hBs) const;
118 
128  virtual double GetLossLos (double distance2D, double distance3D, double hUt, double hBs) const = 0;
129 
139  virtual double GetLossNlos (double distance2D, double distance3D, double hUt, double hBs) const = 0;
140 
151  virtual double GetLossNlosv (double distance2D, double distance3D, double hUt, double hBs) const;
152 
161  virtual std::pair<double, double> GetUtAndBsHeights (double za, double zb) const;
162 
175 
184 
191 
203  static uint32_t GetKey (Ptr<MobilityModel> a, Ptr<MobilityModel> b);
204 
216 
217 protected:
218  virtual void DoDispose () override;
219 
226  static double Calculate2dDistance (Vector a, Vector b);
227 
229  double m_frequency;
232 
235  {
236  double m_shadowing;
238  Vector m_distance;
239  };
240 
241  mutable std::unordered_map<uint32_t, ShadowingMapItem> m_shadowingMap;
242 };
243 
251 {
252 public:
257  static TypeId GetTypeId (void);
258 
263 
267  virtual ~ThreeGppRmaPropagationLossModel () override;
268 
275 
283 
284 private:
294  virtual double GetLossLos (double distance2D, double distance3D, double hUt, double hBs) const override;
295 
305  virtual double GetLossNlos (double distance2D, double distance3D, double hUt, double hBs) const override;
306 
315 
321  virtual double GetShadowingCorrelationDistance (ChannelCondition::LosConditionValue cond) const override;
322 
331  static double Pl1 (double frequency, double distance3D, double h, double w);
332 
340  static double GetBpDistance (double frequency, double hA, double hB);
341 
342  double m_h;
343  double m_w;
344 };
345 
353 {
354 public:
359  static TypeId GetTypeId (void);
360 
365 
369  virtual ~ThreeGppUmaPropagationLossModel () override;
370 
377 
385 
386 private:
387  virtual int64_t DoAssignStreams (int64_t stream) override;
388 
398  double GetLossLos (double distance2D, double distance3D, double hUt, double hBs) const override;
399 
409  double GetLossNlos (double distance2D, double distance3D, double hUt, double hBs) const override;
410 
419 
425  virtual double GetShadowingCorrelationDistance (ChannelCondition::LosConditionValue cond) const override;
426 
434  double GetBpDistance (double hUt, double hBs, double distance2D) const;
435 
437 };
438 
446 {
447 public:
452  static TypeId GetTypeId (void);
453 
458 
463 
470 
478 
479 private:
489  double GetLossLos (double distance2D, double distance3D, double hUt, double hBs) const override;
490 
500  double GetLossNlos (double distance2D, double distance3D, double hUt, double hBs) const override;
501 
510 
516  virtual double GetShadowingCorrelationDistance (ChannelCondition::LosConditionValue cond) const override;
517 
525  double GetBpDistance (double hUt, double hBs, double distance2D) const;
526 
533  std::pair<double, double> GetUtAndBsHeights (double za, double zb) const override;
534 };
535 
543 {
544 public:
549  static TypeId GetTypeId (void);
550 
555 
559  virtual ~ThreeGppIndoorOfficePropagationLossModel () override;
560 
567 
575 
576 private:
586  double GetLossLos (double distance2D, double distance3D, double hUt, double hBs) const override;
587 
597  double GetLossNlos (double distance2D, double distance3D, double hUt, double hBs) const override;
598 
607 
613  virtual double GetShadowingCorrelationDistance (ChannelCondition::LosConditionValue cond) const override;
614 };
615 
616 } // namespace ns3
617 
618 #endif /* THREE_GPP_PROPAGATION_LOSS_MODEL_H */
double f(double x, void *params)
Definition: 80211b.c:70
LosConditionValue
Possible values for Line-of-Sight condition.
Models the propagation loss through a transmission medium.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
Implements the pathloss model defined in 3GPP TR 38.901, Table 7.4.1-1 for the Indoor Office scenario...
ThreeGppIndoorOfficePropagationLossModel(const ThreeGppIndoorOfficePropagationLossModel &)=delete
Copy constructor.
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.
ThreeGppIndoorOfficePropagationLossModel & operator=(const ThreeGppIndoorOfficePropagationLossModel &)=delete
Copy constructor.
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 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.
Base class for the 3GPP propagation models.
double GetLoss(Ptr< ChannelCondition > cond, double distance2D, double distance3D, double hUt, double hBs) const
Computes the pathloss between a and b.
Ptr< ChannelConditionModel > GetChannelConditionModel(void) const
Returns the associated channel condition model.
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.
double GetShadowing(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const
Retrieves the shadowing value by looking at m_shadowingMap.
static double Calculate2dDistance(Vector a, Vector b)
Computes the 2D distance between two 3D vectors.
void SetChannelConditionModel(Ptr< ChannelConditionModel > model)
Set the channel condition model used to determine the channel state (e.g., the LOS/NLOS condition)
static TypeId GetTypeId(void)
Get the type ID.
std::unordered_map< uint32_t, ShadowingMapItem > m_shadowingMap
map to store the shadowing values
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 int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
ThreeGppPropagationLossModel & operator=(const ThreeGppPropagationLossModel &)=delete
Copy constructor.
virtual double GetShadowingCorrelationDistance(ChannelCondition::LosConditionValue cond) const =0
Returns the shadow fading correlation distance.
ThreeGppPropagationLossModel(const ThreeGppPropagationLossModel &)=delete
Copy constructor.
Ptr< NormalRandomVariable > m_normRandomVariable
normal random variable
Ptr< ChannelConditionModel > m_channelConditionModel
pointer to the channel condition model
virtual ~ThreeGppPropagationLossModel() override
Destructor.
double GetFrequency(void) const
Return the current central frequency.
void SetFrequency(double f)
Set the central frequency of the model.
virtual void DoDispose() override
Destructor implementation.
static uint32_t GetKey(Ptr< MobilityModel > a, Ptr< MobilityModel > b)
Returns an unique key for the channel between a and b.
virtual double GetShadowingStd(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const =0
Returns the shadow fading standard deviation.
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.
virtual std::pair< double, double > GetUtAndBsHeights(double za, double zb) const
Determines hUT and hBS.
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....
static Vector GetVectorDifference(Ptr< MobilityModel > a, Ptr< MobilityModel > b)
Get the difference between the node position.
Implements the pathloss model defined in 3GPP TR 38.901, Table 7.4.1-1 for the RMa scenario.
virtual double GetShadowingStd(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading standard deviation.
static double Pl1(double frequency, double distance3D, double h, double w)
Computes the PL1 formula for the RMa scenario.
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.
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.
virtual ~ThreeGppRmaPropagationLossModel() override
Destructor.
ThreeGppRmaPropagationLossModel & operator=(const ThreeGppRmaPropagationLossModel &)=delete
Copy constructor.
ThreeGppRmaPropagationLossModel(const ThreeGppRmaPropagationLossModel &)=delete
Copy constructor.
virtual double GetShadowingCorrelationDistance(ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading correlation distance.
double m_h
average building height in meters
static double GetBpDistance(double frequency, double hA, double hB)
Computes the breakpoint distance for the RMa scenario.
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.
ThreeGppUmaPropagationLossModel & operator=(const ThreeGppUmaPropagationLossModel &)=delete
Copy constructor.
double GetBpDistance(double hUt, double hBs, double distance2D) const
Computes the breakpoint distance.
virtual ~ThreeGppUmaPropagationLossModel() override
Destructor.
virtual int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
ThreeGppUmaPropagationLossModel(const ThreeGppUmaPropagationLossModel &)=delete
Copy constructor.
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.
Ptr< UniformRandomVariable > m_uniformVar
a uniform random variable used for the computation of the breakpoint distance
virtual double GetShadowingStd(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading standard deviation.
virtual double GetShadowingCorrelationDistance(ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading correlation distance.
Implements the pathloss model defined in 3GPP TR 38.901, Table 7.4.1-1 for the UMi-Street Canyon scen...
std::pair< double, double > GetUtAndBsHeights(double za, double zb) const override
Determines hUT and hBS.
ThreeGppUmiStreetCanyonPropagationLossModel & operator=(const ThreeGppUmiStreetCanyonPropagationLossModel &)=delete
Copy constructor.
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.
double GetBpDistance(double hUt, double hBs, double distance2D) const
Computes the breakpoint distance.
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.
ThreeGppUmiStreetCanyonPropagationLossModel(const ThreeGppUmiStreetCanyonPropagationLossModel &)=delete
Copy constructor.
virtual double GetShadowingCorrelationDistance(ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading correlation distance.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ChannelCondition::LosConditionValue m_condition
the LOS/NLOS condition