PathLossReceptionModel Class Reference

#include <PathLossReceptionModel.h>

Inheritance diagram for PathLossReceptionModel:

IReceptionModel

List of all members.


Detailed Description

Path loss model which calculates the received power using a path loss exponent and the distance.

Public Member Functions

virtual void initializeFrom (cModule *radioModule)
virtual double calculateReceivedPower (double pSend, double carrierFrequency, double distance)

Protected Attributes

double pathLossAlpha

Member Function Documentation

void PathLossReceptionModel::initializeFrom ( cModule *  radioModule  )  [virtual]

Parameters read from the radio module: pathLossAlpha.

Implements IReceptionModel.

00025 {
00026     pathLossAlpha = radioModule->par("pathLossAlpha");
00027 
00028     cModule *cc = ChannelControl::get();
00029     if (pathLossAlpha < (double) (cc->par("alpha")))
00030         opp_error("PathLossReceptionModel: pathLossAlpha can't be smaller than in ChannelControl -- please adjust the parameters");
00031 }

double PathLossReceptionModel::calculateReceivedPower ( double  pSend,
double  carrierFrequency,
double  distance 
) [virtual]

Perform the calculation.

Implements IReceptionModel.

00034 {
00035     const double speedOfLight = 300000000.0;
00036     double waveLength = speedOfLight / carrierFrequency;
00037     return (pSend * waveLength * waveLength / (16 * M_PI * M_PI * pow(distance, pathLossAlpha)));
00038 }


Member Data Documentation


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

Generated on Fri Mar 20 18:51:20 2009 for INET Framework for OMNeT++/OMNEST by  doxygen 1.5.5