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

#include <ReceiverBase.h>

Inheritance diagram for inet::physicallayer::ReceiverBase:
inet::physicallayer::IReceiver inet::physicallayer::IPrintableObject inet::physicallayer::IdealReceiver inet::physicallayer::Ieee802154UWBIRReceiver inet::physicallayer::SNIRReceiverBase inet::physicallayer::Ieee80211IdealReceiver inet::physicallayer::APSKLayeredReceiver inet::physicallayer::Ieee80211LayeredOFDMReceiver inet::physicallayer::NarrowbandReceiverBase inet::physicallayer::FlatReceiverBase inet::physicallayer::APSKDimensionalReceiver inet::physicallayer::APSKScalarReceiver inet::physicallayer::Ieee80211ReceiverBase inet::physicallayer::Ieee802154NarrowbandScalarReceiver inet::physicallayer::Ieee80211DimensionalReceiver inet::physicallayer::Ieee80211ScalarReceiver

Public Member Functions

 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 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...
 
virtual const ReceptionIndicationcomputeReceptionIndication (const ISNIR *snir) const override
 Returns the reception indication (control info) that is sent up to the MAC. 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...
 
virtual bool computeIsReceptionSuccessful (const IListening *listening, const IReception *reception, IRadioSignal::SignalPart part, const IInterference *interference, const ISNIR *snir) const =0
 Returns whether the reception of the provided part is actually successful or failed by the receiver. More...
 
- Public Member Functions inherited from inet::physicallayer::IPrintableObject
virtual ~IPrintableObject ()
 
virtual std::ostream & printToStream (std::ostream &stream, int level) const
 Prints this object to the provided output stream. More...
 
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 int numInitStages () const override
 

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::ReceiverBase::ReceiverBase ( )
inline
35 { }

Member Function Documentation

bool inet::physicallayer::ReceiverBase::computeIsReceptionAttempted ( const IListening listening,
const IReception reception,
IRadioSignal::SignalPart  part,
const IInterference interference 
) const
overridevirtual

Returns whether the reception of the provided part is actually attempted or ignored by the receiver.

For example, it might check that the radio is not already receiving another signal.

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::Ieee802154UWBIRReceiver.

Referenced by computeReceptionDecision().

39 {
40  if (!computeIsReceptionPossible(listening, reception, part))
41  return false;
42  else if (simTime() == reception->getStartTime(part)) {
43  // TODO: isn't there a better way for this optimization? see also in RadioMedium::isReceptionAttempted
44  auto transmission = reception->getReceiver()->getReceptionInProgress();
45  return transmission == nullptr || transmission == reception->getTransmission();
46  }
47  else {
48  // determining whether the reception is attempted or not for the future
49  auto radio = reception->getReceiver();
50  auto radioMedium = radio->getMedium();
51  auto interferingReceptions = interference->getInterferingReceptions();
52  for (auto interferingReception : *interferingReceptions) {
53  auto isPrecedingReception = interferingReception->getStartTime() < reception->getStartTime() ||
54  (interferingReception->getStartTime() == reception->getStartTime() &&
55  interferingReception->getTransmission()->getId() < reception->getTransmission()->getId());
56  if (isPrecedingReception) {
57  auto interferingTransmission = interferingReception->getTransmission();
58  if (interferingReception->getStartTime() <= simTime()) {
59  if (radio->getReceptionInProgress() == interferingTransmission)
60  return false;
61  }
62  else if (radioMedium->isReceptionAttempted(radio, interferingTransmission, part))
63  return false;
64  }
65  }
66  return true;
67  }
68 }
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 re...
Definition: ReceiverBase.cc:28
bool inet::physicallayer::ReceiverBase::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.

Implements inet::physicallayer::IReceiver.

Reimplemented in inet::physicallayer::NarrowbandReceiverBase, inet::physicallayer::Ieee80211DimensionalReceiver, and inet::physicallayer::Ieee80211ScalarReceiver.

Referenced by computeIsReceptionAttempted(), and computeReceptionDecision().

29 {
30  return true;
31 }
bool inet::physicallayer::ReceiverBase::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.

Implements inet::physicallayer::IReceiver.

Reimplemented in inet::physicallayer::Ieee80211LayeredOFDMReceiver, inet::physicallayer::APSKLayeredReceiver, inet::physicallayer::NarrowbandReceiverBase, inet::physicallayer::IdealReceiver, and inet::physicallayer::FlatReceiverBase.

34 {
35  return true;
36 }
const IReceptionDecision * inet::physicallayer::ReceiverBase::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.

Implements inet::physicallayer::IReceiver.

Reimplemented in inet::physicallayer::Ieee802154UWBIRReceiver, and inet::physicallayer::NarrowbandReceiverBase.

Referenced by inet::physicallayer::NarrowbandReceiverBase::computeReceptionDecision().

81 {
82  auto isReceptionPossible = computeIsReceptionPossible(listening, reception, part);
83  auto isReceptionAttempted = isReceptionPossible && computeIsReceptionAttempted(listening, reception, part, interference);
84  auto isReceptionSuccessful = isReceptionAttempted && computeIsReceptionSuccessful(listening, reception, part, interference, snir);
85  return new ReceptionDecision(reception, part, isReceptionPossible, isReceptionAttempted, isReceptionSuccessful);
86 }
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 re...
Definition: ReceiverBase.cc:28
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...
Definition: ReceiverBase.cc:38
virtual bool computeIsReceptionSuccessful(const IListening *listening, const IReception *reception, IRadioSignal::SignalPart part, const IInterference *interference, const ISNIR *snir) const =0
Returns whether the reception of the provided part is actually successful or failed by the receiver...
const ReceptionIndication * inet::physicallayer::ReceiverBase::computeReceptionIndication ( const ISNIR snir) const
overridevirtual

Returns the reception indication (control info) that is sent up to the MAC.

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::Ieee802154UWBIRReceiver, inet::physicallayer::SNIRReceiverBase, inet::physicallayer::FlatReceiverBase, inet::physicallayer::Ieee80211ReceiverBase, inet::physicallayer::IdealReceiver, and inet::physicallayer::Ieee80211IdealReceiver.

Referenced by inet::physicallayer::SNIRReceiverBase::computeReceptionIndication(), and computeReceptionResult().

71 {
73 }
virtual ReceptionIndication * createReceptionIndication() const
Returns an empty reception indication (control info).
Definition: ReceiverBase.cc:75
const IReceptionResult * inet::physicallayer::ReceiverBase::computeReceptionResult ( const IListening listening,
const IReception reception,
const IInterference interference,
const ISNIR snir 
) const
overridevirtual

Returns the complete result of the reception process for the provided reception.

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::Ieee80211LayeredOFDMReceiver, and inet::physicallayer::APSKLayeredReceiver.

89 {
90  auto radio = reception->getReceiver();
91  auto radioMedium = radio->getMedium();
92  auto transmission = reception->getTransmission();
93  auto indication = computeReceptionIndication(snir);
94  // TODO: add all cached decisions?
95  auto decisions = new std::vector<const IReceptionDecision *>();
96  decisions->push_back(radioMedium->getReceptionDecision(radio, listening, transmission, IRadioSignal::SIGNAL_PART_WHOLE));
97  return new ReceptionResult(reception, decisions, indication);
98 }
virtual const ReceptionIndication * computeReceptionIndication(const ISNIR *snir) const override
Returns the reception indication (control info) that is sent up to the MAC.
Definition: ReceiverBase.cc:70
ReceptionIndication * inet::physicallayer::ReceiverBase::createReceptionIndication ( ) const
virtual

Returns an empty reception indication (control info).

This function called from computeReceptionIndication().

Reimplemented in inet::physicallayer::Ieee80211ReceiverBase.

Referenced by computeReceptionIndication().

76 {
77  return new ReceptionIndication();
78 }
virtual W inet::physicallayer::ReceiverBase::getMinInterferencePower ( ) const
inlineoverridevirtual

Returns the minimum interference power below which receptions are to be ignored while computing the interference.

Returns a value in the range [0, +infinity) or NaN if unspecified.

Implements inet::physicallayer::IReceiver.

Reimplemented in inet::physicallayer::Ieee802154NarrowbandScalarReceiver.

37 { return W(NaN); }
compose< J, pow< s,-1 > > W
Definition: Units.h:770
#define NaN
Definition: INETMath.h:103
virtual W inet::physicallayer::ReceiverBase::getMinReceptionPower ( ) const
inlineoverridevirtual

Returns the minimum reception power below which successful reception is definitely not possible.

Returns a value in the range [0, +infinity) or NaN if unspecified.

Implements inet::physicallayer::IReceiver.

Reimplemented in inet::physicallayer::FlatReceiverBase.

38 { return W(NaN); }
compose< J, pow< s,-1 > > W
Definition: Units.h:770
#define NaN
Definition: INETMath.h:103
virtual int inet::physicallayer::ReceiverBase::numInitStages ( ) const
inlineoverrideprotectedvirtual
32 { return NUM_INIT_STAGES; }
The number of initialization stages.
Definition: InitStages.h:116

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