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

#include <SnirReceiverBase.h>

Inheritance diagram for inet::physicallayer::SnirReceiverBase:
inet::physicallayer::ReceiverBase inet::physicallayer::IReceiver inet::IPrintableObject inet::physicallayer::ApskLayeredReceiver inet::physicallayer::Ieee80211LayeredOfdmReceiver inet::physicallayer::NarrowbandReceiverBase inet::physicallayer::FlatReceiverBase inet::physicallayer::ApskDimensionalReceiver inet::physicallayer::ApskScalarReceiver inet::physicallayer::Ieee80211ReceiverBase inet::physicallayer::Ieee802154NarrowbandDimensionalReceiver inet::physicallayer::Ieee802154NarrowbandScalarReceiver inet::physicallayer::Ieee80211DimensionalReceiver inet::physicallayer::Ieee80211ScalarReceiver

Public Member Functions

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 getSNIRThreshold () const
 
virtual bool computeIsReceptionSuccessful (const IListening *listening, const IReception *reception, IRadioSignal::SignalPart part, const IInterference *interference, const ISnir *snir) const override
 Returns whether the reception of the provided part is actually successful or failed by the receiver. More...
 
- Public Member Functions inherited from inet::physicallayer::ReceiverBase
 ReceiverBase ()
 
virtual W getMinInterferencePower () const override
 Returns the minimum interference power below which receptions are to be ignored while computing the interference. More...
 
virtual W getMinReceptionPower () const override
 Returns the minimum reception power below which successful reception is definitely not possible. More...
 
virtual bool computeIsReceptionPossible (const IListening *listening, const ITransmission *transmission) const override
 Returns whether the reception of the provided transmission is possible or not independently of the reception conditions. More...
 
virtual bool computeIsReceptionPossible (const IListening *listening, const IReception *reception, IRadioSignal::SignalPart part) const override
 Returns whether the reception of the provided part is possible or not. More...
 
virtual bool computeIsReceptionAttempted (const IListening *listening, const IReception *reception, IRadioSignal::SignalPart part, const IInterference *interference) const override
 Returns whether the reception of the provided part is actually attempted or ignored by the receiver. More...
 
virtual const IReceptionDecisioncomputeReceptionDecision (const IListening *listening, const IReception *reception, IRadioSignal::SignalPart part, const IInterference *interference, const ISnir *snir) const override
 Returns the reception decision for the transmission part that specifies whether the reception is possible, attempted, and successful. More...
 
virtual const IReceptionResultcomputeReceptionResult (const IListening *listening, const IReception *reception, const IInterference *interference, const ISnir *snir, const std::vector< const IReceptionDecision * > *decisions) const override
 Returns the complete result of the reception process for the provided reception. More...
 
- Public Member Functions inherited from inet::physicallayer::IReceiver
virtual const IListeningcreateListening (const IRadio *radio, const simtime_t startTime, const simtime_t endTime, const Coord &startPosition, const Coord &endPosition) const =0
 Returns a description of how the receiver is listening on the medium. More...
 
virtual const IListeningDecisioncomputeListeningDecision (const IListening *listening, const IInterference *interference) const =0
 Returns the result of the listening process specifying the reception state of the receiver. 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 Types

enum  SnirThresholdMode { SnirThresholdMode::STM_UNDEFINED = -1, SnirThresholdMode::STM_MIN, SnirThresholdMode::STM_MEAN }
 

Protected Member Functions

virtual void initialize (int stage) override
 
- Protected Member Functions inherited from inet::physicallayer::ReceiverBase
virtual int numInitStages () const override
 
virtual W computeSignalPower (const IListening *listening, const ISnir *snir, const IInterference *interference) const
 
virtual PacketcomputeReceivedPacket (const ISnir *snir, bool isReceptionSuccessful) const
 

Protected Attributes

double snirThreshold = NaN
 
SnirThresholdMode snirThresholdMode = SnirThresholdMode::STM_UNDEFINED
 

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) }
 

Member Enumeration Documentation

◆ SnirThresholdMode

Enumerator
STM_UNDEFINED 
STM_MIN 
STM_MEAN 
21  {
22  STM_UNDEFINED = -1,
23  STM_MIN,
24  STM_MEAN
25  };

Member Function Documentation

◆ computeIsReceptionSuccessful()

bool inet::physicallayer::SnirReceiverBase::computeIsReceptionSuccessful ( const IListening listening,
const IReception reception,
IRadioSignal::SignalPart  part,
const IInterference interference,
const ISnir snir 
) const
overridevirtual

Returns whether the reception of the provided part is actually successful or failed by the receiver.

For example, it might compute the error rate and draw a random number to make the decision.

This function may be called before the reception actually starts at the receiver, thus it must be purely functional and support optimistic parallel computation.

Implements inet::physicallayer::IReceiver.

Reimplemented in inet::physicallayer::FlatReceiverBase.

40 {
42  double minSnir = snir->getMin();
43  ASSERT(0.0 <= minSnir);
44  return minSnir > snirThreshold;
45  }
47  double meanSnir = snir->getMean();
48  ASSERT(0.0 <= meanSnir);
49  return meanSnir > snirThreshold;
50  }
51  else
52  throw cRuntimeError("Unknown SNIR threshold mode: '%d'", snirThresholdMode);
53 }

Referenced by inet::physicallayer::FlatReceiverBase::computeIsReceptionSuccessful().

◆ getSNIRThreshold()

virtual double inet::physicallayer::SnirReceiverBase::getSNIRThreshold ( ) const
inlinevirtual
36 { return snirThreshold; }

◆ initialize()

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

Reimplemented in inet::physicallayer::Ieee80211LayeredOfdmReceiver, inet::physicallayer::ApskLayeredReceiver, inet::physicallayer::NarrowbandReceiverBase, inet::physicallayer::Ieee80211ReceiverBase, inet::physicallayer::FlatReceiverBase, inet::physicallayer::Ieee802154NarrowbandDimensionalReceiver, and inet::physicallayer::Ieee802154NarrowbandScalarReceiver.

18 {
19  ReceiverBase::initialize(stage);
20  if (stage == INITSTAGE_LOCAL) {
21  snirThreshold = math::dB2fraction(par("snirThreshold"));
22  const char *snirThresholdModeString = par("snirThresholdMode");
23  if (!strcmp("min", snirThresholdModeString))
25  else if (!strcmp("mean", snirThresholdModeString))
27  else
28  throw cRuntimeError("Unknown SNIR threshold mode: '%s'", snirThresholdModeString);
29  }
30 }

Referenced by inet::physicallayer::NarrowbandReceiverBase::initialize(), inet::physicallayer::ApskLayeredReceiver::initialize(), and inet::physicallayer::Ieee80211LayeredOfdmReceiver::initialize().

◆ printToStream()

Member Data Documentation

◆ snirThreshold

double inet::physicallayer::SnirReceiverBase::snirThreshold = NaN
protected

◆ snirThresholdMode

SnirThresholdMode inet::physicallayer::SnirReceiverBase::snirThresholdMode = SnirThresholdMode::STM_UNDEFINED
protected

The documentation for this class was generated from the following files:
inet::physicallayer::SnirReceiverBase::SnirThresholdMode::STM_MIN
@ STM_MIN
EV_FIELD
#define EV_FIELD(...)
Definition: INETDefs.h:112
inet::math::dB2fraction
double dB2fraction(double dB)
Converts a dB value to fraction.
Definition: INETMath.h:153
inet::physicallayer::SnirReceiverBase::snirThresholdMode
SnirThresholdMode snirThresholdMode
Definition: SnirReceiverBase.h:28
inet::INITSTAGE_LOCAL
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
inet::IPrintableObject::PRINT_LEVEL_TRACE
@ PRINT_LEVEL_TRACE
Definition: IPrintableObject.h:22
inet::physicallayer::SnirReceiverBase::snirThreshold
double snirThreshold
Definition: SnirReceiverBase.h:27
inet::physicallayer::SnirReceiverBase::SnirThresholdMode::STM_MEAN
@ STM_MEAN