INET Framework for OMNeT++/OMNEST
inet::physicallayer::SUIPathLoss Class Reference

This class implements the empirical Stanford University Interim path loss model. More...

#include <SUIPathLoss.h>

Inheritance diagram for inet::physicallayer::SUIPathLoss:
inet::physicallayer::PathLossBase inet::physicallayer::IPathLoss inet::physicallayer::IPrintableObject

Public Member Functions

 SUIPathLoss ()
 
virtual std::ostream & printToStream (std::ostream &stream, int level) const override
 Prints this object to the provided output stream. More...
 
virtual double computePathLoss (mps propagationSpeed, Hz frequency, m distance) const override
 Returns the loss factor as a function of propagation speed, carrier frequency and distance. More...
 
virtual m computeRange (mps propagationSpeed, Hz frequency, double loss) const override
 Returns the range for the given loss factor. More...
 
- Public Member Functions inherited from inet::physicallayer::PathLossBase
virtual double computePathLoss (const ITransmission *transmission, const IArrival *arrival) const override
 Returns the loss factor for the provided transmission and arrival. More...
 
- Public Member Functions inherited from inet::physicallayer::IPrintableObject
virtual ~IPrintableObject ()
 
virtual std::string getInfoStringRepresentation () const
 
virtual std::string getDetailStringRepresentation () const
 
virtual std::string getDebugStringRepresentation () const
 
virtual std::string getTraceStringRepresentation () const
 
virtual std::string getCompleteStringRepresentation () const
 

Protected Member Functions

virtual void initialize (int stage) override
 

Protected Attributes

m ht
 Transmitter antenna high. More...
 
m hr
 Receiver antenna high. More...
 
double a
 
double b
 
double c
 
double d
 
double s
 

Additional Inherited Members

- Public Types inherited from inet::physicallayer::IPrintableObject
enum  PrintLevel {
  PRINT_LEVEL_TRACE, PRINT_LEVEL_DEBUG, PRINT_LEVEL_DETAIL, PRINT_LEVEL_INFO,
  PRINT_LEVEL_COMPLETE = INT_MIN
}
 

Detailed Description

This class implements the empirical Stanford University Interim path loss model.

Author
Konrad Polys, Krzysztof Grochla

Constructor & Destructor Documentation

inet::physicallayer::SUIPathLoss::SUIPathLoss ( )
25  :
26  ht(m(0)),
27  hr(m(0)),
28  a(0),
29  b(0),
30  c(0),
31  d(0),
32  s(0)
33 {
34 }
double a
Definition: SUIPathLoss.h:41
double b
Definition: SUIPathLoss.h:41
double d
Definition: SUIPathLoss.h:41
m hr
Receiver antenna high.
Definition: SUIPathLoss.h:39
double s
Definition: SUIPathLoss.h:41
m ht
Transmitter antenna high.
Definition: SUIPathLoss.h:36
double c
Definition: SUIPathLoss.h:41
value< double, units::m > m
Definition: Units.h:1047

Member Function Documentation

double inet::physicallayer::SUIPathLoss::computePathLoss ( mps  propagationSpeed,
Hz  frequency,
m  distance 
) const
overridevirtual

Returns the loss factor as a function of propagation speed, carrier frequency and distance.

The value is in the range [0, 1] where 1 means no loss at all and 0 means all power is lost.

Implements inet::physicallayer::PathLossBase.

83 {
84  m R = distance;
85  m R0 = m(100.0);
86  m lambda = propagationSpeed / frequency;
87  double L = 0.0; // [dBm]
88  double f = frequency.get() / 1000000000.0; // [GHz]
89  double alpha = 0.0;
90  double gamma = a - b * ht.get() + c / ht.get();
91  double Xf = 6 * log10(f / 2);
92  double Xh = -d *log10(hr.get() / 2);
93  m R0p = R0 * pow(10.0, -((Xf + Xh) / (10 * gamma)));
94  if (R > R0p) {
95  alpha = 20 * log10(unit(4 * M_PI * R0p / lambda).get());
96  L = alpha + 10 * gamma * log10(unit(R / R0).get()) + Xf + Xh + s;
97  }
98  else {
99  L = 20 * log10(unit(4 * M_PI * R / lambda).get()) + s;
100  }
101  return math::dB2fraction(-L);
102 }
double a
Definition: SUIPathLoss.h:41
double b
Definition: SUIPathLoss.h:41
double d
Definition: SUIPathLoss.h:41
m hr
Receiver antenna high.
Definition: SUIPathLoss.h:39
const value_type & get() const
Definition: Units.h:89
double dB2fraction(double dB)
Converts a dB value to fraction.
Definition: INETMath.h:166
#define M_PI
Definition: PlotFigure.cc:27
pow< internal::none, 0 > unit
Definition: Units.h:60
double s
Definition: SUIPathLoss.h:41
m ht
Transmitter antenna high.
Definition: SUIPathLoss.h:36
double c
Definition: SUIPathLoss.h:41
const value< double, units::unit > alpha(7.2973525376e-3)
const value< double, compose< units::J, compose< pow< units::mol,-1 >, pow< units::kg,-1 > > > > R(8.314472)
value< double, units::m > m
Definition: Units.h:1047
virtual m inet::physicallayer::SUIPathLoss::computeRange ( mps  propagationSpeed,
Hz  frequency,
double  loss 
) const
inlineoverridevirtual

Returns the range for the given loss factor.

The value is in the range [0, +infinity) or NaN if unspecified.

Implements inet::physicallayer::IPathLoss.

50 { return m(NaN); }
#define NaN
Definition: INETMath.h:103
value< double, units::m > m
Definition: Units.h:1047
void inet::physicallayer::SUIPathLoss::initialize ( int  stage)
overrideprotectedvirtual

Terrain A - Highest path loss. Dense populated urban area. Terrain B - Intermediate path loss. Suburban area. Terrain C - Minimum path loss. Flat areas or rural with light vegetation.

37 {
38  if (stage == INITSTAGE_LOCAL) {
39  ht = m(par("transmitterAntennaHeight"));
40  hr = m(par("receiverAntennaHeight"));
46  const char *terrain = par("terrain").stringValue();
47  if (!strcmp(terrain, "TerrainA")) {
48  a = 4.6;
49  b = 0.0075;
50  c = 12.6;
51  d = 10.8;
52  s = 10.6;
53  }
54  else if (!strcmp(terrain, "TerrainB")) {
55  a = 4.0;
56  b = 0.0065;
57  c = 17.1;
58  d = 10.8;
59  s = 9.6;
60  }
61  else if (!strcmp(terrain, "TerrainC")) {
62  a = 3.6;
63  b = 0.0050;
64  c = 20.0;
65  d = 20.0;
66  s = 8.2;
67  }
68  else
69  throw cRuntimeError("Unknown terrain");
70  }
71 }
double a
Definition: SUIPathLoss.h:41
double b
Definition: SUIPathLoss.h:41
double d
Definition: SUIPathLoss.h:41
m hr
Receiver antenna high.
Definition: SUIPathLoss.h:39
Local initializations.
Definition: InitStages.h:35
double s
Definition: SUIPathLoss.h:41
m ht
Transmitter antenna high.
Definition: SUIPathLoss.h:36
double c
Definition: SUIPathLoss.h:41
value< double, units::m > m
Definition: Units.h:1047
std::ostream & inet::physicallayer::SUIPathLoss::printToStream ( std::ostream &  stream,
int  level 
) const
overridevirtual

Prints this object to the provided output stream.

Function calls to operator<< with pointers or references either const or not are all forwarded to this function.

Reimplemented from inet::physicallayer::IPrintableObject.

74 {
75  stream << "SUIPathLoss";
76  if (level <= PRINT_LEVEL_TRACE)
77  stream << ", ht = " << ht
78  << ", hr = " << hr;
79  return stream;
80 }
m hr
Receiver antenna high.
Definition: SUIPathLoss.h:39
m ht
Transmitter antenna high.
Definition: SUIPathLoss.h:36

Member Data Documentation

double inet::physicallayer::SUIPathLoss::a
protected

Referenced by computePathLoss(), and initialize().

double inet::physicallayer::SUIPathLoss::b
protected
double inet::physicallayer::SUIPathLoss::c
protected

Referenced by computePathLoss(), and initialize().

double inet::physicallayer::SUIPathLoss::d
protected

Referenced by computePathLoss(), and initialize().

m inet::physicallayer::SUIPathLoss::hr
protected

Receiver antenna high.

Referenced by computePathLoss(), initialize(), and printToStream().

m inet::physicallayer::SUIPathLoss::ht
protected

Transmitter antenna high.

Referenced by computePathLoss(), initialize(), and printToStream().

double inet::physicallayer::SUIPathLoss::s
protected

Referenced by computePathLoss().


The documentation for this class was generated from the following files: