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

Implements the IdealAnalogModel model, see the NED file for details. More...

#include <IdealAnalogModel.h>

Inheritance diagram for inet::physicallayer::IdealAnalogModel:
inet::physicallayer::IAnalogModel 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 const IReceptioncomputeReception (const IRadio *radio, const ITransmission *transmission, const IArrival *arrival) const override
 Returns the reception for the provided transmission at the receiver. More...
 
virtual const INoisecomputeNoise (const IListening *listening, const IInterference *interference) const override
 Returns the total noise summing up all the interfering receptions and noises. More...
 
virtual const ISNIRcomputeSNIR (const IReception *reception, const INoise *noise) const override
 Returns the signal to noise and interference ratio. 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
 

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

Implements the IdealAnalogModel model, see the NED file for details.

Member Function Documentation

const INoise * inet::physicallayer::IdealAnalogModel::computeNoise ( const IListening listening,
const IInterference interference 
) const
overridevirtual

Returns the total noise summing up all the interfering receptions and noises.

This function never returns nullptr.

Implements inet::physicallayer::IAnalogModel.

65 {
66  bool isInterfering = false;
67  for (auto interferingReception : *interference->getInterferingReceptions())
68  if (check_and_cast<const IdealReception *>(interferingReception)->getPower() >= IdealReception::POWER_INTERFERING)
69  isInterfering = true;
70  return new IdealNoise(listening->getStartTime(), listening->getEndTime(), isInterfering);
71 }
const IReception * inet::physicallayer::IdealAnalogModel::computeReception ( const IRadio receiver,
const ITransmission transmission,
const IArrival arrival 
) const
overridevirtual

Returns the reception for the provided transmission at the receiver.

The result incorporates all modeled attenuation. This function never returns nullptr.

Implements inet::physicallayer::IAnalogModel.

38 {
39  const IRadioMedium *radioMedium = receiverRadio->getMedium();
40  const IdealTransmission *idealTransmission = check_and_cast<const IdealTransmission *>(transmission);
41  const simtime_t receptionStartTime = arrival->getStartTime();
42  const simtime_t receptionEndTime = arrival->getEndTime();
43  const Coord receptionStartPosition = arrival->getStartPosition();
44  const Coord receptionEndPosition = arrival->getEndPosition();
45  const EulerAngles receptionStartOrientation = arrival->getStartOrientation();
46  const EulerAngles receptionEndOrientation = arrival->getEndOrientation();
47  m distance = m(transmission->getStartPosition().distance(receptionStartPosition));
48  double obstacleLoss = radioMedium->getObstacleLoss() ? radioMedium->getObstacleLoss()->computeObstacleLoss(Hz(NaN), transmission->getStartPosition(), receptionStartPosition) : 1;
49  ASSERT(obstacleLoss == 0 || obstacleLoss == 1);
51  if (obstacleLoss == 0)
53  else if (distance <= idealTransmission->getCommunicationRange())
55  else if (distance <= idealTransmission->getInterferenceRange())
57  else if (distance <= idealTransmission->getDetectionRange())
59  else
61  return new IdealReception(receiverRadio, transmission, receptionStartTime, receptionEndTime, receptionStartPosition, receptionEndPosition, receptionStartOrientation, receptionEndOrientation, power);
62 }
pow< s,-1 > Hz
Definition: Units.h:766
Power
Definition: IdealReception.h:35
#define NaN
Definition: INETMath.h:103
value< double, units::m > m
Definition: Units.h:1047
const ISNIR * inet::physicallayer::IdealAnalogModel::computeSNIR ( const IReception reception,
const INoise noise 
) const
overridevirtual

Returns the signal to noise and interference ratio.

This function never returns nullptr.

Implements inet::physicallayer::IAnalogModel.

74 {
75  return new IdealSNIR(reception, noise);
76 }
std::ostream & inet::physicallayer::IdealAnalogModel::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.

33 {
34  return stream << "IdealAnalogModel";
35 }

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