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

This class implements the two ray ground radio path loss model. More...

#include <TwoRayGroundReflection.h>

Inheritance diagram for inet::physicallayer::TwoRayGroundReflection:
inet::physicallayer::FreeSpacePathLoss inet::physicallayer::PathLossBase inet::physicallayer::IPathLoss inet::physicallayer::IPrintableObject

Public Member Functions

virtual std::ostream & printToStream (std::ostream &stream, int level) const override
 Prints this object to the provided output stream. More...
 
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::FreeSpacePathLoss
 FreeSpacePathLoss ()
 
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::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 Member Functions inherited from inet::physicallayer::FreeSpacePathLoss
virtual double computeFreeSpacePathLoss (m waveLength, m distance, double alpha, double systemLoss) const
 

Protected Attributes

const IPhysicalEnvironmentphysicalEnvironment = nullptr
 
- Protected Attributes inherited from inet::physicallayer::FreeSpacePathLoss
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 two ray ground radio path loss model.

Member Function Documentation

double inet::physicallayer::TwoRayGroundReflection::computePathLoss ( const ITransmission transmission,
const IArrival arrival 
) const
overridevirtual

Returns the loss factor for the provided transmission and arrival.

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

At the cross over distance two ray model and free space model predict the same power

                   4 * pi * hr * ht

crossOverDistance = ------------—— waveLength

Two-ray ground reflection model.

    (ht ^ 2 * hr ^ 2)

loss = ------------— d ^ 4 * L

To be consistent with the free space equation, L is added here. The original equation in Rappaport's book assumes L = 1.

Reimplemented from inet::physicallayer::PathLossBase.

45 {
46  auto radioMedium = transmission->getTransmitter()->getMedium();
47  auto narrowbandSignalAnalogModel = check_and_cast<const INarrowbandSignal *>(transmission->getAnalogModel());
48  auto transmitterPosition = transmission->getStartPosition();
49  auto recepiverPosition = arrival->getStartPosition();
50  mps propagationSpeed = radioMedium->getPropagation()->getPropagationSpeed();
51  Hz carrierFrequency = narrowbandSignalAnalogModel->getCarrierFrequency();
52  m distance = m(recepiverPosition.distance(transmitterPosition));
53  m transmitterAltitude = m(transmitterPosition.z - physicalEnvironment->getGround()->getElevation(transmitterPosition));
54  m receiverAltitude = m(recepiverPosition.z - physicalEnvironment->getGround()->getElevation(recepiverPosition));
55  m waveLength = propagationSpeed / carrierFrequency;
63  m crossOverDistance = (4 * M_PI * transmitterAltitude * receiverAltitude) / waveLength;
64  if (distance < crossOverDistance)
65  return computeFreeSpacePathLoss(waveLength, distance, alpha, systemLoss);
66  else
77  return unit((transmitterAltitude * transmitterAltitude * receiverAltitude * receiverAltitude) / (distance * distance * distance * distance * systemLoss)).get();
78 }
virtual double computeFreeSpacePathLoss(m waveLength, m distance, double alpha, double systemLoss) const
Definition: FreeSpacePathLoss.cc:49
virtual double getElevation(const Coord &position) const =0
Returns the elevation above a fixed reference point.
pow< s,-1 > Hz
Definition: Units.h:766
double systemLoss
Definition: FreeSpacePathLoss.h:36
double alpha
Definition: FreeSpacePathLoss.h:35
const IPhysicalEnvironment * physicalEnvironment
Definition: TwoRayGroundReflection.h:36
#define M_PI
Definition: PlotFigure.cc:27
pow< internal::none, 0 > unit
Definition: Units.h:60
compose< m, pow< s,-1 > > mps
Definition: Units.h:968
value< double, units::m > m
Definition: Units.h:1047
void inet::physicallayer::TwoRayGroundReflection::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::physicallayer::FreeSpacePathLoss.

29 {
30  if (stage == INITSTAGE_LOCAL) {
31  physicalEnvironment = getModuleFromPar<IPhysicalEnvironment>(par("physicalEnvironmentModule"), this, true);
32  }
33 }
const IPhysicalEnvironment * physicalEnvironment
Definition: TwoRayGroundReflection.h:36
Local initializations.
Definition: InitStages.h:35
std::ostream & inet::physicallayer::TwoRayGroundReflection::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::FreeSpacePathLoss.

36 {
37  stream << "TwoRayGroundReflection";
38  if (level <= PRINT_LEVEL_TRACE)
39  stream << ", alpha = " << alpha
40  << ", systemLoss = " << systemLoss;
41  return stream;
42 }
double systemLoss
Definition: FreeSpacePathLoss.h:36
double alpha
Definition: FreeSpacePathLoss.h:35

Member Data Documentation

const IPhysicalEnvironment* inet::physicallayer::TwoRayGroundReflection::physicalEnvironment = nullptr
protected

Referenced by computePathLoss(), and initialize().


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