|
INET Framework for OMNeT++/OMNEST
|
#include <ErrorModelBase.h>
|
| enum | CorruptionMode {
CorruptionMode::CM_UNDEFINED = -1,
CorruptionMode::CM_PACKET,
CorruptionMode::CM_CHUNK,
CorruptionMode::CM_BYTE,
CorruptionMode::CM_BIT
} |
| |
| enum | SnirMode { SnirMode::SM_UNDEFINED = -1,
SnirMode::SM_MIN,
SnirMode::SM_MEAN
} |
| |
| 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)
} |
| |
|
| virtual double | computePacketErrorRate (const ISnir *snir, IRadioSignal::SignalPart part) const =0 |
| | Returns the packet error rate based on SNIR, modulation, FEC encoding and any other physical layer characteristics. More...
|
| |
| virtual double | computeBitErrorRate (const ISnir *snir, IRadioSignal::SignalPart part) const =0 |
| | Returns the bit error rate based on SNIR, modulation, FEC encoding and any other physical layer characteristics. More...
|
| |
| virtual double | computeSymbolErrorRate (const ISnir *snir, IRadioSignal::SignalPart part) const =0 |
| | Returns the symbol error rate based on SNIR, modulation, and any other physical layer characteristics. More...
|
| |
| virtual | ~IPrintableObject () |
| |
| virtual std::ostream & | printToStream (std::ostream &stream, int level, int evFlags=0) const |
| | Prints this object to the provided output stream. More...
|
| |
| 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 |
| |
◆ CorruptionMode
| Enumerator |
|---|
| CM_UNDEFINED | |
| CM_PACKET | |
| CM_CHUNK | |
| CM_BYTE | |
| CM_BIT | |
◆ SnirMode
| Enumerator |
|---|
| SM_UNDEFINED | |
| SM_MIN | |
| SM_MEAN | |
◆ computeCorruptedPacket() [1/2]
| Packet * inet::physicallayer::ErrorModelBase::computeCorruptedPacket |
( |
const ISnir * |
snir | ) |
const |
|
overrideprotectedvirtual |
Implements inet::physicallayer::IErrorModel.
143 auto transmittedPacket = snir->getReception()->getTransmission()->getPacket();
146 receivedPacket->clearTags();
148 return receivedPacket;
◆ computeCorruptedPacket() [2/2]
| Packet * inet::physicallayer::ErrorModelBase::computeCorruptedPacket |
( |
const Packet * |
packet, |
|
|
double |
ber |
|
) |
| const |
|
protectedvirtual |
◆ corruptBits()
| Packet * inet::physicallayer::ErrorModelBase::corruptBits |
( |
const Packet * |
packet, |
|
|
double |
ber, |
|
|
bool & |
isCorrupted |
|
) |
| const |
|
protectedvirtual |
61 std::vector<bool> corruptedBits;
62 const auto& all = packet->peekAllAsBits();
63 for (
bool bit : all->getBits()) {
68 corruptedBits.push_back(bit);
70 return new Packet(packet->getName(), makeShared<BitsChunk>(corruptedBits));
Referenced by computeCorruptedPacket().
◆ corruptBytes()
| Packet * inet::physicallayer::ErrorModelBase::corruptBytes |
( |
const Packet * |
packet, |
|
|
double |
ber, |
|
|
bool & |
isCorrupted |
|
) |
| const |
|
protectedvirtual |
75 std::vector<uint8_t> corruptedBytes;
76 const auto& all = packet->peekAllAsBytes();
77 for (uint8_t
byte : all->getBytes()) {
82 corruptedBytes.push_back(
byte);
84 return new Packet(packet->getName(), makeShared<BytesChunk>(corruptedBytes));
Referenced by computeCorruptedPacket().
◆ corruptChunks()
| Packet * inet::physicallayer::ErrorModelBase::corruptChunks |
( |
const Packet * |
packet, |
|
|
double |
ber, |
|
|
bool & |
isCorrupted |
|
) |
| const |
|
protectedvirtual |
90 auto corruptedPacket =
new Packet(packet->getName());
94 auto corruptedChunk = chunk->dupShared();
95 corruptedChunk->markIncorrect();
96 corruptedPacket->insertAtBack(corruptedChunk);
99 corruptedPacket->insertAtBack(chunk);
100 offset += chunk->getChunkLength();
102 return corruptedPacket;
Referenced by computeCorruptedPacket().
◆ corruptPacket()
| Packet * inet::physicallayer::ErrorModelBase::corruptPacket |
( |
const Packet * |
packet, |
|
|
bool & |
isCorrupted |
|
) |
| const |
|
protectedvirtual |
108 auto corruptedPacket = packet->dup();
109 corruptedPacket->setBitError(
true);
110 return corruptedPacket;
Referenced by computeCorruptedPacket().
◆ getScalarSnir()
| double inet::physicallayer::ErrorModelBase::getScalarSnir |
( |
const ISnir * |
snir | ) |
const |
|
protectedvirtual |
◆ hasProbabilisticError()
| bool inet::physicallayer::ErrorModelBase::hasProbabilisticError |
( |
b |
length, |
|
|
double |
ber |
|
) |
| const |
|
protectedvirtual |
◆ initialize()
| void inet::physicallayer::ErrorModelBase::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
◆ corruptionMode
◆ snirMode
◆ snirOffset
| double inet::physicallayer::ErrorModelBase::snirOffset = NaN |
|
protected |
The documentation for this class was generated from the following files:
@ PF_ALLOW_NULLPTR
Definition: Chunk.h:278
virtual double computeBitErrorRate(const ISnir *snir, IRadioSignal::SignalPart part) const =0
Returns the bit error rate based on SNIR, modulation, FEC encoding and any other physical layer chara...
@ SIGNAL_PART_WHOLE
Definition: IRadioSignal.h:26
virtual Packet * corruptChunks(const Packet *packet, double ber, bool &isCorrupted) const
Definition: ErrorModelBase.cc:87
double snirOffset
Definition: ErrorModelBase.h:37
SnirMode snirMode
Definition: ErrorModelBase.h:36
virtual Packet * corruptBits(const Packet *packet, double ber, bool &isCorrupted) const
Definition: ErrorModelBase.cc:59
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down PacketProtocolTag
Definition: IUdp-gates.txt:25
CorruptionMode corruptionMode
Definition: ErrorModelBase.h:35
intscale< b, 1, 8 > B
Definition: Units.h:1168
virtual Packet * computeCorruptedPacket(const Packet *packet, double ber) const
Definition: ErrorModelBase.cc:113
virtual Packet * corruptBytes(const Packet *packet, double ber, bool &isCorrupted) const
Definition: ErrorModelBase.cc:73
double dB2fraction(double dB)
Converts a dB value to fraction.
Definition: INETMath.h:153
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
value< int64_t, units::b > b
Definition: Units.h:1241
virtual Packet * corruptPacket(const Packet *packet, bool &isCorrupted) const
Definition: ErrorModelBase.cc:105
virtual bool hasProbabilisticError(b length, double ber) const
Definition: ErrorModelBase.cc:53