00001 /* 00002 * Copyright (C) 2007 00003 * Mercedes-Benz Research & Development North America, Inc. 00004 * All rights reserved. 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License, 00008 * version 2, as published by the Free Software Foundation. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License along 00016 * with this program; if not, write to the Free Software Foundation, Inc., 00017 * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. 00018 * 00019 * 00020 * The copyright of this module includes the following 00021 * linking-with-specific-other-licenses addition: 00022 * 00023 * In addition, as a special exception, the copyright holders of 00024 * this module give you permission to combine (via static or 00025 * dynamic linking) this module with free software programs or 00026 * libraries that are released under the GNU LGPL and with code 00027 * included in the standard release of ns-2 under the Apache 2.0 00028 * license or under otherwise-compatible licenses with advertising 00029 * requirements (or modified versions of such code, with unchanged 00030 * license). You may copy and distribute such a system following the 00031 * terms of the GNU GPL for this module and the licenses of the 00032 * other code concerned, provided that you include the source code of 00033 * that other code when and as the GNU GPL requires distribution of 00034 * source code. 00035 * 00036 * Note that people who make modified versions of this module 00037 * are not obligated to grant this special exception for their 00038 * modified versions; it is their choice whether to do so. The GNU 00039 * General Public License gives permission to release a modified 00040 * version without this exception; this exception also makes it 00041 * possible to release a modified version which carries forward this 00042 * exception. 00043 * 00044 */ 00045 00046 /* 00047 * This code was developed by: 00048 * 00049 * Qi Chen : qi.chen@daimler.com 00050 * Heiko Mangold 00051 * Daniel Jiang : daniel.jiang@daimler.com 00052 * 00053 * For further information see: 00054 * http://dsn.tm.uni-karlsruhe.de/english/Overhaul_NS-2.php 00055 */ 00056 00057 #ifndef nakagami_h 00058 #define nakagami_h 00059 00060 #include <packet-stamp.h> 00061 #include <wireless-phy.h> 00062 #include <propagation.h> 00063 #include <rng.h> 00064 00065 class Nakagami : public Propagation { 00066 public: 00067 Nakagami(); 00068 Nakagami(double g0,double g1,double g2,double d0_g,double d1_g,double m_0,double m_1,double m_2,double d0m,double d1m, int use_distribution); 00069 ~Nakagami(); 00070 00071 virtual double Pr(PacketStamp *tx, PacketStamp *rx, WirelessPhy *ifp); 00072 virtual int command(int argc, const char*const* argv); 00073 virtual double getDist(double Pr, double Pt, double Gt, double Gr, double hr, double ht, double L, double lambda); 00074 protected: 00075 RNG *ranVar; // random number generator for normal distribution 00076 double gamma0,gamma1, gamma2; 00077 double d0_gamma,d1_gamma; 00078 00079 int use_nakagami_dist_; 00080 double m0,m1,m2; 00081 double d0_m,d1_m; 00082 }; 00083 00084 #endif