00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _UWBIRPATHLOSSMODEL_H
00021 #define _UWBIRPATHLOSSMODEL_H
00022
00023 #include "AnalogueModel.h"
00024 #include "Mapping.h"
00025 #include "Signal_.h"
00026 #include "BaseWorldUtility.h"
00027 #include <math.h>
00028
00053 class UWBIRStochasticPathlossModel : public AnalogueModel {
00054
00055 public:
00056
00057
00058 static const double Gtx = 1, Grx = 1, ntx = 1, nrx = 1;
00059 double PL0;
00060 static const double fc = 4492.8;
00061 static const double d0 = 1;
00062 double mu_gamma, sigma_gamma;
00063 double mu_sigma, sigma_sigma;
00064 double gamma, S, sigma;
00065 double n1, n2, n3;
00066 static double n1_limit, n2_limit;
00067
00068 static const double s_mu = 1.6, s_sigma = 0.5;
00069 static const double kappa = 1;
00070
00071 bool isEnabled, shadowing;
00072
00073 cOutVector distances;
00074 cOutVector srcPosX, srcPosY, dstPosX, dstPosY;
00075
00076 int myIndex;
00077 std::string myName;
00078
00079 UWBIRStochasticPathlossModel(double _PL0, double _mu_gamma, double _sigma_gamma, double _mu_sigma, double _sigma_sigma, const Move* _move, bool _enabled, bool _shadowing=true) :
00080 PL0(_PL0), mu_gamma(_mu_gamma), sigma_gamma(_sigma_gamma), mu_sigma(_mu_sigma), sigma_sigma(_sigma_sigma), isEnabled(_enabled), shadowing(_shadowing), frequency("frequency"),
00081 move(_move) {
00082 distances.setName("distances");
00083 srcPosX.setName("srcPosX");
00084 srcPosY.setName("srcPosY");
00085 dstPosX.setName("dstPosX");
00086 dstPosY.setName("dstPosY");
00087 pathlosses.setName("pathloss");
00088 }
00089
00090 void filterSignal(Signal& s);
00091
00092 protected:
00093 double pathloss_exponent;
00094 double fading;
00095 Dimension frequency;
00096 const Move* move;
00097 cOutVector pathlosses;
00098
00099 double getNarrowBandFreeSpacePathloss(double fc, double distance);
00100 double getGhassemzadehPathloss(double distance);
00101 double getFDPathloss(double freq, double distance);
00102 double simtruncnormal(double mean, double stddev, double a, int rng);
00103
00104 };
00105
00106 #endif
00107