|
INET Framework for OMNeT++/OMNEST
|
#include <ApskLayeredReceiver.h>
|
| | ApskLayeredReceiver () |
| |
| 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 IDecoder * | getDecoder () const |
| |
| virtual const IDemodulator * | getModulator () const |
| |
| virtual const IPulseFilter * | getPulseFilter () const |
| |
| virtual const IAnalogDigitalConverter * | getAnalogDigitalConverter () const |
| |
| 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 IListening * | createListening (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 const IListeningDecision * | computeListeningDecision (const IListening *listening, const IInterference *interference) const override |
| | Returns the result of the listening process specifying the reception state of the receiver. More...
|
| |
| virtual const IReceptionResult * | computeReceptionResult (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...
|
| |
| 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...
|
| |
| | 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 | 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 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 possible, attempted, and successful. More...
|
| |
| 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 |
| |
|
| virtual void | initialize (int stage) override |
| |
| virtual const IReceptionAnalogModel * | createAnalogModel (const LayeredTransmission *transmission, const ISnir *snir) const |
| |
| virtual const IReceptionSampleModel * | createSampleModel (const LayeredTransmission *transmission, const ISnir *snir, const IReceptionAnalogModel *analogModel) const |
| |
| virtual const IReceptionSymbolModel * | createSymbolModel (const LayeredTransmission *transmission, const ISnir *snir, const IReceptionSampleModel *sampleModel) const |
| |
| virtual const IReceptionBitModel * | createBitModel (const LayeredTransmission *transmission, const ISnir *snir, const IReceptionSymbolModel *symbolModel) const |
| |
| virtual const IReceptionPacketModel * | createPacketModel (const LayeredTransmission *transmission, const ISnir *snir, const IReceptionBitModel *bitModel) const |
| |
| virtual int | numInitStages () const override |
| |
| virtual W | computeSignalPower (const IListening *listening, const ISnir *snir, const IInterference *interference) const |
| |
| virtual Packet * | computeReceivedPacket (const ISnir *snir, bool isReceptionSuccessful) const |
| |
◆ LevelOfDetail
| Enumerator |
|---|
| PACKET_DOMAIN | |
| BIT_DOMAIN | |
| SYMBOL_DOMAIN | |
| SAMPLE_DOMAIN | |
◆ ApskLayeredReceiver()
| inet::physicallayer::ApskLayeredReceiver::ApskLayeredReceiver |
( |
| ) |
|
◆ computeIsReceptionPossible()
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.
192 const BandListening *bandListening = check_and_cast<const BandListening *>(listening);
193 const LayeredReception *scalarReception = check_and_cast<const LayeredReception *>(reception);
195 const ScalarReceptionSignalAnalogModel *analogModel = check_and_cast<const ScalarReceptionSignalAnalogModel *>(scalarReception->getAnalogModel());
196 if (bandListening->getCenterFrequency() != analogModel->getCenterFrequency() || bandListening->getBandwidth() != analogModel->getBandwidth()) {
197 EV_DEBUG <<
"Computing reception possible: listening and reception bands are different -> reception is impossible" << endl;
201 const INarrowbandSignal *narrowbandSignalAnalogModel = check_and_cast<const INarrowbandSignal *>(scalarReception->getAnalogModel());
202 W minReceptionPower = narrowbandSignalAnalogModel->computeMinPower(reception->getStartTime(), reception->getEndTime());
203 bool isReceptionPossible = minReceptionPower >=
sensitivity;
204 EV_DEBUG <<
"Computing reception possible" <<
EV_FIELD(minReceptionPower) <<
EV_FIELD(
sensitivity) <<
" -> reception is " << (isReceptionPossible ?
"possible" :
"impossible") << endl;
205 return isReceptionPossible;
◆ computeListeningDecision()
Returns the result of the listening process specifying the reception state of the receiver.
This function must be purely functional and support optimistic parallel computation.
Implements inet::physicallayer::IReceiver.
176 const IRadio *receiver = listening->getReceiver();
177 const IRadioMedium *radioMedium = receiver->getMedium();
178 const IAnalogModel *analogModel = radioMedium->getAnalogModel();
179 const INoise *noise = analogModel->computeNoise(listening, interference);
180 const NarrowbandNoiseBase *flatNoise = check_and_cast<const NarrowbandNoiseBase *>(noise);
181 W maxPower = flatNoise->computeMaxPower(listening->getStartTime(), listening->getEndTime());
184 EV_DEBUG <<
"Computing listening possible: maximum power = " << maxPower <<
", energy detection = " <<
energyDetection <<
" -> listening is " << (isListeningPossible ?
"possible" :
"impossible") << endl;
185 return new ListeningDecision(listening, isListeningPossible);
◆ computeReceptionResult()
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.
Reimplemented from inet::physicallayer::ReceiverBase.
147 const LayeredTransmission *transmission =
dynamic_cast<const LayeredTransmission *
>(reception->getTransmission());
148 const IReceptionAnalogModel *analogModel =
createAnalogModel(transmission, snir);
149 const IReceptionSampleModel *sampleModel =
createSampleModel(transmission, snir, analogModel);
150 const IReceptionSymbolModel *symbolModel =
createSymbolModel(transmission, snir, sampleModel);
151 const IReceptionBitModel *bitModel =
createBitModel(transmission, snir, symbolModel);
152 const IReceptionPacketModel *packetModel =
createPacketModel(transmission, snir, bitModel);
153 auto packet =
const_cast<Packet *
>(packetModel->getPacket());
154 auto errorRateInd = packet->addTagIfAbsent<ErrorRateInd>();
155 if (symbolModel !=
nullptr)
156 errorRateInd->setSymbolErrorRate(symbolModel->getSymbolErrorRate());
157 if (bitModel !=
nullptr)
158 errorRateInd->setBitErrorRate(bitModel->getBitErrorRate());
159 if (packetModel !=
nullptr)
160 errorRateInd->setPacketErrorRate(packetModel->getPacketErrorRate());
161 auto snirInd = packet->addTagIfAbsent<SnirInd>();
162 snirInd->setMinimumSnir(snir->getMin());
163 snirInd->setMaximumSnir(snir->getMax());
164 snirInd->setAverageSnir(snir->getMean());
165 return new LayeredReceptionResult(reception, decisions, packetModel, bitModel, symbolModel, sampleModel, analogModel);
◆ createAnalogModel()
◆ createBitModel()
◆ createListening()
| const IListening * inet::physicallayer::ApskLayeredReceiver::createListening |
( |
const IRadio * |
radio, |
|
|
const simtime_t |
startTime, |
|
|
const simtime_t |
endTime, |
|
|
const Coord & |
startPosition, |
|
|
const Coord & |
endPosition |
|
) |
| const |
|
overridevirtual |
◆ createPacketModel()
◆ createSampleModel()
◆ createSymbolModel()
◆ getAnalogDigitalConverter()
| virtual const IAnalogDigitalConverter* inet::physicallayer::ApskLayeredReceiver::getAnalogDigitalConverter |
( |
| ) |
const |
|
inlinevirtual |
◆ getDecoder()
| virtual const IDecoder* inet::physicallayer::ApskLayeredReceiver::getDecoder |
( |
| ) |
const |
|
inlinevirtual |
◆ getModulator()
| virtual const IDemodulator* inet::physicallayer::ApskLayeredReceiver::getModulator |
( |
| ) |
const |
|
inlinevirtual |
◆ getPulseFilter()
| virtual const IPulseFilter* inet::physicallayer::ApskLayeredReceiver::getPulseFilter |
( |
| ) |
const |
|
inlinevirtual |
◆ initialize()
| void inet::physicallayer::ApskLayeredReceiver::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
Reimplemented from inet::physicallayer::SnirReceiverBase.
50 errorModel =
dynamic_cast<ILayeredErrorModel *
>(getSubmodule(
"errorModel"));
51 decoder =
dynamic_cast<IDecoder *
>(getSubmodule(
"decoder"));
52 demodulator =
dynamic_cast<IDemodulator *
>(getSubmodule(
"demodulator"));
53 pulseFilter =
dynamic_cast<IPulseFilter *
>(getSubmodule(
"pulseFilter"));
60 const char *levelOfDetailStr = par(
"levelOfDetail");
61 if (strcmp(
"packet", levelOfDetailStr) == 0)
63 else if (strcmp(
"bit", levelOfDetailStr) == 0)
65 else if (strcmp(
"symbol", levelOfDetailStr) == 0)
67 else if (strcmp(
"sample", levelOfDetailStr) == 0)
70 throw cRuntimeError(
"Unknown level of detail='%s'", levelOfDetailStr);
72 throw cRuntimeError(
"Decoder not configured");
74 throw cRuntimeError(
"Demodulator not configured");
76 throw cRuntimeError(
"Pulse filter not configured");
◆ printToStream()
| std::ostream & inet::physicallayer::ApskLayeredReceiver::printToStream |
( |
std::ostream & |
stream, |
|
|
int |
level, |
|
|
int |
evFlags = 0 |
|
) |
| const |
|
overridevirtual |
◆ analogDigitalConverter
◆ bandwidth
| Hz inet::physicallayer::ApskLayeredReceiver::bandwidth |
|
protected |
◆ centerFrequency
| Hz inet::physicallayer::ApskLayeredReceiver::centerFrequency |
|
protected |
◆ decoder
| const IDecoder* inet::physicallayer::ApskLayeredReceiver::decoder |
|
protected |
◆ demodulator
| const IDemodulator* inet::physicallayer::ApskLayeredReceiver::demodulator |
|
protected |
◆ energyDetection
| W inet::physicallayer::ApskLayeredReceiver::energyDetection |
|
protected |
◆ errorModel
◆ levelOfDetail
| LevelOfDetail inet::physicallayer::ApskLayeredReceiver::levelOfDetail |
|
protected |
◆ pulseFilter
| const IPulseFilter* inet::physicallayer::ApskLayeredReceiver::pulseFilter |
|
protected |
◆ sensitivity
| W inet::physicallayer::ApskLayeredReceiver::sensitivity |
|
protected |
◆ snirThreshold
| double inet::physicallayer::ApskLayeredReceiver::snirThreshold |
|
protected |
The documentation for this class was generated from the following files:
@ SYMBOL_DOMAIN
Definition: ApskLayeredReceiver.h:34
@ SAMPLE_DOMAIN
Definition: ApskLayeredReceiver.h:35
double snirThreshold
Definition: ApskLayeredReceiver.h:49
virtual const IReceptionSymbolModel * computeSymbolModel(const LayeredTransmission *transmission, const ISnir *snir) const =0
Computes the symbol domain representation at the receiver using a simplified model for the underlying...
pow< s, -1 > Hz
Definition: Units.h:935
@ PRINT_LEVEL_DETAIL
Definition: IPrintableObject.h:24
const IDemodulator * demodulator
Definition: ApskLayeredReceiver.h:42
const ILayeredErrorModel * errorModel
Definition: ApskLayeredReceiver.h:40
LevelOfDetail
Definition: ApskLayeredReceiver.h:31
const IDecoder * decoder
Definition: ApskLayeredReceiver.h:41
double dBmW2mW(double dBm)
Converts a dBmW value to mW.
Definition: INETMath.h:163
@ BIT_DOMAIN
Definition: ApskLayeredReceiver.h:33
compose< J, pow< s, -1 > > W
Definition: Units.h:939
virtual const IReceptionSymbolModel * filter(const IReceptionSampleModel *sampleModel) const =0
virtual const IReceptionPacketModel * createPacketModel(const LayeredTransmission *transmission, const ISnir *snir, const IReceptionBitModel *bitModel) const
Definition: ApskLayeredReceiver.cc:135
W energyDetection
Definition: ApskLayeredReceiver.h:45
milli< W >::type mW
Definition: Units.h:1080
@ PACKET_DOMAIN
Definition: ApskLayeredReceiver.h:32
LevelOfDetail levelOfDetail
Definition: ApskLayeredReceiver.h:39
std::string printFieldToString(const IPrintableObject *object, int level, int evFlags=0)
Definition: IPrintableObject.h:98
#define EV_FIELD(...)
Definition: INETDefs.h:112
virtual const IReceptionPacketModel * decode(const IReceptionBitModel *bitModel) const =0
virtual void initialize(int stage) override
Definition: SnirReceiverBase.cc:17
virtual const IReceptionSampleModel * computeSampleModel(const LayeredTransmission *transmission, const ISnir *snir) const =0
Computes the sample domain representation at the receiver using a simplified model for the underlying...
W sensitivity
Definition: ApskLayeredReceiver.h:46
Hz centerFrequency
Definition: ApskLayeredReceiver.h:47
#define NaN
Definition: INETMath.h:91
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
virtual const IReceptionSampleModel * convertAnalogToDigital(const IReceptionAnalogModel *analogModel) const =0
virtual const IReceptionPacketModel * computePacketModel(const LayeredTransmission *transmission, const ISnir *snir) const =0
Computes the packet domain representation at the receiver using a simplified model for the underlying...
const IPulseFilter * pulseFilter
Definition: ApskLayeredReceiver.h:43
@ PRINT_LEVEL_TRACE
Definition: IPrintableObject.h:22
virtual const IReceptionBitModel * computeBitModel(const LayeredTransmission *transmission, const ISnir *snir) const =0
Computes the bit domain representation at the receiver using a simplified model for the underlying do...
int evFlags
Definition: INETDefs.cc:12
Hz bandwidth
Definition: ApskLayeredReceiver.h:48
virtual const IReceptionBitModel * createBitModel(const LayeredTransmission *transmission, const ISnir *snir, const IReceptionSymbolModel *symbolModel) const
Definition: ApskLayeredReceiver.cc:125
virtual const IReceptionSampleModel * createSampleModel(const LayeredTransmission *transmission, const ISnir *snir, const IReceptionAnalogModel *analogModel) const
Definition: ApskLayeredReceiver.cc:105
virtual const IReceptionAnalogModel * createAnalogModel(const LayeredTransmission *transmission, const ISnir *snir) const
Definition: ApskLayeredReceiver.cc:80
virtual const IReceptionBitModel * demodulate(const IReceptionSymbolModel *symbolModel) const =0
virtual const IReceptionSymbolModel * createSymbolModel(const LayeredTransmission *transmission, const ISnir *snir, const IReceptionSampleModel *sampleModel) const
Definition: ApskLayeredReceiver.cc:115
const IAnalogDigitalConverter * analogDigitalConverter
Definition: ApskLayeredReceiver.h:44