24 #include <ns3/spectrum-model.h>
26 #include <ns3/assert.h>
46 for (std::vector<double>::const_iterator it = centerFreqs.begin ();
47 it != centerFreqs.end ();
52 if (it == centerFreqs.begin ())
54 double delta = ((*(it + 1)) - (*it)) / 2;
58 else if (it == centerFreqs.end () - 1 )
60 double delta = ((*it) - (*(it - 1))) / 2;
66 e.
fl = ((*it) + (*(it - 1))) / 2;
67 e.
fh = ((*(it + 1)) + (*it)) / 2;
uint32_t SpectrumModelUid_t
size_t GetNumBands() const
SpectrumModelUid_t m_uid
unique id for a given set of frequencies
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Set of frequency values implementing the domain of the functions in the Function Space defined by Spe...
std::vector< BandInfo > Bands
Bands::const_iterator End() const
SpectrumModelUid_t GetUid() const
double fc
center frequency
static SpectrumModelUid_t m_uidCount
counter to assign m_uids
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double fl
lower limit of subband
Bands m_bands
actual definition of frequency bands within this SpectrumModel
bool operator==(const EventId &a, const EventId &b)
Bands::const_iterator Begin() const
double fh
upper limit of subband
SpectrumModel(std::vector< double > centerFreqs)
This constructs a SpectrumModel based on a given set of frequencies, which is assumed to be sorted by...
The building block of a SpectrumModel.