/usr/include/ns3/uan-prop-model.h is in libns3-dev 3.13+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2009 University of Washington
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Leonard Tracy <lentracy@gmail.com>
*/
#ifndef UAN_PROP_MODEL_H
#define UAN_PROP_MODEL_H
#include "ns3/object.h"
#include "ns3/mobility-model.h"
#include "ns3/nstime.h"
#include <vector>
#include <complex>
#include <utility>
namespace ns3 {
class UanTxMode;
/**
* \class Tap
* \brief Holds PDP Tap information (amplitude and delay)
*/
class Tap
{
public:
/**
* Default constructor. Creates Tap with delay=0, amp=0
*/
Tap ();
/**
* \param delay Time delay (usually from first arrival) of signal
* \param amp Complex amplitude of arrival
*/
Tap (Time delay, std::complex<double> amp);
/**
* \returns Complex amplitude of arrival
*/
std::complex<double> GetAmp (void) const;
/**
* \returns Time delay (usually from first arrival) of signal
*/
Time GetDelay (void) const;
private:
std::complex<double> m_amplitude;
Time m_delay;
};
/**
* \class UanPdp
*
* Container class to describe power delay profile returned
* from UAN propagation models using tapped delay line model.
* This should model a channel impulse response as a set of
* equally spaced signal arrivals.
*
* Generally, the profile should be normalized, such that
* the sum of all taps should equal 1. The received signal
* power on any interval (t1, t2) can then be found from
* summing the taps on the interval and multiplying by
* the total received power at the receiver.
*
*
*/
class UanPdp
{
public:
/**
* \brief Iterator is a standard template library constant interator
*/
typedef std::vector<Tap>::const_iterator Iterator;
/**
* \brief Create empty PDP object
*/
UanPdp ();
/**
* \brief Create PDP object from a vector of Tap objects
* \param taps Taps to include in this PDP
* \param resolution Resolution of PDP object
*/
UanPdp (std::vector<Tap> taps, Time resolution);
/**
* \brief Create PDP object from vector of arrival amplitudes
* \param arrivals Vector of complex amplitude arrivals
* \param resolution Time duration between arrivals in vector
*/
UanPdp (std::vector<std::complex<double > > arrivals, Time resolution);
/**
* \brief Create PDP object from real valued arrival amplitudes
* \param arrivals vector of real valued arrivals
* \param resolution Time duration between arrivals in vector
*/
UanPdp (std::vector<double> arrivals, Time resolution);
~UanPdp ();
/**
* \param arrival complex arrival value
* \param index index of arrival
*/
void SetTap (std::complex<double> arrival, uint32_t index);
/**
* \param nTaps number of taps in this PDP
*/
void SetNTaps (uint32_t nTaps);
/**
* \param resolution Resolution of PDP (time between arrivals)
*/
void SetResolution (Time resolution);
/**
* \returns Iterator positioned at first arrival
*/
Iterator GetBegin (void) const;
/**
* \returns Iterator positioned after last arrival
*/
Iterator GetEnd (void) const;
/**
* \returns Number of taps in PDP
*/
uint32_t GetNTaps (void) const;
/**
* \returns Tap object at index i
* \param i Index number of tap to return (0 based)
*/
const Tap &GetTap (uint32_t i) const;
/**
* \returns Resolution of PDP (time duration between arrivals)
*/
Time GetResolution (void) const;
/**
* \param begin Time value to begin summing arrivals
* \param end Time value to end summing arrivals
* \returns Returns Non-coherent sum of arrivals between two time values
*
* Assuming that Tap at index 0 arrives at time 0,
* this function sums non-coherently (sums amplitude of arrivals
* ignoring phase difference) all arrivals between a start
* and end time.
*/
double SumTapsNc (Time begin, Time end) const;
/**
* \param begin Time value to begin summing arrivals
* \param end Time value to end summing arrivals
* \returns Returns coherent sum of arrivals between two time values
*
* Assuming that Tap at index 0 arrives at time 0,
* this function sums coherently (sums amplitude of arrivals
* considering phase difference) all arrivals between a start
* and end time.
*/
std::complex<double> SumTapsC (Time begin, Time end) const;
/**
* \param delay Time duratation after max to begin summing arrivals
* \param duration Time duration to sum arrivals for
* \returns non-coherent sum of arrivals after max in given window
*
* this function sums non-coherently (sums amplitude of arrivals
* ignoring phase difference) all arrivals in a given duration
* starting the given time after the maximum amplitude arrival received
*/
double SumTapsFromMaxNc (Time delay, Time duration) const;
/**
* \param delay Time duratation after max to begin summing arrivals
* \param duration Time duration to sum arrivals for
* \returns coherent sum of arrivals after max in given window
*
* this function sums coherently (sums amplitude of arrivals
* considering phase difference) all arrivals in a given duration
* starting the given time after the maximum amplitude arrival received
*/
std::complex<double> SumTapsFromMaxC (Time delay, Time duration) const;
/**
* \returns A PDP with a singlue unit impulse arrival at time 0
*/
static UanPdp CreateImpulsePdp (void);
private:
friend std::ostream &operator<< (std::ostream &os, UanPdp &pdp);
friend std::istream &operator>> (std::istream &is, UanPdp &pdp);
std::vector<Tap> m_taps;
Time m_resolution;
};
/**
* \brief Writes PDP to stream as list of arrivals
*/
std::ostream &operator<< (std::ostream &os, UanPdp &pdp);
/**
* \brief Reads in list of arrivals from stream is
*/
std::istream &operator>> (std::ostream &is, UanPdp &pdp);
/**
* \class UanPropModel
*
* Base class for implemented underwater propagation models
*/
class UanPropModel : public Object
{
public:
static TypeId GetTypeId (void);
/**
* Computes pathloss between nodes a and b.
* \returns Pathloss in dB re 1 uPa
* \param a Ptr to mobility model of node a
* \param b Ptr to mobility model of node b
* \param txMode TX mode of transmission between a and b
*/
virtual double GetPathLossDb (Ptr<MobilityModel> a, Ptr<MobilityModel> b, UanTxMode txMode) = 0;
/**
* \returns PDP for link between nodes a and b
* \param a Ptr to mobility model of node a
* \param b Ptr to mobility model of node b
* \param mode TX mode of transmission from a to b
*/
virtual UanPdp GetPdp (Ptr<MobilityModel> a, Ptr<MobilityModel> b, UanTxMode mode) = 0;
/**
* Finds propagation delay between nodes a and b
* \param a Ptr to mobility model of node a
* \param b Ptr to mobility model of node b
* \param mode TX mode of transmission
* \returns Propagation delay
*/
virtual Time GetDelay (Ptr<MobilityModel> a, Ptr<MobilityModel> b, UanTxMode mode) = 0;
/**
* Clears all pointer references
*/
virtual void Clear (void);
virtual void DoDispose (void);
};
}
#endif /* UAN_PROP_MODEL_H */
|