MFullPropagation Class Reference

#include <mfullpropagation.h>

Inheritance diagram for MFullPropagation:

Inheritance graph
[legend]
Collaboration diagram for MFullPropagation:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MFullPropagation ()
virtual double getGain (Packet *p)
virtual int command (int argc, const char *const *argv)

Protected Member Functions

double Gaussian ()
void initialize_common (unsigned long int N0, double d, double **amp, double *incr)
void initialize_phases (unsigned long int N0, double *phases)
void initialize_all_phases (unsigned long int N0, double ****phases)
void oscillators (unsigned long int N0, double *phases, double *incr, double **amp, double *x)
void FadingInit ()
void ShadowInit ()
void Init ()
double Shadowing (Position *node1, Position *node2)
double Rayleigh (int txId, int rxId)
double PathLoss (double distance, double lambda)
int getSimulatedNodeId (Position *p)
void compute_fading (unsigned long int N0, double ****phases, double *incr, double **amp, double **fad, double ***A2)
void simulationStep ()

Protected Attributes

double ** amp_
double * incr_
 internal variable for Jakes Simulator
double **** phases_
 internal variable for Jakes Simulator
double ** fad_
 internal variable for Jakes Simulator
double maxDopplerShift_
 internal variable for Jakes Simulator
double d_
 doppler frequency (used in Fading Jakes Simulator)
double *** A2_
 normalized doppler frequency (used in Fading Jakes Simulator)
unsigned int nRays_
 internal variable for Jakes Simulator
int N0_
 internal variable for Jakes Simulator
double refDistance_
 number of oscillators to be used in fading simulation
double beta_
 typically 1-10 m. (indoor), 10-100 m (outdoor)
SampleTimer sampleTimer_
double timeUnit_
 timer to schedule Jakes Simulator schedule events
int rayleighFading_
double xFieldWidth_
 whether or not simulate fading (1: simulate, 0:don't simulate)
double yFieldWidth_
 range of x-axis of the simulated area (for shadowing matrix)
double * shadowMat_
 range of y-axis of the simulated area (for shadowing matrix)
double shadowSigma_
int nodesNum_
 lognormal shadowing standard deviation (plugged via tcl)
Position ** nodesIndexArray_
 a new node is added, i.e., by means of "newNode" tcl command)
int debug_
 their position pointer (of Position Class)

Friends

class SampleTimer

Detailed Description

Class handling full propagation model (path loss, shadowing and fading)

It manages the propagation simulator, it counts for path loss (Friis model), shadowing (Gudmonson model) and fading (Jakes). It is necessary to define the number of users to be involved in the simulation before to start it in order to set up all the dynamic variables needed.

Definition at line 70 of file mfullpropagation.h.


Member Function Documentation

double MFullPropagation::getGain ( Packet *  p  )  [virtual]

Method that returns the propagation attenuation factor

Implements MPropagation.

Definition at line 601 of file mfullpropagation.cc.

References hdr_MPhy::dstPosition, Position::getDist(), MSpectralMask::getFreq(), getSimulatedNodeId(), PathLoss(), Rayleigh(), Shadowing(), hdr_MPhy::srcPosition, and hdr_MPhy::srcSpectralMask.

Here is the call graph for this function:

double MFullPropagation::Gaussian (  )  [protected]

Method that returns a value from a normal random Gaussian variable (zero mean, unitary viariance)

Definition at line 135 of file mfullpropagation.cc.

Referenced by ShadowInit().

void MFullPropagation::initialize_common ( unsigned long int  N0,
double  d,
double **  amp,
double *  incr 
) [protected]

This methods initializes Jakes Simulator paramters (i.e., calculates doppler shift and aplitudes of the sinusoids)

Parameters:
NO numner of oscillator(s) to be used
d normalized doppler frequency
amp 
inc 

Definition at line 166 of file mfullpropagation.cc.

References nodesNum_, and nRays_.

Referenced by FadingInit().

void MFullPropagation::initialize_phases ( unsigned long int  N0,
double *  phases 
) [protected]

This methods initializes phases of the oscillator(s) for a user

Parameters:
NO numner of oscillator(s) to be used
phases pointer of the user's phases array

Definition at line 187 of file mfullpropagation.cc.

Referenced by initialize_all_phases().

void MFullPropagation::initialize_all_phases ( unsigned long int  N0,
double ****  phases 
) [protected]

This methods initializes phases of the oscillator(s) for all users

Parameters:
NO numner of oscillator(s) to be used
phases pointer of the users' phases array

Definition at line 200 of file mfullpropagation.cc.

References initialize_phases(), nodesNum_, and nRays_.

Referenced by FadingInit().

Here is the call graph for this function:

void MFullPropagation::oscillators ( unsigned long int  N0,
double *  phases,
double *  incr,
double **  amp,
double *  x 
) [protected]

This methods computes fading quadrature components for each ray of each user, and updates phases of the corresponding oscillators

Parameters:
NO numner of oscillator(s) to be used
phases pointer of the user's phases array
incr 
amp pointer to the fading coefficient matrix
x 

Definition at line 213 of file mfullpropagation.cc.

Referenced by compute_fading().

void MFullPropagation::FadingInit (  )  [protected]

Method invoked before start the channel simulation to initialize fading paramenters

Definition at line 330 of file mfullpropagation.cc.

References A2_, amp_, compute_fading(), d_, fad_, incr_, initialize_all_phases(), initialize_common(), maxDopplerShift_, N0_, nodesNum_, phases_, simulationStep(), and timeUnit_.

Referenced by Init().

Here is the call graph for this function:

void MFullPropagation::ShadowInit (  )  [protected]

Method invoked before start the channel simulation to initialize shadowing paramenters

Definition at line 252 of file mfullpropagation.cc.

References Gaussian(), shadowMat_, and shadowSigma_.

Referenced by Init().

Here is the call graph for this function:

void MFullPropagation::Init (  )  [protected]

Method invoked before start the channel simulation to initialize variables

Definition at line 430 of file mfullpropagation.cc.

References A2_, amp_, beta_, d_, fad_, FadingInit(), incr_, maxDopplerShift_, nodesNum_, phases_, rayleighFading_, refDistance_, ShadowInit(), shadowMat_, shadowSigma_, timeUnit_, xFieldWidth_, and yFieldWidth_.

Referenced by command().

Here is the call graph for this function:

double MFullPropagation::Shadowing ( Position node1,
Position node2 
) [protected]

This methos returns the shadowing attenuation factor (according to the lognormal sigma factor)

Parameters:
id1 identifier of the source node
id2 identifier of the destination node

Definition at line 513 of file mfullpropagation.cc.

References Position::getX(), Position::getY(), shadowMat_, xFieldWidth_, and yFieldWidth_.

Referenced by getGain().

Here is the call graph for this function:

double MFullPropagation::Rayleigh ( int  txId,
int  rxId 
) [protected]

This methods returns the Rayleigh fading fatcor (i.e., according to the ditruibution of the sum of two square Gaussian variables)

Parameters:
node1 pointer to the Position instance of source node
node2 pointer to the Position instance of destination node

Definition at line 535 of file mfullpropagation.cc.

References fad_.

Referenced by getGain().

double MFullPropagation::PathLoss ( double  distance,
double  lambda 
) [protected]

This methods returns free-space attenuation factor

Parameters:
distance distance between the two nodes

Definition at line 495 of file mfullpropagation.cc.

References beta_, and refDistance_.

Referenced by getGain().

int MFullPropagation::getSimulatedNodeId ( Position p  )  [protected]

This methods returns the id of the simulated node according to its Position class

Parameters:
p instance of the Position class of the node

Definition at line 544 of file mfullpropagation.cc.

References nodesIndexArray_, and nodesNum_.

Referenced by getGain().

void MFullPropagation::compute_fading ( unsigned long int  N0,
double ****  phases,
double *  incr,
double **  amp,
double **  fad,
double ***  A2 
) [protected]

This methods computes fading quadrature components for all users and all rays, and updates phases of the oscillators for all users

Parameters:
NO numner of oscillator(s) to be used
phases pointer of the user's phases array
incr 
amp pointer to the fading coefficient matrix
fad 
A2 

Definition at line 233 of file mfullpropagation.cc.

References A2_, nodesNum_, nRays_, and oscillators().

Referenced by FadingInit(), and simulationStep().

Here is the call graph for this function:

void MFullPropagation::simulationStep (  )  [protected]

This methods launches the computation of a new step of the Jakes Simulator and schedules the next one, according to timeUnit_.

Definition at line 554 of file mfullpropagation.cc.

References A2_, amp_, compute_fading(), fad_, incr_, N0_, phases_, sampleTimer_, and timeUnit_.

Referenced by SampleTimer::expire(), and FadingInit().

Here is the call graph for this function:


Member Data Documentation

double MFullPropagation::beta_ [protected]

typically 1-10 m. (indoor), 10-100 m (outdoor)

reference distance in Path Loss computation (OBS)

Definition at line 204 of file mfullpropagation.h.

Referenced by Init(), MFullPropagation(), and PathLoss().

SampleTimer MFullPropagation::sampleTimer_ [protected]

Typical values: Urban macrocells 3.7-6.5 Urban microcells 2.7-3.5 Office building (same floor) 1.6-3.5 Office building (multiple floors) 2-6 Store 1.8-2.2 Factory 1.6-3.3 Home 3

Definition at line 213 of file mfullpropagation.h.

Referenced by simulationStep().

int MFullPropagation::rayleighFading_ [protected]

NOTE that when the value acquired is less than 0 the actual time unit used is 1/(maxDopplerShift_*(abs(timeUnit_)))

Definition at line 217 of file mfullpropagation.h.

Referenced by Init(), and MFullPropagation().

double MFullPropagation::shadowSigma_ [protected]

the simulation field (defined by xFieldWidth_ x yFieldWidth_) is divided in SIDE_NUM (see "#define" in fullpropagation.cc) and for each couple of cells is defined the shadowing gain accoprding to a log-normal distribution

Definition at line 225 of file mfullpropagation.h.

Referenced by Init(), MFullPropagation(), and ShadowInit().

Position** MFullPropagation::nodesIndexArray_ [protected]

a new node is added, i.e., by means of "newNode" tcl command)

number of nods involved in the simulation (updated automatically when

Definition at line 228 of file mfullpropagation.h.

Referenced by command(), and getSimulatedNodeId().

int MFullPropagation::debug_ [protected]

their position pointer (of Position Class)

array which codes the channel simulation nodes id to

Definition at line 230 of file mfullpropagation.h.

Referenced by command(), and MFullPropagation().


The documentation for this class was generated from the following files:
Generated on Wed Nov 26 15:49:00 2008 for NS-MIRACLE library by  doxygen 1.5.2