Set of frequency values implementing the domain of the functions in the Function Space defined by SpectrumValue. More...
#include "spectrum-model.h"
Public Member Functions | |
SpectrumModel (Bands &&bands) | |
This constructs a SpectrumModel based on the explicit values of center frequencies and boundaries of each subband. More... | |
SpectrumModel (const Bands &bands) | |
This constructs a SpectrumModel based on the explicit values of center frequencies and boundaries of each subband. More... | |
SpectrumModel (const std::vector< double > ¢erFreqs) | |
This constructs a SpectrumModel based on a given set of frequencies, which is assumed to be sorted by increasing frequency. More... | |
Bands::const_iterator | Begin () const |
Const Iterator to the model Bands container start. More... | |
Bands::const_iterator | End () const |
Const Iterator to the model Bands container end. More... | |
size_t | GetNumBands () const |
SpectrumModelUid_t | GetUid () const |
bool | IsOrthogonal (const SpectrumModel &other) const |
Check if another SpectrumModels has bands orthogonal to our bands. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< SpectrumModel > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= ([[maybe_unused]] const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Private Attributes | |
Bands | m_bands |
Actual definition of frequency bands within this SpectrumModel. More... | |
SpectrumModelUid_t | m_uid |
unique id for a given set of frequencies More... | |
Static Private Attributes | |
static SpectrumModelUid_t | m_uidCount = 0 |
counter to assign m_uids More... | |
Friends | |
bool | operator== (const SpectrumModel &lhs, const SpectrumModel &rhs) |
Comparison operator. More... | |
Set of frequency values implementing the domain of the functions in the Function Space defined by SpectrumValue.
Frequency values are in Hz. It is intended that frequency values are non-negative, though this is not enforced.
Definition at line 71 of file spectrum-model.h.
ns3::SpectrumModel::SpectrumModel | ( | const std::vector< double > & | centerFreqs | ) |
This constructs a SpectrumModel based on a given set of frequencies, which is assumed to be sorted by increasing frequency.
The lower (resp. upper) frequency band limit is determined as the mean value between the center frequency of the considered band and the center frequency of the adjacent lower (resp. upper) band.
centerFreqs | the vector of center frequencies. |
Definition at line 41 of file spectrum-model.cc.
References ns3::BandInfo::fc, ns3::BandInfo::fh, ns3::BandInfo::fl, m_bands, m_uid, m_uidCount, and NS_ASSERT.
ns3::SpectrumModel::SpectrumModel | ( | const Bands & | bands | ) |
This constructs a SpectrumModel based on the explicit values of center frequencies and boundaries of each subband.
bands | the vector of bands for this model |
Definition at line 73 of file spectrum-model.cc.
References m_bands, m_uid, m_uidCount, and NS_LOG_INFO.
ns3::SpectrumModel::SpectrumModel | ( | Bands && | bands | ) |
This constructs a SpectrumModel based on the explicit values of center frequencies and boundaries of each subband.
This is used if bands is an rvalue.
bands | the vector of bands for this model |
Definition at line 80 of file spectrum-model.cc.
References m_uid, m_uidCount, and NS_LOG_INFO.
Bands::const_iterator ns3::SpectrumModel::Begin | ( | void | ) | const |
Const Iterator to the model Bands container start.
Definition at line 88 of file spectrum-model.cc.
References m_bands.
Referenced by ns3::SpectrumConverter::SpectrumConverter(), ns3::SpectrumValue::ConstBandsBegin(), IsOrthogonal(), and Bug2843TestCase::StoreDistinctTuple().
Bands::const_iterator ns3::SpectrumModel::End | ( | void | ) | const |
Const Iterator to the model Bands container end.
Definition at line 94 of file spectrum-model.cc.
References m_bands.
Referenced by ns3::SpectrumConverter::SpectrumConverter(), ns3::SpectrumValue::ConstBandsEnd(), and IsOrthogonal().
size_t ns3::SpectrumModel::GetNumBands | ( | ) | const |
Definition at line 100 of file spectrum-model.cc.
References m_bands.
Referenced by ns3::WifiSpectrumValueHelper::CreateDsssTxPowerSpectralDensity(), ns3::WifiSpectrumValueHelper::CreateHeMuOfdmTxPowerSpectralDensity(), ns3::WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity(), ns3::WifiSpectrumValueHelper::CreateHtOfdmTxPowerSpectralDensity(), ns3::WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity(), ns3::WifiSpectrumValueHelper::CreateSpectrumMaskForOfdm(), ns3::SpectrumWifiPhy::GetBand(), and Bug2843TestCase::StoreDistinctTuple().
SpectrumModelUid_t ns3::SpectrumModel::GetUid | ( | void | ) | const |
Definition at line 106 of file spectrum-model.cc.
References m_uid.
Referenced by ns3::MultiModelSpectrumChannel::AddRx(), ns3::MultiModelSpectrumChannel::FindAndEventuallyAddTxSpectrumModel(), ns3::WifiSpectrumValueHelper::GetSpectrumModel(), ns3::LteSpectrumValueHelper::GetSpectrumModel(), ns3::SpectrumValue::GetSpectrumModelUid(), and ns3::PhyEntity::Transmit().
bool ns3::SpectrumModel::IsOrthogonal | ( | const SpectrumModel & | other | ) | const |
Check if another SpectrumModels has bands orthogonal to our bands.
other | another SpectrumModel |
Definition at line 112 of file spectrum-model.cc.
References Begin(), End(), max, and min.
Referenced by ns3::MultiModelSpectrumChannel::AddRx(), and ns3::MultiModelSpectrumChannel::FindAndEventuallyAddTxSpectrumModel().
|
friend |
Comparison operator.
Returns true if the two SpectumModels are identical
lhs | left operand |
rhs | right operand |
Definition at line 34 of file spectrum-model.cc.
|
private |
Actual definition of frequency bands within this SpectrumModel.
Definition at line 146 of file spectrum-model.h.
Referenced by SpectrumModel(), Begin(), End(), and GetNumBands().
|
private |
unique id for a given set of frequencies
Definition at line 147 of file spectrum-model.h.
Referenced by SpectrumModel(), and GetUid().
|
staticprivate |
counter to assign m_uids
Definition at line 148 of file spectrum-model.h.
Referenced by SpectrumModel().