A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
uan-prop-model.h
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_H
22 #define UAN_PROP_MODEL_H
23 
24 #include "ns3/object.h"
25 #include "ns3/mobility-model.h"
26 #include "ns3/nstime.h"
27 
28 
29 #include <vector>
30 #include <complex>
31 #include <utility>
32 
33 namespace ns3 {
34 
35 class UanTxMode;
36 
41 class Tap
42 {
43 public:
47  Tap ();
52  Tap (Time delay, std::complex<double> amp);
56  std::complex<double> GetAmp (void) const;
60  Time GetDelay (void) const;
61 
62 private:
63  std::complex<double> m_amplitude;
64  Time m_delay;
65 };
66 
83 class UanPdp
84 {
85 public:
89  typedef std::vector<Tap>::const_iterator Iterator;
93  UanPdp ();
99  UanPdp (std::vector<Tap> taps, Time resolution);
105  UanPdp (std::vector<std::complex<double > > arrivals, Time resolution);
111  UanPdp (std::vector<double> arrivals, Time resolution);
112  ~UanPdp ();
113 
118  void SetTap (std::complex<double> arrival, uint32_t index);
122  void SetNTaps (uint32_t nTaps);
126  void SetResolution (Time resolution);
130  Iterator GetBegin (void) const;
134  Iterator GetEnd (void) const;
138  uint32_t GetNTaps (void) const;
143  const Tap &GetTap (uint32_t i) const;
147  Time GetResolution (void) const;
158  double SumTapsNc (Time begin, Time end) const;
169  std::complex<double> SumTapsC (Time begin, Time end) const;
179  double SumTapsFromMaxNc (Time delay, Time duration) const;
189  std::complex<double> SumTapsFromMaxC (Time delay, Time duration) const;
190 
194  static UanPdp CreateImpulsePdp (void);
195 private:
196  friend std::ostream &operator<< (std::ostream &os, UanPdp &pdp);
197  friend std::istream &operator>> (std::istream &is, UanPdp &pdp);
198  std::vector<Tap> m_taps;
199  Time m_resolution;
200 
201 };
205 std::ostream &operator<< (std::ostream &os, UanPdp &pdp);
209 std::istream &operator>> (std::ostream &is, UanPdp &pdp);
210 
216 class UanPropModel : public Object
217 {
218 public:
219  static TypeId GetTypeId (void);
220 
228  virtual double GetPathLossDb (Ptr<MobilityModel> a, Ptr<MobilityModel> b, UanTxMode txMode) = 0;
229 
245 
249  virtual void Clear (void);
250 
251  virtual void DoDispose (void);
252 };
253 
254 }
255 
256 #endif /* UAN_PROP_MODEL_H */
Holds PDP Tap information (amplitude and delay)
std::istream & operator>>(std::istream &is, Angles &a)
Definition: angles.cc:49
std::complex< double > SumTapsC(Time begin, Time end) const
keep track of time unit.
Definition: nstime.h:149
std::vector< Tap >::const_iterator Iterator
Iterator is a standard template library constant interator.
uint32_t GetNTaps(void) const
static UanPdp CreateImpulsePdp(void)
virtual void Clear(void)
double SumTapsFromMaxNc(Time delay, Time duration) const
virtual UanPdp GetPdp(Ptr< MobilityModel > a, Ptr< MobilityModel > b, UanTxMode mode)=0
UanPdp()
Create empty PDP object.
friend std::ostream & operator<<(std::ostream &os, UanPdp &pdp)
Writes PDP to stream as list of arrivals.
void SetTap(std::complex< double > arrival, uint32_t index)
virtual Time GetDelay(Ptr< MobilityModel > a, Ptr< MobilityModel > b, UanTxMode mode)=0
std::complex< double > GetAmp(void) const
Abstraction of packet modulation information.
Definition: uan-tx-mode.h:36
void SetResolution(Time resolution)
void SetNTaps(uint32_t nTaps)
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:43
Time GetDelay(void) const
Time GetResolution(void) const
Iterator GetEnd(void) const
virtual void DoDispose(void)
std::complex< double > SumTapsFromMaxC(Time delay, Time duration) const
a base class which provides memory management and object aggregation
Definition: object.h:63
Iterator GetBegin(void) const
const Tap & GetTap(uint32_t i) const
double SumTapsNc(Time begin, Time end) const
virtual double GetPathLossDb(Ptr< MobilityModel > a, Ptr< MobilityModel > b, UanTxMode txMode)=0
a unique identifier for an interface.
Definition: type-id.h:44