22 #include "ns3/nstime.h"
36 for (; it != pdp.
m_taps.end (); it++)
38 os << (*it).GetAmp () <<
'|';
56 is >> resolution >> c1;
65 std::complex<double> amp;
66 pdp.
m_taps = std::vector<Tap> (ntaps);
67 for (uint32_t i = 0; i < ntaps && !is.eof (); i++)
75 pdp.
m_taps[i] =
Tap (Seconds (resolution * i), amp);
115 m_resolution (resolution)
120 : m_resolution (resolution)
122 m_taps.resize (amps.size ());
123 Time arrTime = Seconds (0);
124 for (uint32_t index = 0; index < amps.size (); index++)
126 m_taps[index] =
Tap (arrTime, amps[index]);
132 : m_resolution (resolution)
134 m_taps.resize (amps.size ());
135 Time arrTime = Seconds (0);
136 for (uint32_t index = 0; index < amps.size (); index++)
138 m_taps[index] =
Tap (arrTime, amps[index]);
151 if (
m_taps.size () <= index)
153 m_taps.resize (index + 1);
205 "UanPdp with resolution 0 and multiple taps");
207 return m_taps[0].GetAmp ();
212 uint32_t maxTapIndex = 0;
214 for (uint32_t i = 0; i <
GetNTaps (); i++)
216 if (std::abs (
m_taps[i].GetAmp ()) > maxAmp)
218 maxAmp = std::abs (
m_taps[i].GetAmp ());
223 uint32_t end = std::min (start + numTaps, GetNTaps ());
224 std::complex<double> sum = 0;
225 for (uint32_t i = start; i < end; i++)
227 sum +=
m_taps[i].GetAmp ();
237 "UanPdp with resolution 0 and multiple taps");
239 return std::abs (
m_taps[0].GetAmp ());
244 uint32_t maxTapIndex = 0;
246 for (uint32_t i = 0; i <
GetNTaps (); i++)
248 if (std::abs (
m_taps[i].GetAmp ()) > maxAmp)
250 maxAmp = std::abs (
m_taps[i].GetAmp ());
257 uint32_t end = std::min (start + numTaps, GetNTaps ());
259 for (uint32_t i = start; i < end; i++)
262 sum += std::abs (
m_taps[i].GetAmp ());
272 "UanPdp with resolution 0 and multiple taps");
274 if (begin <= Seconds (0.0) && end >= Seconds (0.0))
276 return std::abs (
m_taps[0].GetAmp ());
287 endIndex = std::min (endIndex,
GetNTaps ());
289 for (uint32_t i = stIndex; i < endIndex; i++)
291 sum += std::abs (
m_taps[i].GetAmp ());
305 "UanPdp with resolution 0 and multiple taps");
307 if (begin <= Seconds (0.0) && end >= Seconds (0.0))
309 return m_taps[0].GetAmp ();
313 return std::complex<double> (0.0);
320 endIndex = std::min (endIndex,
GetNTaps ());
322 std::complex<double> sum = 0;
323 for (uint32_t i = stIndex; i < endIndex; i++)
325 sum +=
m_taps[i].GetAmp ();
Holds PDP Tap information (amplitude and delay)
std::istream & operator>>(std::istream &is, Angles &a)
std::complex< double > SumTapsC(Time begin, Time end) const
keep track of time values and allow control of global simulation resolution
std::vector< Tap >::const_iterator Iterator
Iterator is a standard template library constant interator.
uint32_t GetNTaps(void) const
static UanPdp CreateImpulsePdp(void)
std::vector< Tap > m_taps
double SumTapsFromMaxNc(Time delay, Time duration) const
virtual void DoDispose(void)
UanPdp()
Create empty PDP object.
void SetTap(std::complex< double > arrival, uint32_t index)
#define NS_FATAL_ERROR(msg)
fatal error handling
double GetSeconds(void) const
NS_OBJECT_ENSURE_REGISTERED(AntennaModel)
std::complex< double > GetAmp(void) const
void SetResolution(Time resolution)
void SetNTaps(uint32_t nTaps)
std::ostream & operator<<(std::ostream &os, const Angles &a)
Time GetDelay(void) const
Time GetResolution(void) const
Iterator GetEnd(void) const
virtual void DoDispose(void)
#define NS_ASSERT_MSG(condition, message)
std::complex< double > SumTapsFromMaxC(Time delay, Time duration) const
a base class which provides memory management and object aggregation
Iterator GetBegin(void) const
const Tap & GetTap(uint32_t i) const
double SumTapsNc(Time begin, Time end) const
static TypeId GetTypeId(void)
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
std::complex< double > m_amplitude