Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

SnrDecider Class Reference

#include <SnrDecider.h>

Inheritance diagram for SnrDecider:

BasicDecider BasicModule INotifiable ErrAndCollDecider List of all members.

Detailed Description

a simple snr decider...

This decider simply takes a look at the sduList contained in the received PhySDU packet and checks whether one of the mentioned snr levels is lower than the snrThresholdLevel which has to be read in at the beginning of a simulation. (suggestion: from the omnetpp.ini file!)

Author:
Marc Löbbers, Andreas Koepke


Protected Member Functions

virtual void initialize (int)
 Initialization of the module and some variables.
bool snrOverThreshold (SnrList &) const
virtual void handleLowerMsg (AirFrame *, SnrList &)
 In this function the decision whether a frame is received correctly or not is made.

Protected Attributes

double snrThresholdLevel
 Level for decision [mW].


Member Function Documentation

void SnrDecider::handleLowerMsg AirFrame *  af,
SnrList receivedList
[protected, virtual]
 

In this function the decision whether a frame is received correctly or not is made.

Redefine this function if you want to process messages from the channel before they are forwarded to upper layers

In this function it has to be decided whether this message got lost or not. This can be done with a simple SNR threshold or with transformations of SNR into bit error probabilities...

If you want to forward the message to upper layers please use sendUp which will decapsulate the MAC frame before sending

Reimplemented from BasicDecider.

Reimplemented in ErrAndCollDecider.

00062 {
00063     if (snrOverThreshold(receivedList))
00064     {
00065         EV << "Message handed on to Mac\n";
00066         sendUp(af);
00067     }
00068     else
00069     {
00070         delete af;
00071     }
00072 }

void SnrDecider::initialize int  stage  )  [protected, virtual]
 

Initialization of the module and some variables.

First we have to initialize the module from which we derived ours, in this case BasicModule.

Then we have to intialize the gates and - if necessary - some own variables.

Reimplemented from BasicDecider.

00029 {
00030     BasicDecider::initialize(stage);
00031 
00032     if (stage == 0)
00033     {
00034         snrThresholdLevel = FWMath::dBm2mW(par("snrThresholdLevel"));
00035     }
00036 }

bool SnrDecider::snrOverThreshold SnrList snrlist  )  const [protected]
 

Checks the received sduList (from the PhySDU header) if it contains an snr level above the threshold

00044 {
00045     //check the entries in the sduList if a level is lower than the
00046     //acceptable minimum:
00047 
00048     //check
00049     for (SnrList::const_iterator iter = snrlist.begin(); iter != snrlist.end(); iter++)
00050     {
00051         if (iter->snr <= snrThresholdLevel)
00052         {
00053             EV << "Message got lost. MessageSnr: " << iter->
00054                 snr << " Threshold: " << snrThresholdLevel << endl;
00055             return false;
00056         }
00057     }
00058     return true;
00059 }


Member Data Documentation

double SnrDecider::snrThresholdLevel [protected]
 

Level for decision [mW].

When a packet contains an snr level higher than snrThresholdLevel it will be considered as lost. This parameter has to be specified at the beginning of a simulation (omnetpp.ini) in dBm.


The documentation for this class was generated from the following files:
Generated on Sat Apr 1 20:52:24 2006 for INET Framework for OMNeT++/OMNEST by  doxygen 1.4.1