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::physicallayer::IPrintableObject inet::physicallayer::FlatReceiverBase inet::physicallayer::APSKDimensionalReceiver inet::physicallayer::APSKScalarReceiver inet::physicallayer::Ieee80211ReceiverBase inet::physicallayer::Ieee802154NarrowbandScalarReceiver inet::physicallayer::Ieee80211DimensionalReceiver inet::physicallayer::Ieee80211ScalarReceiver

Public Member Functions

 NarrowbandReceiverBase ()
 
virtual std::ostream & printToStream (std::ostream &stream, int level) 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 getCarrierFrequency () const
 
virtual void setCarrierFrequency (Hz carrierFrequency)
 
virtual Hz getBandwidth () const
 
virtual void setBandwidth (Hz bandwidth)
 
- Public Member Functions inherited from inet::physicallayer::SNIRReceiverBase
 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 override
 Returns the complete result of the reception process for the provided reception. More...
 
virtual ReceptionIndicationcreateReceptionIndication () const
 Returns an empty reception indication (control info). 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::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::SNIRReceiverBase
virtual const ReceptionIndicationcomputeReceptionIndication (const ISNIR *snir) const override
 Returns the physical properties of the reception including noise and signal related measures, error probabilities, actual error counts, etc. More...
 
- Protected Member Functions inherited from inet::physicallayer::ReceiverBase
virtual int numInitStages () const override
 

Protected Attributes

const IModulationmodulation
 
Hz carrierFrequency
 
Hz bandwidth
 
- Protected Attributes inherited from inet::physicallayer::SNIRReceiverBase
double snirThreshold
 

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
}
 

Constructor & Destructor Documentation

inet::physicallayer::NarrowbandReceiverBase::NarrowbandReceiverBase ( )
32  :
34  modulation(nullptr),
36  bandwidth(Hz(NaN))
37 {
38 }
pow< s,-1 > Hz
Definition: Units.h:766
const IModulation * modulation
Definition: NarrowbandReceiverBase.h:32
Hz bandwidth
Definition: NarrowbandReceiverBase.h:34
#define NaN
Definition: INETMath.h:103
SNIRReceiverBase()
Definition: SNIRReceiverBase.cc:26
Hz carrierFrequency
Definition: NarrowbandReceiverBase.h:33

Member Function Documentation

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::Ieee80211DimensionalReceiver, and inet::physicallayer::Ieee80211ScalarReceiver.

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

65 {
66  // TODO: check if modulation matches?
67  const NarrowbandTransmissionBase *narrowbandTransmission = check_and_cast<const NarrowbandTransmissionBase *>(transmission);
68  return carrierFrequency == narrowbandTransmission->getCarrierFrequency() && bandwidth == narrowbandTransmission->getBandwidth();
69 }
Hz bandwidth
Definition: NarrowbandReceiverBase.h:34
Hz carrierFrequency
Definition: NarrowbandReceiverBase.h:33
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.

73 {
74  const BandListening *bandListening = check_and_cast<const BandListening *>(listening);
75  const NarrowbandReceptionBase *narrowbandReception = check_and_cast<const NarrowbandReceptionBase *>(reception);
76  if (bandListening->getCarrierFrequency() != narrowbandReception->getCarrierFrequency() || bandListening->getBandwidth() != narrowbandReception->getBandwidth()) {
77  EV_DEBUG << "Computing whether reception is possible: listening and reception bands are different -> reception is impossible" << endl;
78  return false;
79  }
80  else
81  return true;
82 }
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.

85 {
86  const BandListening *bandListening = check_and_cast<const BandListening *>(listening);
87  const NarrowbandReceptionBase *narrowbandReception = check_and_cast<const NarrowbandReceptionBase *>(reception);
88  if (bandListening->getCarrierFrequency() == narrowbandReception->getCarrierFrequency() && bandListening->getBandwidth() == narrowbandReception->getBandwidth())
89  return SNIRReceiverBase::computeReceptionDecision(listening, reception, part, interference, snir);
90  else
91  return new ReceptionDecision(reception, part, false, false, false);
92 }
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:80
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.

60 {
61  return new BandListening(radio, startTime, endTime, startPosition, endPosition, carrierFrequency, bandwidth);
62 }
Hz bandwidth
Definition: NarrowbandReceiverBase.h:34
Hz carrierFrequency
Definition: NarrowbandReceiverBase.h:33
virtual Hz inet::physicallayer::NarrowbandReceiverBase::getBandwidth ( ) const
inlinevirtual
57 { return bandwidth; }
Hz bandwidth
Definition: NarrowbandReceiverBase.h:34
virtual Hz inet::physicallayer::NarrowbandReceiverBase::getCarrierFrequency ( ) const
inlinevirtual
54 { return carrierFrequency; }
Hz carrierFrequency
Definition: NarrowbandReceiverBase.h:33
virtual const IModulation* inet::physicallayer::NarrowbandReceiverBase::getModulation ( ) const
inlinevirtual
51 { return modulation; }
const IModulation * modulation
Definition: NarrowbandReceiverBase.h:32
void inet::physicallayer::NarrowbandReceiverBase::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::physicallayer::SNIRReceiverBase.

Reimplemented in inet::physicallayer::Ieee80211ReceiverBase, inet::physicallayer::FlatReceiverBase, and inet::physicallayer::Ieee802154NarrowbandScalarReceiver.

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

41 {
43  if (stage == INITSTAGE_LOCAL) {
45  carrierFrequency = Hz(par("carrierFrequency"));
46  bandwidth = Hz(par("bandwidth"));
47  }
48 }
pow< s,-1 > Hz
Definition: Units.h:766
static const APSKModulationBase * findModulation(const char *name)
Definition: APSKModulationBase.cc:47
const IModulation * modulation
Definition: NarrowbandReceiverBase.h:32
Hz bandwidth
Definition: NarrowbandReceiverBase.h:34
virtual void initialize(int stage) override
Definition: SNIRReceiverBase.cc:32
Local initializations.
Definition: InitStages.h:35
Hz carrierFrequency
Definition: NarrowbandReceiverBase.h:33
std::ostream & inet::physicallayer::NarrowbandReceiverBase::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::SNIRReceiverBase.

Reimplemented in inet::physicallayer::FlatReceiverBase, inet::physicallayer::Ieee80211ReceiverBase, inet::physicallayer::Ieee802154NarrowbandScalarReceiver, inet::physicallayer::Ieee80211DimensionalReceiver, inet::physicallayer::Ieee80211ScalarReceiver, inet::physicallayer::APSKDimensionalReceiver, and inet::physicallayer::APSKScalarReceiver.

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

51 {
52  if (level <= PRINT_LEVEL_TRACE)
53  stream << ", modulation = " << printObjectToString(modulation, level + 1)
54  << ", carrierFrequency = " << carrierFrequency
55  << ", bandwidth = " << bandwidth;
56  return SNIRReceiverBase::printToStream(stream, level);
57 }
std::string printObjectToString(const IPrintableObject *object, int level)
Definition: IPrintableObject.h:73
const IModulation * modulation
Definition: NarrowbandReceiverBase.h:32
Hz bandwidth
Definition: NarrowbandReceiverBase.h:34
virtual std::ostream & printToStream(std::ostream &stream, int level) const override
Prints this object to the provided output stream.
Definition: SNIRReceiverBase.cc:39
Hz carrierFrequency
Definition: NarrowbandReceiverBase.h:33
virtual void inet::physicallayer::NarrowbandReceiverBase::setBandwidth ( Hz  bandwidth)
inlinevirtual

Referenced by inet::physicallayer::NarrowbandRadioBase::setBandwidth().

58 { this->bandwidth = bandwidth; }
Hz bandwidth
Definition: NarrowbandReceiverBase.h:34
virtual void inet::physicallayer::NarrowbandReceiverBase::setCarrierFrequency ( Hz  carrierFrequency)
inlinevirtual
virtual void inet::physicallayer::NarrowbandReceiverBase::setModulation ( const IModulation modulation)
inlinevirtual

Referenced by inet::physicallayer::NarrowbandRadioBase::setModulation().

52 { this->modulation = modulation; }
const IModulation * modulation
Definition: NarrowbandReceiverBase.h:32

Member Data Documentation

Hz inet::physicallayer::NarrowbandReceiverBase::bandwidth
protected
Hz inet::physicallayer::NarrowbandReceiverBase::carrierFrequency
protected
const IModulation* inet::physicallayer::NarrowbandReceiverBase::modulation
protected

Referenced by initialize(), and printToStream().


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