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

#include <NarrowbandReceiverBase.h>

Inheritance diagram for inet::physicallayer::NarrowbandReceiverBase:
inet::physicallayer::SnirReceiverBase inet::physicallayer::ReceiverBase inet::physicallayer::IReceiver inet::IPrintableObject 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

 NarrowbandReceiverBase ()
 
virtual std::ostream & printToStream (std::ostream &stream, int level, int evFlags=0) const override
 Prints this object to the provided output stream. More...
 
virtual const IListeningcreateListening (const IRadio *radio, const simtime_t startTime, const simtime_t endTime, const Coord &startPosition, const Coord &endPosition) const override
 Returns a description of how the receiver is listening on the medium. 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 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 IModulationgetModulation () const
 
virtual void setModulation (const IModulation *modulation)
 
virtual Hz getCenterFrequency () const
 
virtual void setCenterFrequency (Hz centerFrequency)
 
virtual Hz getBandwidth () const
 
virtual void setBandwidth (Hz bandwidth)
 
- Public Member Functions inherited from inet::physicallayer::SnirReceiverBase
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 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 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 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 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

const IModulationmodulation
 
Hz centerFrequency
 
Hz bandwidth
 
- Protected Attributes inherited from inet::physicallayer::SnirReceiverBase
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) }
 
- Protected Types inherited from inet::physicallayer::SnirReceiverBase
enum  SnirThresholdMode { SnirThresholdMode::STM_UNDEFINED = -1, SnirThresholdMode::STM_MIN, SnirThresholdMode::STM_MEAN }
 

Constructor & Destructor Documentation

◆ NarrowbandReceiverBase()

inet::physicallayer::NarrowbandReceiverBase::NarrowbandReceiverBase ( )
23  :
24  SnirReceiverBase(),
25  modulation(nullptr),
27  bandwidth(Hz(NaN))
28 {
29 }

Member Function Documentation

◆ computeIsReceptionPossible() [1/2]

bool inet::physicallayer::NarrowbandReceiverBase::computeIsReceptionPossible ( const IListening listening,
const IReception reception,
IRadioSignal::SignalPart  part 
) const
overridevirtual

Returns whether the reception of the provided part is possible or not.

For example, it might check if the reception power is above sensitivity.

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

Reimplemented from inet::physicallayer::ReceiverBase.

Reimplemented in inet::physicallayer::FlatReceiverBase, inet::physicallayer::ApskDimensionalReceiver, inet::physicallayer::ApskScalarReceiver, inet::physicallayer::Ieee80211DimensionalReceiver, and inet::physicallayer::Ieee80211ScalarReceiver.

64 {
65  const BandListening *bandListening = check_and_cast<const BandListening *>(listening);
66  const NarrowbandReceptionBase *narrowbandReception = check_and_cast<const NarrowbandReceptionBase *>(reception);
67  if (bandListening->getCenterFrequency() != narrowbandReception->getCenterFrequency() || bandListening->getBandwidth() < narrowbandReception->getBandwidth()) {
68  EV_DEBUG << "Computing whether reception is possible: listening and reception bands are different -> reception is impossible" << endl;
69  return false;
70  }
71  else
72  return true;
73 }

◆ computeIsReceptionPossible() [2/2]

bool inet::physicallayer::NarrowbandReceiverBase::computeIsReceptionPossible ( const IListening listening,
const ITransmission transmission 
) const
overridevirtual

Returns whether the reception of the provided transmission is possible or not independently of the reception conditions.

For example, it might check if the carrier frequency and the modulation of the transmission matches how the receiver is listening on the medium.

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

Reimplemented from inet::physicallayer::ReceiverBase.

Reimplemented in inet::physicallayer::ApskDimensionalReceiver, inet::physicallayer::ApskScalarReceiver, inet::physicallayer::Ieee80211DimensionalReceiver, and inet::physicallayer::Ieee80211ScalarReceiver.

56 {
57  // TODO check if modulation matches?
58  const NarrowbandTransmissionBase *narrowbandTransmission = check_and_cast<const NarrowbandTransmissionBase *>(transmission);
59  return centerFrequency == narrowbandTransmission->getCenterFrequency() && bandwidth >= narrowbandTransmission->getBandwidth();
60 }

Referenced by inet::physicallayer::ApskDimensionalReceiver::computeIsReceptionPossible(), inet::physicallayer::Ieee80211ScalarReceiver::computeIsReceptionPossible(), inet::physicallayer::ApskScalarReceiver::computeIsReceptionPossible(), and inet::physicallayer::FlatReceiverBase::computeIsReceptionPossible().

◆ computeReceptionDecision()

const IReceptionDecision * inet::physicallayer::NarrowbandReceiverBase::computeReceptionDecision ( const IListening listening,
const IReception reception,
IRadioSignal::SignalPart  part,
const IInterference interference,
const ISnir snir 
) const
overridevirtual

Returns the reception decision for the transmission part that specifies whether the reception is possible, attempted, and successful.

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

Reimplemented from inet::physicallayer::ReceiverBase.

76 {
77  const BandListening *bandListening = check_and_cast<const BandListening *>(listening);
78  const NarrowbandReceptionBase *narrowbandReception = check_and_cast<const NarrowbandReceptionBase *>(reception);
79  if (bandListening->getCenterFrequency() == narrowbandReception->getCenterFrequency() && bandListening->getBandwidth() >= narrowbandReception->getBandwidth())
80  return SnirReceiverBase::computeReceptionDecision(listening, reception, part, interference, snir);
81  else
82  return new ReceptionDecision(reception, part, false, false, false);
83 }

◆ createListening()

const IListening * inet::physicallayer::NarrowbandReceiverBase::createListening ( const IRadio radio,
const simtime_t  startTime,
const simtime_t  endTime,
const Coord startPosition,
const Coord endPosition 
) const
overridevirtual

Returns a description of how the receiver is listening on the medium.

Implements inet::physicallayer::IReceiver.

51 {
52  return new BandListening(radio, startTime, endTime, startPosition, endPosition, centerFrequency, bandwidth);
53 }

◆ getBandwidth()

virtual Hz inet::physicallayer::NarrowbandReceiverBase::getBandwidth ( ) const
inlinevirtual
47 { return bandwidth; }

◆ getCenterFrequency()

virtual Hz inet::physicallayer::NarrowbandReceiverBase::getCenterFrequency ( ) const
inlinevirtual
44 { return centerFrequency; }

◆ getModulation()

virtual const IModulation* inet::physicallayer::NarrowbandReceiverBase::getModulation ( ) const
inlinevirtual
41 { return modulation; }

◆ initialize()

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

◆ printToStream()

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

◆ setBandwidth()

virtual void inet::physicallayer::NarrowbandReceiverBase::setBandwidth ( Hz  bandwidth)
inlinevirtual

◆ setCenterFrequency()

virtual void inet::physicallayer::NarrowbandReceiverBase::setCenterFrequency ( Hz  centerFrequency)
inlinevirtual

◆ setModulation()

virtual void inet::physicallayer::NarrowbandReceiverBase::setModulation ( const IModulation modulation)
inlinevirtual

Member Data Documentation

◆ bandwidth

Hz inet::physicallayer::NarrowbandReceiverBase::bandwidth
protected

◆ centerFrequency

Hz inet::physicallayer::NarrowbandReceiverBase::centerFrequency
protected

◆ modulation

const IModulation* inet::physicallayer::NarrowbandReceiverBase::modulation
protected

Referenced by initialize(), and printToStream().


The documentation for this class was generated from the following files:
inet::physicallayer::NarrowbandReceiverBase::centerFrequency
Hz centerFrequency
Definition: NarrowbandReceiverBase.h:23
inet::units::units::Hz
pow< s, -1 > Hz
Definition: Units.h:935
inet::physicallayer::NarrowbandReceiverBase::bandwidth
Hz bandwidth
Definition: NarrowbandReceiverBase.h:24
inet::physicallayer::NarrowbandReceiverBase::modulation
const IModulation * modulation
Definition: NarrowbandReceiverBase.h:22
inet::physicallayer::ReceiverBase::computeReceptionDecision
virtual const IReceptionDecision * computeReceptionDecision(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 poss...
Definition: ReceiverBase.cc:64
inet::printFieldToString
std::string printFieldToString(const IPrintableObject *object, int level, int evFlags=0)
Definition: IPrintableObject.h:98
EV_FIELD
#define EV_FIELD(...)
Definition: INETDefs.h:112
inet::physicallayer::SnirReceiverBase::initialize
virtual void initialize(int stage) override
Definition: SnirReceiverBase.cc:17
inet::physicallayer::SnirReceiverBase::printToStream
virtual std::ostream & printToStream(std::ostream &stream, int level, int evFlags=0) const override
Prints this object to the provided output stream.
Definition: SnirReceiverBase.cc:32
NaN
#define NaN
Definition: INETMath.h:91
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::ApskModulationBase::findModulation
const static ApskModulationBase * findModulation(const char *name)
Definition: ApskModulationBase.cc:38
inet::evFlags
int evFlags
Definition: INETDefs.cc:12