17    : m_channelWidth(channelWidth),
 
 
   27    const auto lhsStartTone =
 
   34    const auto rhsStartTone =
 
   41    return lhsStartTone < rhsStartTone;
 
 
   47    return std::visit([&](
auto&& ru) { 
return ru.GetRuType(); }, ruVariant);
 
 
   53    return std::visit([&](
auto&& ru) { 
return ru.GetIndex(); }, ruVariant);
 
 
   59    return std::visit([&](
auto&& ru) { 
return ru.GetPhyIndex(bw, p20Index); }, ruVariant);
 
 
  107    switch (
static_cast<uint16_t
>(bandwidth))
 
 
  155std::vector<WifiRu::RuSpec>
 
  158    std::vector<RuSpec> ruSpecs;
 
  162        std::copy(heRuSpecs.begin(), heRuSpecs.end(), std::back_inserter(ruSpecs));
 
  167        std::copy(ehtRuSpecs.begin(), ehtRuSpecs.end(), std::back_inserter(ruSpecs));
 
 
  172std::vector<WifiRu::RuSpec>
 
  175    std::vector<RuSpec> rus;
 
  179        std::copy(heRuSpecs.begin(), heRuSpecs.end(), std::back_inserter(rus));
 
  184        std::copy(ehtRuSpecs.begin(), ehtRuSpecs.end(), std::back_inserter(rus));
 
 
  189std::vector<WifiRu::RuSpec>
 
  192    std::vector<RuSpec> central26TonesRus;
 
  196        std::copy(heRuSpecs.begin(), heRuSpecs.end(), std::back_inserter(central26TonesRus));
 
  201        std::copy(ehtRuSpecs.begin(), ehtRuSpecs.end(), std::back_inserter(central26TonesRus));
 
  203    return central26TonesRus;
 
 
  211        std::vector<HeRu::RuSpec> heRus;
 
  212        std::transform(v.cbegin(), v.cend(), std::back_inserter(heRus), [](
const auto& heRu) {
 
  213            return std::get<HeRu::RuSpec>(heRu);
 
  218    std::vector<EhtRu::RuSpec> ehtRus;
 
  219    std::transform(v.cbegin(), v.cend(), std::back_inserter(ehtRus), [](
const auto& ehtRu) {
 
  220        return std::get<EhtRu::RuSpec>(ehtRu);
 
 
  229                                                              std::get<HeRu::RuSpec>(referenceRu),
 
  232                                                               std::get<EhtRu::RuSpec>(referenceRu),
 
 
  238                                    std::size_t& nStations,
 
  239                                    std::size_t& nCentral26TonesRus,
 
 
  250    return std::holds_alternative<HeRu::RuSpec>(ru);
 
 
  256    return std::holds_alternative<EhtRu::RuSpec>(ru);
 
 
  262    std::visit([&os](
auto&& arg) { os << arg; }, ruVariant);
 
 
static bool DoesOverlap(MHz_u bw, RuSpec ru, const std::vector< RuSpec > &v)
Check whether the given RU overlaps with the given set of RUs.
static uint16_t GetEqualizedRuAllocation(RuType ruType, bool isOdd, bool hasUsers)
Get the RU_ALLOCATION value for equal size RUs.
static std::vector< RuSpec > GetRusOfType(MHz_u bw, RuType ruType)
Get the set of distinct RUs of the given type (number of tones) available in an PPDU of the given ban...
static std::vector< RuSpec > GetRuSpecs(uint16_t ruAllocation)
Get the RU specs based on RU_ALLOCATION.
static SubcarrierGroup GetSubcarrierGroup(MHz_u bw, RuType ruType, std::size_t phyIndex)
Get the subcarrier group of the RU having the given PHY index among all the RUs of the given type (nu...
static std::vector< RuSpec > GetCentral26TonesRus(MHz_u bw, RuType ruType)
Get the set of 26-tone RUs that can be additionally allocated if the given bandwidth is split in RUs ...
static RuSpec FindOverlappingRu(MHz_u bw, RuSpec referenceRu, RuType searchedRuType)
Find the RU allocation of the given RU type overlapping the given reference RU allocation.
static RuType GetEqualSizedRusForStations(MHz_u bandwidth, std::size_t &nStations, std::size_t &nCentral26TonesRus)
Given the channel bandwidth and the number of stations candidate for being assigned an RU,...
static std::size_t GetNRus(MHz_u bw, RuType ruType, bool includeUndefinedRus=false)
Get the number of distinct RUs of the given type (number of tones) available in a PPDU of the given b...
static std::vector< RuSpec > GetRuSpecs(uint16_t ruAllocation)
Get the RU specs based on RU_ALLOCATION.
static bool DoesOverlap(MHz_u bw, RuSpec ru, const std::vector< RuSpec > &v)
Check whether the given RU overlaps with the given set of RUs.
static std::vector< RuSpec > GetRusOfType(MHz_u bw, RuType ruType)
Get the set of distinct RUs of the given type (number of tones) available in a HE PPDU of the given b...
static SubcarrierGroup GetSubcarrierGroup(MHz_u bw, RuType ruType, std::size_t phyIndex)
Get the subcarrier group of the RU having the given PHY index among all the RUs of the given type (nu...
static RuSpec FindOverlappingRu(MHz_u bw, RuSpec referenceRu, RuType searchedRuType)
Find the RU allocation of the given RU type overlapping the given reference RU allocation.
static std::size_t GetNRus(MHz_u bw, RuType ruType)
Get the number of distinct RUs of the given type (number of tones) available in a HE PPDU of the give...
static RuType GetEqualSizedRusForStations(MHz_u bandwidth, std::size_t &nStations, std::size_t &nCentral26TonesRus)
Given the channel bandwidth and the number of stations candidate for being assigned an RU,...
static std::vector< RuSpec > GetCentral26TonesRus(MHz_u bw, RuType ruType)
Get the set of 26-tone RUs that can be additionally allocated if the given bandwidth is split in RUs ...
static uint16_t GetEqualizedRuAllocation(RuType ruType, bool isOdd, bool hasUsers)
Get the RU_ALLOCATION value for equal size RUs.
static std::vector< RuSpec > GetRuSpecs(uint16_t ruAllocation, WifiModulationClass mc)
Get the RU specs based on RU_ALLOCATION.
static std::size_t GetNRus(MHz_u bw, RuType ruType, WifiModulationClass mc)
Get the number of distinct RUs of the given type (number of tones) available in a PPDU of the given b...
std::variant< HeRu::RuSpec, EhtRu::RuSpec > RuSpec
variant of the RU specification
static std::vector< RuSpec > GetRusOfType(MHz_u bw, RuType ruType, WifiModulationClass mc)
Get the set of distinct RUs of the given type (number of tones) available in an MU PPDU of the given ...
static bool IsHe(RuSpec ru)
Get whether a given RU variant is a HE RU.
static RuSpec FindOverlappingRu(MHz_u bw, RuSpec referenceRu, RuType searchedRuType)
Find the RU allocation of the given RU type overlapping the given reference RU allocation.
static MHz_u GetBandwidth(RuType ruType)
Get the approximate bandwidth occupied by a RU.
static RuType GetEqualSizedRusForStations(MHz_u bandwidth, std::size_t &nStations, std::size_t &nCentral26TonesRus, WifiModulationClass mc)
Given the channel bandwidth and the number of stations candidate for being assigned an RU,...
static RuType GetRuType(RuSpec ru)
Get the type of a given RU.
static SubcarrierGroup GetSubcarrierGroup(MHz_u bw, RuType ruType, std::size_t phyIndex, WifiModulationClass mc)
Get the subcarrier group of the RU having the given PHY index among all the RUs of the given type (nu...
static std::vector< RuSpec > GetCentral26TonesRus(MHz_u bw, RuType ruType, WifiModulationClass mc)
Get the set of 26-tone RUs that can be additionally allocated if the given bandwidth is split in RUs ...
static bool DoesOverlap(MHz_u bw, RuSpec ru, const std::vector< RuSpec > &v)
Check whether the given RU overlaps with the given set of RUs.
static uint16_t GetEqualizedRuAllocation(RuType ruType, bool isOdd, bool hasUsers, WifiModulationClass mc)
Get the RU_ALLOCATION value for equal size RUs.
static std::size_t GetPhyIndex(RuSpec ru, MHz_u bw, uint8_t p20Index)
Get the RU PHY index.
static std::size_t GetIndex(RuSpec ru)
Get the index of a given RU.
static bool IsEht(RuSpec ru)
Get whether a given RU variant is a EHT RU.
static RuType GetMaxRuType(WifiModulationClass mc)
Get the maximum RU type supported by a given modulation class.
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
@ WIFI_MOD_CLASS_EHT
EHT (Clause 36)
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
RuType
The different Resource Unit (RU) types.
std::vector< SubcarrierRange > SubcarrierGroup
a vector of subcarrier ranges defining a subcarrier group
double MHz_u
MHz weak type.
RuSpecCompare(MHz_u channelWidth, uint8_t p20Index)
Constructor.
bool operator()(const RuSpec &lhs, const RuSpec &rhs) const
Function call operator.