LEFT | RIGHT |
(no file at all) | |
| 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * Copyright (c) 2015 Federico Guerra |
| 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: Federico Guerra <federico@guerra-tlc.com> |
| 19 */ |
| 20 |
| 21 #ifdef NS3_WOSS_SUPPORT |
| 22 |
| 23 #ifndef WOSS_PROP_MODEL_H |
| 24 #define WOSS_PROP_MODEL_H |
| 25 |
| 26 #include "ns3/uan-prop-model-thorp.h" |
| 27 #include <woss-manager.h> |
| 28 |
| 29 namespace ns3 { |
| 30 |
| 31 class Time; |
| 32 |
| 33 /** |
| 34 * \ingroup WOSS |
| 35 * \class WossPropModel |
| 36 * |
| 37 * Propagation Model that retrieves a power delay profile from the WOSS framewor
k |
| 38 * and converts it in a UanPdp object |
| 39 */ |
| 40 class WossPropModel : public UanPropModelThorp |
| 41 { |
| 42 public: |
| 43 typedef ::std::vector< UanPdp > UanPdpVector; //!< ::std::vector of ns3::UanPD
P objects |
| 44 typedef ::std::vector< Ptr<MobilityModel> > MobModelVector; //!< ::std::vector
of ns3::MobilityModel smart pointers |
| 45 |
| 46 WossPropModel (); //!< Default constructor |
| 47 virtual ~WossPropModel (); //!< Default destructor |
| 48 |
| 49 /** |
| 50 * Register this type. |
| 51 * \return The object TypeId. |
| 52 */ |
| 53 static TypeId GetTypeId (void); |
| 54 |
| 55 /** |
| 56 * Mandatory method that allows the interaction with the WOSS framework. |
| 57 * WossHelper class will automatically handle all connections. |
| 58 * |
| 59 * \param woss::wossManagerPtr the pointer must point to the same object for a
ll prop object |
| 60 */ |
| 61 void SetWossManager (woss::WossManager* wossManagerPtr); |
| 62 |
| 63 /** |
| 64 * returns a pointer to the woss::WossManager object |
| 65 */ |
| 66 woss::WossManager* const GetWossManager (void); |
| 67 |
| 68 /** |
| 69 * This function is not supported by the UAN-WOSS framework |
| 70 */ |
| 71 virtual double GetPathLossDb (Ptr<MobilityModel> a, Ptr<MobilityModel> b, UanT
xMode mode); |
| 72 |
| 73 /** |
| 74 * This function returns the Power Delay Profile between the two input nodes |
| 75 * \param a transmitter node |
| 76 * \param b receiver node |
| 77 * \param mode transmission mode |
| 78 * \returns the Power Delay Profile |
| 79 */ |
| 80 virtual UanPdp GetPdp (Ptr<MobilityModel> a, Ptr<MobilityModel> b, UanTxMode m
ode); |
| 81 |
| 82 /** |
| 83 * New function that takes advantage of the WOSS multithread feature. |
| 84 * It calculates the power delay profiles from a single transmitter to a set o
f receiver with the given tx mode. |
| 85 * \param a transmitter mobility model |
| 86 * \param b vector of receiver mobility model |
| 87 * \param mode transmission mode used by the transmitter |
| 88 * \returns the vector of the calculated power delay profiles |
| 89 */ |
| 90 virtual UanPdpVector GetPdpVector (Ptr<MobilityModel> a, MobModelVector& b, Ua
nTxMode mode); |
| 91 |
| 92 /** |
| 93 * This function is not supported by the UAN-WOSS framework |
| 94 */ |
| 95 virtual Time GetDelay (Ptr<MobilityModel> a, Ptr<MobilityModel> b, UanTxMode m
ode); |
| 96 |
| 97 /** |
| 98 * This function should be used as for time delay purposes |
| 99 * It calculates the delay between two geographical coordinates |
| 100 * \param a geographical coordinates of transmitter node |
| 101 * \param b geographical coordinates of receiver node |
| 102 * \param mode transmitter mode |
| 103 * \param chAttThresDb The first channel tap that gives a SNR (dB) |
| 104 * greater than the threshold will be used as delay. |
| 105 * \returns the delay in seconds |
| 106 */ |
| 107 virtual Time GetDelay (woss::CoordZ a, woss::CoordZ b, UanTxMode mode, double
chAttThresDb); |
| 108 |
| 109 |
| 110 protected: |
| 111 woss::WossManager* m_wossManager; //!< woss::WossManager object used to trigge
r acoustic channel computations |
| 112 |
| 113 virtual void DoInitialize (void); |
| 114 |
| 115 /** |
| 116 * Converts a ns3::UanPdp from a woss::TimeArr object, and symbol time in seco
nds |
| 117 * \param timeArr pointer to a woss::TimeArr object |
| 118 * \param symbolTime the modulation symbol time in seconds |
| 119 * \returns a ns3::UanPdp object |
| 120 */ |
| 121 UanPdp CreateUanPdp (woss::TimeArr* timeArr, double symbolTime); // seconds |
| 122 |
| 123 /** |
| 124 * Returns a woss::CoordZ object from the current position of the given mobili
ty model |
| 125 * \param mobModel smart pointer to a node's mobility model |
| 126 * \returns a woss::CoordZ object |
| 127 */ |
| 128 woss::CoordZ CreateCoordZ (Ptr<MobilityModel> mobModel); |
| 129 |
| 130 /** |
| 131 * Converts a ns3::UanPdp from a woss::TimeArrVector object, and symbol time i
n seconds |
| 132 * \param timeArr reference to a woss::TimeArrVector object |
| 133 * \param symbolTime the modulation symbol time in seconds |
| 134 * \returns a ns3::UanPdpVector object |
| 135 */ |
| 136 UanPdpVector CreateUanPdpVector (woss::TimeArrVector& timeArr, double symbolTi
me); // seconds |
| 137 |
| 138 /** |
| 139 * Creates a woss::CoordZPairVect from a woss::TimeArr object, and symbol time
in seconds |
| 140 * \param tx transmitter mobility model |
| 141 * \param rx reference to a vector of mobility models (receivers) |
| 142 * \returns a ns3::CoordZPairVect object |
| 143 */ |
| 144 woss::CoordZPairVect CreateCoordzPairVector (Ptr<MobilityModel> tx, MobModelVe
ctor& rxs); |
| 145 |
| 146 private: |
| 147 |
| 148 bool m_memOptimization; //!< If true, WOSS objects are freed as soon as possib
le.· |
| 149 }; |
| 150 |
| 151 } |
| 152 |
| 153 #endif /* WOSS_PROP_MODEL_H */ |
| 154 |
| 155 #endif /* NS3_WOSS_SUPPORT */ |
LEFT | RIGHT |