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

This class implements the deterministic free space path loss model. More...

#include <FreeSpacePathLoss.h>

Inheritance diagram for inet::physicallayer::FreeSpacePathLoss:
inet::physicallayer::PathLossBase inet::physicallayer::IPathLoss inet::physicallayer::IPrintableObject inet::physicallayer::LogNormalShadowing inet::physicallayer::NakagamiFading inet::physicallayer::RayleighFading inet::physicallayer::RicianFading inet::physicallayer::TwoRayGroundReflection

Public Member Functions

 FreeSpacePathLoss ()
 
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
 
virtual double computeFreeSpacePathLoss (m waveLength, m distance, double alpha, double systemLoss) const
 

Protected Attributes

double alpha
 
double systemLoss
 

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 deterministic free space path loss model.

Author
Oliver Graute

Constructor & Destructor Documentation

inet::physicallayer::FreeSpacePathLoss::FreeSpacePathLoss ( )
26  :
27  alpha(2.0),
28  systemLoss(1.0)
29 {
30 }
double systemLoss
Definition: FreeSpacePathLoss.h:36
double alpha
Definition: FreeSpacePathLoss.h:35

Member Function Documentation

double inet::physicallayer::FreeSpacePathLoss::computeFreeSpacePathLoss ( m  waveLength,
m  distance,
double  alpha,
double  systemLoss 
) const
protectedvirtual

Referenced by inet::physicallayer::RayleighFading::computePathLoss(), inet::physicallayer::LogNormalShadowing::computePathLoss(), inet::physicallayer::NakagamiFading::computePathLoss(), inet::physicallayer::TwoRayGroundReflection::computePathLoss(), inet::physicallayer::RicianFading::computePathLoss(), and computePathLoss().

50 {
51  // factor = waveLength ^ 2 / (16 * PI ^ 2 * systemLoss * distance ^ alpha)
52  return distance.get() == 0.0 ? 1.0 : (waveLength * waveLength).get() / (16 * M_PI * M_PI * systemLoss * pow(distance.get(), alpha));
53 }
double systemLoss
Definition: FreeSpacePathLoss.h:36
double alpha
Definition: FreeSpacePathLoss.h:35
#define M_PI
Definition: PlotFigure.cc:27
double inet::physicallayer::FreeSpacePathLoss::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.

Reimplemented in inet::physicallayer::RicianFading, inet::physicallayer::LogNormalShadowing, inet::physicallayer::NakagamiFading, and inet::physicallayer::RayleighFading.

56 {
57  m waveLength = propagationSpeed / frequency;
58  return computeFreeSpacePathLoss(waveLength, distance, alpha, systemLoss);
59 }
virtual double computeFreeSpacePathLoss(m waveLength, m distance, double alpha, double systemLoss) const
Definition: FreeSpacePathLoss.cc:49
double systemLoss
Definition: FreeSpacePathLoss.h:36
double alpha
Definition: FreeSpacePathLoss.h:35
value< double, units::m > m
Definition: Units.h:1047
m inet::physicallayer::FreeSpacePathLoss::computeRange ( mps  propagationSpeed,
Hz  frequency,
double  loss 
) const
overridevirtual

Returns the range for the given loss factor.

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

Implements inet::physicallayer::IPathLoss.

62 {
63  // distance = (waveLength ^ 2 / (16 * PI ^ 2 * systemLoss * loss)) ^ (1 / alpha)
64  m waveLength = propagationSpeed / frequency;
65  return m(pow((waveLength * waveLength).get() / (16.0 * M_PI * M_PI * systemLoss * loss), 1.0 / alpha));
66 }
double systemLoss
Definition: FreeSpacePathLoss.h:36
double alpha
Definition: FreeSpacePathLoss.h:35
#define M_PI
Definition: PlotFigure.cc:27
value< double, units::m > m
Definition: Units.h:1047
void inet::physicallayer::FreeSpacePathLoss::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented in inet::physicallayer::TwoRayGroundReflection, inet::physicallayer::RicianFading, inet::physicallayer::LogNormalShadowing, and inet::physicallayer::NakagamiFading.

Referenced by inet::physicallayer::LogNormalShadowing::initialize(), inet::physicallayer::NakagamiFading::initialize(), and inet::physicallayer::RicianFading::initialize().

33 {
34  if (stage == INITSTAGE_LOCAL) {
35  alpha = par("alpha");
36  systemLoss = math::dB2fraction(par("systemLoss"));
37  }
38 }
double systemLoss
Definition: FreeSpacePathLoss.h:36
double alpha
Definition: FreeSpacePathLoss.h:35
double dB2fraction(double dB)
Converts a dB value to fraction.
Definition: INETMath.h:166
Local initializations.
Definition: InitStages.h:35
std::ostream & inet::physicallayer::FreeSpacePathLoss::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.

Reimplemented in inet::physicallayer::RicianFading, inet::physicallayer::TwoRayGroundReflection, inet::physicallayer::LogNormalShadowing, inet::physicallayer::NakagamiFading, and inet::physicallayer::RayleighFading.

41 {
42  stream << "FreeSpacePathLoss";
43  if (level <= PRINT_LEVEL_TRACE)
44  stream << ", alpha = " << alpha
45  << ", systemLoss = " << systemLoss;
46  return stream;
47 }
double systemLoss
Definition: FreeSpacePathLoss.h:36
double alpha
Definition: FreeSpacePathLoss.h:35

Member Data Documentation


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