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

#include <Ieee80211BerTableErrorModel.h>

Inheritance diagram for inet::physicallayer::Ieee80211BerTableErrorModel:
inet::physicallayer::ErrorModelBase inet::physicallayer::IErrorModel inet::physicallayer::IPrintableObject

Public Member Functions

 Ieee80211BerTableErrorModel ()
 
virtual ~Ieee80211BerTableErrorModel ()
 
virtual std::ostream & printToStream (std::ostream &stream, int level) const override
 Prints this object to the provided output stream. More...
 
virtual double computePacketErrorRate (const ISNIR *snir, IRadioSignal::SignalPart part) const override
 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 override
 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 override
 Returns the symbol error rate based on SNIR, modulation, and any other physical layer characteristics. 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 Attributes

BerParseFileberTableFile
 

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::Ieee80211BerTableErrorModel::Ieee80211BerTableErrorModel ( )
29  :
30  berTableFile(nullptr)
31 {
32 }
BerParseFile * berTableFile
Definition: Ieee80211BerTableErrorModel.h:32
inet::physicallayer::Ieee80211BerTableErrorModel::~Ieee80211BerTableErrorModel ( )
virtual
35 {
36  delete berTableFile;
37 }
BerParseFile * berTableFile
Definition: Ieee80211BerTableErrorModel.h:32

Member Function Documentation

double inet::physicallayer::Ieee80211BerTableErrorModel::computeBitErrorRate ( const ISNIR snir,
IRadioSignal::SignalPart  part 
) const
overridevirtual

Returns the bit error rate based on SNIR, modulation, FEC encoding and any other physical layer characteristics.

Implements inet::physicallayer::IErrorModel.

77 {
78  Enter_Method_Silent();
79  return NaN;
80 }
#define NaN
Definition: INETMath.h:103
double inet::physicallayer::Ieee80211BerTableErrorModel::computePacketErrorRate ( const ISNIR snir,
IRadioSignal::SignalPart  part 
) const
overridevirtual

Returns the packet error rate based on SNIR, modulation, FEC encoding and any other physical layer characteristics.

Implements inet::physicallayer::IErrorModel.

66 {
67  Enter_Method_Silent();
68  const ITransmission *transmission = snir->getReception()->getTransmission();
69  const FlatTransmissionBase *flatTransmission = check_and_cast<const FlatTransmissionBase *>(transmission);
70  double bitrate = flatTransmission->getBitrate().get();
71  double minSNIR = snir->getMin();
72  int payloadBitLength = flatTransmission->getDataBitLength();
73  return berTableFile->getPer(bitrate, minSNIR, payloadBitLength / 8);
74 }
BerParseFile * berTableFile
Definition: Ieee80211BerTableErrorModel.h:32
double getPer(double speed, double tsnr, int tlen)
Definition: BerParseFile.cc:88
double inet::physicallayer::Ieee80211BerTableErrorModel::computeSymbolErrorRate ( const ISNIR snir,
IRadioSignal::SignalPart  part 
) const
overridevirtual

Returns the symbol error rate based on SNIR, modulation, and any other physical layer characteristics.

Implements inet::physicallayer::IErrorModel.

83 {
84  Enter_Method_Silent();
85  return NaN;
86 }
#define NaN
Definition: INETMath.h:103
void inet::physicallayer::Ieee80211BerTableErrorModel::initialize ( int  stage)
overrideprotectedvirtual
40 {
41  if (stage == INITSTAGE_LOCAL) {
42  const char *fname = par("berTableFile");
43  if (fname == nullptr)
44  throw cRuntimeError("BER file parameter is mandatory");
45  // TODO: remove and cleanup opMode from here and also from BerParseFile, this should depend on the received signal
46  char opMode;
47  const char *opModeString = par("opMode");
48  if (!strcmp("b", opModeString))
49  opMode = 'b';
50  else if (!strcmp("g(erp)", opModeString))
51  opMode = 'g';
52  else if (!strcmp("g(mixed)", opModeString))
53  opMode = 'g';
54  else if (!strcmp("a", opModeString))
55  opMode = 'a';
56  else if (!strcmp("p", opModeString))
57  opMode = 'p';
58  else
59  throw cRuntimeError("Unknown opMode");
60  berTableFile = new BerParseFile(opMode);
61  berTableFile->parseFile(fname);
62  }
63 }
BerParseFile * berTableFile
Definition: Ieee80211BerTableErrorModel.h:32
void parseFile(const char *filename)
Definition: BerParseFile.cc:211
Local initializations.
Definition: InitStages.h:35
virtual std::ostream& inet::physicallayer::Ieee80211BerTableErrorModel::printToStream ( std::ostream &  stream,
int  level 
) const
inlineoverridevirtual

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

41 { return stream << "Ieee80211BerTableErrorModel"; }

Member Data Documentation

BerParseFile* inet::physicallayer::Ieee80211BerTableErrorModel::berTableFile
protected

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