A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
uan-prop-model.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 University of Washington
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Leonard Tracy <lentracy@gmail.com>
18 */
19
20#ifndef UAN_PROP_MODEL_H
21#define UAN_PROP_MODEL_H
22
23#include "ns3/mobility-model.h"
24#include "ns3/nstime.h"
25#include "ns3/object.h"
26
27#include <complex>
28#include <utility>
29#include <vector>
30
31namespace ns3
32{
33
34class UanTxMode;
35
41class Tap
42{
43 public:
47 Tap();
54 Tap(Time delay, std::complex<double> amp);
60 std::complex<double> GetAmp() const;
65 Time GetDelay() const;
66
67 private:
68 std::complex<double> m_amplitude;
70
71}; // class Tap
72
89class UanPdp
90{
91 public:
95 typedef std::vector<Tap>::const_iterator Iterator;
99 UanPdp();
106 UanPdp(std::vector<Tap> taps, Time resolution);
113 UanPdp(std::vector<std::complex<double>> arrivals, Time resolution);
120 UanPdp(std::vector<double> arrivals, Time resolution);
122 ~UanPdp();
123
134 void SetTap(std::complex<double> arrival, uint32_t index);
140 void SetNTaps(uint32_t nTaps);
146 void SetResolution(Time resolution);
152 Iterator GetBegin() const;
158 Iterator GetEnd() const;
164 uint32_t GetNTaps() const;
171 const Tap& GetTap(uint32_t i) const;
177 Time GetResolution() const;
191 double SumTapsNc(Time begin, Time end) const;
205 std::complex<double> SumTapsC(Time begin, Time end) const;
219 double SumTapsFromMaxNc(Time delay, Time duration) const;
233 std::complex<double> SumTapsFromMaxC(Time delay, Time duration) const;
239 UanPdp NormalizeToSumNc() const;
245 static UanPdp CreateImpulsePdp();
246
247 private:
248 friend std::ostream& operator<<(std::ostream& os, const UanPdp& pdp);
249 friend std::istream& operator>>(std::istream& is, UanPdp& pdp);
250
251 std::vector<Tap> m_taps;
253
254}; // class UanPdp
255
265std::ostream& operator<<(std::ostream& os, const UanPdp& pdp);
275std::istream& operator>>(std::istream& is, UanPdp& pdp);
276
282class UanPropModel : public Object
283{
284 public:
289 static TypeId GetTypeId();
290
300
319
321 virtual void Clear();
322
323 void DoDispose() override;
324
325}; // class UanPropModel
326
327} // namespace ns3
328
329#endif /* UAN_PROP_MODEL_H */
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Holds PDP Tap information (amplitude and delay)
Time m_delay
The time delay.
std::complex< double > GetAmp() const
Get the complex amplitude of arrival.
Tap()
Default constructor.
Time GetDelay() const
Get the delay time, usually from first arrival of signal.
std::complex< double > m_amplitude
The amplitude.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
The power delay profile returned by propagation models.
static UanPdp CreateImpulsePdp()
Get a unit impulse PDP at time 0.
Iterator GetEnd() const
Get the end of the tap list (one beyond the last entry).
void SetResolution(Time resolution)
Set the time duration (resolution) between arrivals.
UanPdp NormalizeToSumNc() const
Creates a new UanPdp normalized to its non coherent sum.
friend std::istream & operator>>(std::istream &is, UanPdp &pdp)
Reads in list of arrivals from stream is.
void SetTap(std::complex< double > arrival, uint32_t index)
Set the arrival value for a tap.
std::vector< Tap > m_taps
The vector of Taps.
double SumTapsFromMaxNc(Time delay, Time duration) const
Compute the non-coherent sum of tap amplitudes starting after a delay from the maximum amplitude for ...
std::vector< Tap >::const_iterator Iterator
Convenience iterator typedef.
void SetNTaps(uint32_t nTaps)
Resize the tap vector.
Time GetResolution() const
Get the delay time resolution (time duration between arrivals).
UanPdp()
Create empty PDP object.
double SumTapsNc(Time begin, Time end) const
Compute the non-coherent sum of tap amplitudes between a start and end time.
Time m_resolution
The time resolution.
uint32_t GetNTaps() const
Get the number of taps.
const Tap & GetTap(uint32_t i) const
Get the Tap at the specified delay index.
friend std::ostream & operator<<(std::ostream &os, const UanPdp &pdp)
Writes PDP to stream as list of arrivals.
Iterator GetBegin() const
Get the beginning of the tap vector.
std::complex< double > SumTapsC(Time begin, Time end) const
Compute the coherent sum of tap amplitudes between a start and end time.
std::complex< double > SumTapsFromMaxC(Time delay, Time duration) const
Compute the coherent sum of tap amplitudes starting after a delay from the maximum amplitude for a to...
~UanPdp()
Dummy destructor, see DoDispose.
Base class for implemented underwater propagation models.
virtual Time GetDelay(Ptr< MobilityModel > a, Ptr< MobilityModel > b, UanTxMode mode)=0
Finds propagation delay between nodes a and b.
virtual void Clear()
Clear all pointer references.
virtual UanPdp GetPdp(Ptr< MobilityModel > a, Ptr< MobilityModel > b, UanTxMode mode)=0
Get the PDP for the path between two nodes.
virtual double GetPathLossDb(Ptr< MobilityModel > a, Ptr< MobilityModel > b, UanTxMode txMode)=0
Computes pathloss between nodes a and b.
static TypeId GetTypeId()
Register this type.
void DoDispose() override
Destructor implementation.
Abstraction of packet modulation information.
Definition: uan-tx-mode.h:43
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:159
std::istream & operator>>(std::istream &is, Angles &a)
Definition: angles.cc:183