5G-LENA  nr-v3.0-29-g83cc959
The 5G/NR module for the ns-3 simulator
ns3::NrMacSchedulerUeInfoPF Class Reference

UE representation for a proportional fair scheduler. More...

#include "nr-mac-scheduler-ue-info-pf.h"

+ Inheritance diagram for ns3::NrMacSchedulerUeInfoPF:
+ Collaboration diagram for ns3::NrMacSchedulerUeInfoPF:

Public Member Functions

 NrMacSchedulerUeInfoPF (float alpha, uint16_t rnti, BeamId beamId, const GetRbPerRbgFn &fn)
 NrMacSchedulerUeInfoPF constructor. More...
 
void CalculatePotentialTPutDl (const NrMacSchedulerNs3::FTResources &assignableInIteration, const Ptr< const NrAmc > &amc)
 Calculate the Potential throughput for downlink. More...
 
void CalculatePotentialTPutUl (const NrMacSchedulerNs3::FTResources &assignableInIteration, const Ptr< const NrAmc > &amc)
 Calculate the Potential throughput for uplink. More...
 
void ResetDlMetric () override
 Reset the DL avg Th to the last value.
 
void ResetDlSchedInfo () override
 Reset DL PF scheduler info. More...
 
void ResetUlMetric () override
 Reset the UL avg Th to the last value.
 
void ResetUlSchedInfo () override
 Reset UL PF scheduler info. More...
 
void UpdateDlPFMetric (const NrMacSchedulerNs3::FTResources &totAssigned, double timeWindow, const Ptr< const NrAmc > &amc)
 Update the PF metric for downlink. More...
 
void UpdateUlPFMetric (const NrMacSchedulerNs3::FTResources &totAssigned, double timeWindow, const Ptr< const NrAmc > &amc)
 Update the PF metric for uplink. More...
 
- Public Member Functions inherited from ns3::NrMacSchedulerUeInfo
 NrMacSchedulerUeInfo ()=delete
 Default Constructor (deleted)
 
 NrMacSchedulerUeInfo (uint16_t rnti, BeamId beamId, const GetRbPerRbgFn &fn)
 Create a new UE representation. More...
 
virtual ~NrMacSchedulerUeInfo ()
 ~NrMacSchedulerUeInfo deconstructor
 
virtual void UpdateDlMetric (const Ptr< const NrAmc > &amc)
 Update DL metrics after resources have been assigned. More...
 
virtual void UpdateUlMetric (const Ptr< const NrAmc > &amc)
 Update UL metrics after resources have been assigned. More...
 

Static Public Member Functions

static bool CompareUeWeightsDl (const NrMacSchedulerNs3::UePtrAndBufferReq &lue, const NrMacSchedulerNs3::UePtrAndBufferReq &rue)
 comparison function object (i.e. an object that satisfies the requirements of Compare) which returns ​true if the first argument is less than (i.e. is ordered before) the second. More...
 
static bool CompareUeWeightsUl (const NrMacSchedulerNs3::UePtrAndBufferReq &lue, const NrMacSchedulerNs3::UePtrAndBufferReq &rue)
 comparison function object (i.e. an object that satisfies the requirements of Compare) which returns ​true if the first argument is less than (i.e. is ordered before) the second. More...
 
- Static Public Member Functions inherited from ns3::NrMacSchedulerUeInfo
static NrMacHarqVectorGetDlHarqVector (const UePtr &ue)
 GetDlHarqVector. More...
 
static std::unordered_map< uint8_t, LCGPtr > & GetDlLCG (const UePtr &ue)
 GetDlLCG. More...
 
static uint8_t & GetDlMcs (const UePtr &ue)
 GetDlMcs. More...
 
static uint32_t & GetDlRBG (const UePtr &ue)
 GetDlRBG. More...
 
static uint8_t & GetDlSym (const UePtr &ue)
 GetDlSym. More...
 
static uint32_t & GetDlTBS (const UePtr &ue)
 GetDlTBS. More...
 
static NrMacHarqVectorGetUlHarqVector (const UePtr &ue)
 GetUlHarqVector. More...
 
static std::unordered_map< uint8_t, LCGPtr > & GetUlLCG (const UePtr &ue)
 GetUlLCG. More...
 
static uint8_t & GetUlMcs (const UePtr &ue)
 GetUlMcs. More...
 
static uint32_t & GetUlRBG (const UePtr &ue)
 GetUlRBG. More...
 
static uint8_t & GetUlSym (const UePtr &ue)
 GetUlSym. More...
 
static uint32_t & GetUlTBS (const UePtr &ue)
 GetUlTBS. More...
 
static void PrintLcInfo (uint16_t ue, uint8_t lcgId, uint8_t lcId, uint8_t cqi, uint8_t P, uint8_t minP)
 Prints information related to the QCI of a UEs LC. More...
 

Public Attributes

float m_alpha {0.0}
 PF fairness metric.
 
double m_avgTputDl {0.0}
 Average throughput in downlink during all the slots.
 
double m_avgTputUl {0.0}
 Average throughput in uplink during all the slots.
 
double m_currTputDl {0.0}
 Current slot throughput in downlink.
 
double m_currTputUl {0.0}
 Current slot throughput in uplink.
 
double m_lastAvgTputDl {0.0}
 Last average throughput in downlink.
 
double m_lastAvgTputUl {0.0}
 Last average throughput in uplink.
 
double m_potentialTputDl {0.0}
 
double m_potentialTputUl {0.0}
 
- Public Attributes inherited from ns3::NrMacSchedulerUeInfo
BeamId m_beamId
 Beam ID of the UE (kept updated as much as possible by MAC)
 
CqiInfo m_dlCqi
 DL CQI information.
 
NrMacHarqVector m_dlHarq
 HARQ process vector for DL.
 
std::unordered_map< uint8_t, LCGPtrm_dlLCG
 DL LCG.
 
uint8_t m_dlMcs {0}
 DL MCS.
 
uint32_t m_dlMRBRetx {0}
 
Ptr< const ComplexMatrixArray > m_dlPrecMats {nullptr}
 DL Precoding matrices.
 
uint8_t m_dlRank {1}
 DL rank (number of MIMO layers)
 
uint32_t m_dlRBG {0}
 DL Resource Block Group assigned in this slot.
 
uint8_t m_dlSym {0}
 Number of (new data) symbols assigned in this slot.
 
uint32_t m_dlTbSize {0}
 
uint16_t m_rnti {0}
 RNTI of the UE.
 
uint32_t m_srsOffset {0}
 SRS offset.
 
uint32_t m_srsPeriodicity {0}
 SRS periodicity.
 
uint8_t m_startMcsDlUe {0}
 Starting DL MCS to be used.
 
CqiInfo m_ulCqi
 UL CQI information.
 
NrMacHarqVector m_ulHarq
 HARQ process vector for UL.
 
std::unordered_map< uint8_t, LCGPtrm_ulLCG
 UL LCG.
 
uint8_t m_ulMcs {0}
 UL MCS.
 
uint32_t m_ulMRBRetx {0}
 
Ptr< const ComplexMatrixArray > m_ulPrecMats {nullptr}
 UL Precoding matrices.
 
uint8_t m_ulRank {1}
 UL rank (number of MIMO layers)
 
uint32_t m_ulRBG {0}
 UL Resource Block Group assigned in this slot.
 
uint8_t m_ulSym {0}
 Number of (new data) symbols assigned in this slot.
 
uint32_t m_ulTbSize {0}
 

Additional Inherited Members

- Public Types inherited from ns3::NrMacSchedulerUeInfo
typedef std::function< NrMacHarqVector &(const UePtr &ue)> GetHarqVectorFn
 
typedef std::function< std::unordered_map< uint8_t, LCGPtr > &(const UePtr &ue)> GetLCGFn
 
typedef std::function< uint32_t()> GetRbPerRbgFn
 
- Protected Member Functions inherited from ns3::NrMacSchedulerUeInfo
uint32_t GetNumRbPerRbg () const
 Retrieve the number of RB per RBG. More...
 

Detailed Description

UE representation for a proportional fair scheduler.

The representation stores the current throughput, the average throughput, and the last average throughput, as well as providing comparison functions to sort the UEs in case of a PF scheduler.

See also
CompareUeWeightsDl
CompareUeWeightsUl

Definition at line 25 of file nr-mac-scheduler-ue-info-pf.h.

Constructor & Destructor Documentation

◆ NrMacSchedulerUeInfoPF()

ns3::NrMacSchedulerUeInfoPF::NrMacSchedulerUeInfoPF ( float  alpha,
uint16_t  rnti,
BeamId  beamId,
const GetRbPerRbgFn &  fn 
)
inline

NrMacSchedulerUeInfoPF constructor.

Parameters
rntiRNTI of the UE
beamIdBeam ID of the UE
fnA function that tells how many RB per RBG

Definition at line 34 of file nr-mac-scheduler-ue-info-pf.h.

Member Function Documentation

◆ CalculatePotentialTPutDl()

void ns3::NrMacSchedulerUeInfoPF::CalculatePotentialTPutDl ( const NrMacSchedulerNs3::FTResources assignableInIteration,
const Ptr< const NrAmc > &  amc 
)

Calculate the Potential throughput for downlink.

Parameters
assignableInIterationresources assignable
amca pointer to the AMC

Definition at line 59 of file nr-mac-scheduler-ue-info-pf.cc.

References ns3::NrMacSchedulerUeInfo::GetNumRbPerRbg(), m_avgTputDl, ns3::NrMacSchedulerUeInfo::m_dlMcs, ns3::NrMacSchedulerUeInfo::m_dlRank, m_lastAvgTputDl, m_potentialTputDl, ns3::NrMacSchedulerNs3::PointInFTPlane::m_rbg, ns3::NrMacSchedulerUeInfo::m_rnti, and ns3::NrMacSchedulerNs3::PointInFTPlane::m_sym.

+ Here is the call graph for this function:

◆ CalculatePotentialTPutUl()

void ns3::NrMacSchedulerUeInfoPF::CalculatePotentialTPutUl ( const NrMacSchedulerNs3::FTResources assignableInIteration,
const Ptr< const NrAmc > &  amc 
)

Calculate the Potential throughput for uplink.

Parameters
assignableInIterationresources assignable
amca pointer to the AMC

Definition at line 75 of file nr-mac-scheduler-ue-info-pf.cc.

References ns3::NrMacSchedulerUeInfo::GetNumRbPerRbg(), m_avgTputUl, m_lastAvgTputUl, m_potentialTputUl, ns3::NrMacSchedulerNs3::PointInFTPlane::m_rbg, ns3::NrMacSchedulerUeInfo::m_rnti, ns3::NrMacSchedulerNs3::PointInFTPlane::m_sym, ns3::NrMacSchedulerUeInfo::m_ulMcs, and ns3::NrMacSchedulerUeInfo::m_ulRank.

+ Here is the call graph for this function:

◆ CompareUeWeightsDl()

static bool ns3::NrMacSchedulerUeInfoPF::CompareUeWeightsDl ( const NrMacSchedulerNs3::UePtrAndBufferReq lue,
const NrMacSchedulerNs3::UePtrAndBufferReq rue 
)
inlinestatic

comparison function object (i.e. an object that satisfies the requirements of Compare) which returns ​true if the first argument is less than (i.e. is ordered before) the second.

Parameters
lueLeft UE
rueRight UE
Returns
true if the PF metric of the left UE is higher than the right UE

The PF metric is calculated as following:

$ pfMetric_{i} = std::pow(potentialTPut_{i}, alpha) / std::max (1E-9, m_avgTput_{i}) $

Alpha is a fairness metric. Please note that the throughput is calculated in bit/symbol.

Definition at line 151 of file nr-mac-scheduler-ue-info-pf.h.

Referenced by ns3::NrMacSchedulerOfdmaPF::GetUeCompareDlFn(), and ns3::NrMacSchedulerTdmaPF::GetUeCompareDlFn().

+ Here is the caller graph for this function:

◆ CompareUeWeightsUl()

static bool ns3::NrMacSchedulerUeInfoPF::CompareUeWeightsUl ( const NrMacSchedulerNs3::UePtrAndBufferReq lue,
const NrMacSchedulerNs3::UePtrAndBufferReq rue 
)
inlinestatic

comparison function object (i.e. an object that satisfies the requirements of Compare) which returns ​true if the first argument is less than (i.e. is ordered before) the second.

Parameters
lueLeft UE
rueRight UE
Returns
true if the PF metric of the left UE is higher than the right UE

The PF metric is calculated as following:

$ pfMetric_{i} = std::pow(potentialTPut_{i}, alpha) / std::max (1E-9, m_avgTput_{i}) $

Alpha is a fairness metric. Please note that the throughput is calculated in bit/symbol.

Definition at line 180 of file nr-mac-scheduler-ue-info-pf.h.

Referenced by ns3::NrMacSchedulerOfdmaPF::GetUeCompareUlFn(), and ns3::NrMacSchedulerTdmaPF::GetUeCompareUlFn().

+ Here is the caller graph for this function:

◆ ResetDlSchedInfo()

void ns3::NrMacSchedulerUeInfoPF::ResetDlSchedInfo ( )
inlineoverridevirtual

Reset DL PF scheduler info.

Set the last average throughput to the current average throughput, and zeroes the average throughput as well as the current throughput.

It calls also NrMacSchedulerUeInfo::ResetDlSchedInfo.

Reimplemented from ns3::NrMacSchedulerUeInfo.

Definition at line 48 of file nr-mac-scheduler-ue-info-pf.h.

References m_avgTputDl, m_currTputDl, m_lastAvgTputDl, m_potentialTputDl, and ns3::NrMacSchedulerUeInfo::ResetDlSchedInfo().

+ Here is the call graph for this function:

◆ ResetUlSchedInfo()

void ns3::NrMacSchedulerUeInfoPF::ResetUlSchedInfo ( )
inlineoverridevirtual

Reset UL PF scheduler info.

Set the last average throughput to the current average throughput, and zeroes the average throughput as well as the current throughput.

It also calls NrMacSchedulerUeInfo::ResetUlSchedInfo.

Reimplemented from ns3::NrMacSchedulerUeInfo.

Definition at line 65 of file nr-mac-scheduler-ue-info-pf.h.

References m_avgTputUl, m_currTputUl, m_lastAvgTputUl, m_potentialTputUl, and ns3::NrMacSchedulerUeInfo::ResetUlSchedInfo().

+ Here is the call graph for this function:

◆ UpdateDlPFMetric()

void ns3::NrMacSchedulerUeInfoPF::UpdateDlPFMetric ( const NrMacSchedulerNs3::FTResources totAssigned,
double  timeWindow,
const Ptr< const NrAmc > &  amc 
)

Update the PF metric for downlink.

Parameters
totAssignedthe resources assigned
timeWindowthe time window
amca pointer to the AMC

Updates m_currTputDl and m_avgTputDl by keeping in consideration the assigned resources (in form of TBS) and the time window. It gets the tbSize by calling NrMacSchedulerUeInfo::UpdateDlMetric.

Definition at line 17 of file nr-mac-scheduler-ue-info-pf.cc.

References m_avgTputDl, m_currTputDl, ns3::NrMacSchedulerUeInfo::m_dlTbSize, m_lastAvgTputDl, m_potentialTputDl, ns3::NrMacSchedulerUeInfo::m_rnti, ns3::NrMacSchedulerNs3::PointInFTPlane::m_sym, and ns3::NrMacSchedulerUeInfo::UpdateDlMetric().

+ Here is the call graph for this function:

◆ UpdateUlPFMetric()

void ns3::NrMacSchedulerUeInfoPF::UpdateUlPFMetric ( const NrMacSchedulerNs3::FTResources totAssigned,
double  timeWindow,
const Ptr< const NrAmc > &  amc 
)

Update the PF metric for uplink.

Parameters
totAssignedthe resources assigned
timeWindowthe time window
amca pointer to the AMC

Updates m_currTputUl and m_avgTputUl by keeping in consideration the assigned resources (in form of TBS) and the time window. It gets the tbSize by calling NrMacSchedulerUeInfo::UpdateUlMetric.

Definition at line 38 of file nr-mac-scheduler-ue-info-pf.cc.

References m_avgTputUl, m_currTputUl, m_lastAvgTputUl, m_potentialTputUl, ns3::NrMacSchedulerUeInfo::m_rnti, ns3::NrMacSchedulerNs3::PointInFTPlane::m_sym, ns3::NrMacSchedulerUeInfo::m_ulTbSize, and ns3::NrMacSchedulerUeInfo::UpdateUlMetric().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_potentialTputDl

double ns3::NrMacSchedulerUeInfoPF::m_potentialTputDl {0.0}

Potential throughput in downlink in one assignable resource (can be a symbol or a RBG)

Definition at line 197 of file nr-mac-scheduler-ue-info-pf.h.

Referenced by CalculatePotentialTPutDl(), ResetDlSchedInfo(), and UpdateDlPFMetric().

◆ m_potentialTputUl

double ns3::NrMacSchedulerUeInfoPF::m_potentialTputUl {0.0}

Potential throughput in uplink in one assignable resource (can be a symbol or a RBG)

Definition at line 204 of file nr-mac-scheduler-ue-info-pf.h.

Referenced by CalculatePotentialTPutUl(), ResetUlSchedInfo(), and UpdateUlPFMetric().


The documentation for this class was generated from the following files: