1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 University of Washington
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  *
18  * Author: Leonard Tracy <lentracy@gmail.com>
19  */
20 
21 #ifndef UAN_PROP_MODEL_THORP_H
22 #define UAN_PROP_MODEL_THORP_H
23 
24 #include "uan-prop-model.h"
25 
26 namespace ns3 {
27 
28 class UanTxMode;
29 
30 /**
31  * \ingroup uan
32  *
33  * Uses Thorp's approximation to compute pathloss.  Assumes implulse PDP.
34  */
35 class UanPropModelThorp : public UanPropModel
36 {
37 public:
38   /** Default constructor. */
39   UanPropModelThorp ();
40   /** Destructor */
41   virtual ~UanPropModelThorp ();
42 
43   /**
44    * Register this type.
45    * \return The object TypeId.
46    */
47   static TypeId GetTypeId (void);
48 
49   // Inherited methods
50   virtual double GetPathLossDb (Ptr<MobilityModel> a, Ptr<MobilityModel> b, UanTxMode mode);
51   virtual UanPdp GetPdp (Ptr<MobilityModel> a, Ptr<MobilityModel> b, UanTxMode mode);
52   virtual Time GetDelay (Ptr<MobilityModel> a, Ptr<MobilityModel> b, UanTxMode mode);
53 
54 private:
55   /**
56    * Get the attenuation in dB / 1000 yards.
57    * \param freqKhz The channel center frequency, in kHz.
58    * \return The attenuation, in dB / 1000 yards.
59    */
60   double GetAttenDbKyd (double freqKhz);
61   /**
62    * Get the attenuation in dB / km.
63    * \param freqKhz The channel center frequency, in kHz.
64    * \return The attenuation, in dB/km.
65    */
66   double GetAttenDbKm (double freqKhz);
67 
68   double m_SpreadCoef;  //!< Spreading coefficient used in calculation of Thorp's approximation.
69 
70 };  // class UanPropModelThorp
71 
72 } // namespace ns3
73 
74 #endif /* UAN_PROP_MODEL_THORP_H */
75