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;
107 for (Bands::const_iterator myIt =
Begin ();
111 for (Bands::const_iterator otherIt = other.
Begin ();
112 otherIt != other.
End ();
size_t GetNumBands() const
uint32_t SpectrumModelUid_t
Uid for SpectrumModels.
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.
bool IsOrthogonal(const SpectrumModel &other) const
Check if another SpectrumModels has bands orthogonal to our bands.
Set of frequency values implementing the domain of the functions in the Function Space defined by Spe...
std::vector< BandInfo > Bands
Container of BandInfo.
SpectrumModelUid_t GetUid() const
double fc
center frequency
static SpectrumModelUid_t m_uidCount
counter to assign m_uids
Bands::const_iterator Begin() const
Const Iterator to the model Bands container start.
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)
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.
Bands::const_iterator End() const
Const Iterator to the model Bands container end.