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::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, int evFlags=0) 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::IPrintableObject
virtual ~IPrintableObject ()
 
virtual std::string printToString () const
 
virtual std::string printToString (int level, int evFlags=0) const
 
virtual std::string getInfoStringRepresentation (int evFlags=0) const
 
virtual std::string getDetailStringRepresentation (int evFlags=0) const
 
virtual std::string getDebugStringRepresentation (int evFlags=0) const
 
virtual std::string getTraceStringRepresentation (int evFlags=0) const
 
virtual std::string getCompleteStringRepresentation (int evFlags=0) 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::IPrintableObject
enum  PrintLevel {
  PRINT_LEVEL_TRACE, PRINT_LEVEL_DEBUG, PRINT_LEVEL_DETAIL, PRINT_LEVEL_INFO,
  PRINT_LEVEL_COMPLETE = INT_MIN
}
 
enum  PrintFlag { PRINT_FLAG_FORMATTED = (1 << 0), PRINT_FLAG_MULTILINE = (1 << 1) }
 

Detailed Description

This class implements the deterministic free space path loss model.

Author
Oliver Graute

Constructor & Destructor Documentation

◆ FreeSpacePathLoss()

inet::physicallayer::FreeSpacePathLoss::FreeSpacePathLoss ( )

Member Function Documentation

◆ computeFreeSpacePathLoss()

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

Referenced by printToStream().

◆ computePathLoss()

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::NakagamiFading, inet::physicallayer::RayleighFading, and inet::physicallayer::LogNormalShadowing.

◆ computeRange()

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.

◆ initialize()

void inet::physicallayer::FreeSpacePathLoss::initialize ( int  stage)
overrideprotectedvirtual

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

47 {
48  // factor = waveLength ^ 2 / (16 * PI ^ 2 * systemLoss * distance ^ alpha)
49  return distance.get() == 0.0 ? 1.0 : (waveLength * waveLength).get() / (16 * M_PI * M_PI * systemLoss * pow(distance.get(), alpha));
50 }
51 

◆ printToStream()

std::ostream & inet::physicallayer::FreeSpacePathLoss::printToStream ( std::ostream &  stream,
int  level,
int  evFlags = 0 
) const
overridevirtual

Prints this object to the provided output stream.

Reimplemented from inet::IPrintableObject.

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

53 {
54  m waveLength = propagationSpeed / frequency;
55  return computeFreeSpacePathLoss(waveLength, distance, alpha, systemLoss);
56 }
57 
58 m FreeSpacePathLoss::computeRange(mps propagationSpeed, Hz frequency, double loss) const
59 {
60  // distance = (waveLength ^ 2 / (16 * PI ^ 2 * systemLoss * loss)) ^ (1 / alpha)

Member Data Documentation

◆ alpha

double inet::physicallayer::FreeSpacePathLoss::alpha
protected

Referenced by initialize(), and printToStream().

◆ systemLoss

double inet::physicallayer::FreeSpacePathLoss::systemLoss
protected

Referenced by initialize(), and printToStream().


The documentation for this class was generated from the following files:
inet::units::units::Hz
pow< s, -1 > Hz
Definition: Units.h:935
inet::units::units::mps
compose< m, pow< s, -1 > > mps
Definition: Units.h:1151
inet::physicallayer::FreeSpacePathLoss::computeFreeSpacePathLoss
virtual double computeFreeSpacePathLoss(m waveLength, m distance, double alpha, double systemLoss) const
Definition: FreeSpacePathLoss.cc:62
inet::physicallayer::FreeSpacePathLoss::systemLoss
double systemLoss
Definition: FreeSpacePathLoss.h:57
inet::physicallayer::FreeSpacePathLoss::computeRange
virtual m computeRange(mps propagationSpeed, Hz frequency, double loss) const override
Returns the range for the given loss factor.
Definition: FreeSpacePathLoss.cc:74
inet::physicallayer::FreeSpacePathLoss::alpha
double alpha
Definition: FreeSpacePathLoss.h:56
inet::units::values::m
value< double, units::m > m
Definition: Units.h:1233
M_PI
#define M_PI
Definition: INETMath.h:52