9#include "nr-mac-harq-vector.h"
10#include "nr-mac-sched-sap.h"
11#include "nr-mac-scheduler-lcg.h"
13#include "ns3/matrix-array.h"
17#include <unordered_map>
22class NrMacSchedulerUeInfo;
26typedef std::shared_ptr<NrMacSchedulerUeInfo> UePtr;
60 typedef std::function<uint32_t()> GetRbPerRbgFn;
79 static std::vector<uint16_t>&
GetDlRBG(
const UePtr& ue);
85 static std::vector<uint16_t>&
GetUlRBG(
const UePtr& ue);
91 static std::vector<uint8_t>&
GetDlSym(
const UePtr& ue);
97 static std::vector<uint8_t>&
GetUlSym(
const UePtr& ue);
117 static uint8_t&
GetDlMcs(
const UePtr& ue);
123 static uint8_t&
GetUlMcs(
const UePtr& ue);
129 static uint32_t&
GetDlTBS(
const UePtr& ue);
138 return ue->m_ulTbSize;
146 static std::unordered_map<uint8_t, LCGPtr>&
GetDlLCG(
const UePtr& ue);
152 static std::unordered_map<uint8_t, LCGPtr>&
GetUlLCG(
const UePtr& ue);
182 typedef std::function<std::unordered_map<uint8_t, LCGPtr>&(
const UePtr& ue)> GetLCGFn;
183 typedef std::function<
NrMacHarqVector&(
const UePtr& ue)> GetHarqVectorFn;
233 uint32_t GetTotalDlBuffer()
const;
256 void ReleaseLC(uint8_t lcid);
274 std::optional<uint8_t>
323 const GetRbPerRbgFn m_getNumRbPerRbg;
Representation of a beam id.
Data structure to save all the HARQ process of an UE.
The representation of an user for any Mac scheduler.
std::vector< uint16_t > m_ulRBG
UL Resource Block Group assigned in this slot.
std::vector< uint16_t > m_dlRBG
DL Resource Block Group assigned in this slot.
static uint32_t & GetUlTBS(const UePtr &ue)
GetUlTBS.
uint32_t GetNumRbPerRbg() const
Retrieve the number of RB per RBG.
static std::vector< uint8_t > & GetUlSym(const UePtr &ue)
GetUlSym.
Ptr< NrAmc > m_dlAmc
AMC instance of scheduler associated with DL.
uint32_t m_srsOffset
SRS offset.
virtual void ResetDlSchedInfo()
Reset DL information.
uint8_t m_ulRank
UL rank (number of MIMO layers)
virtual void ResetUlMetric()
ResetUlMetric.
virtual void UpdateUlMetric()
Update UL metrics after resources have been assigned.
virtual void ResetDlMetric()
ResetDlMetric.
std::vector< uint8_t > m_rbgToSb
Precomputed RBG to SB mapping.
static std::unordered_map< uint8_t, LCGPtr > & GetUlLCG(const UePtr &ue)
GetUlLCG.
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.
static std::vector< uint16_t > & GetUlRBG(const UePtr &ue)
GetUlRBG.
static NrMacHarqVector & GetUlHarqVector(const UePtr &ue)
GetUlHarqVector.
uint8_t m_dlRank
DL rank (number of MIMO layers)
@ AVG_MCS
Estimate MCS based on the average MCS of allocated RBGs.
@ AVG_SPEC_EFF
Estimate MCS based on the average spectral efficiency of allocated RBGs.
@ AVG_SINR
Estimate MCS based on the average SINR of allocated RBGs.
@ WIDEBAND_MCS
Wideband MCS.
NrMacHarqVector m_dlHarq
HARQ process vector for DL.
std::vector< uint8_t > m_ulSym
Corresponding symbol of m_ulRBG in this slot.
static std::vector< uint16_t > & GetDlRBG(const UePtr &ue)
GetDlRBG.
std::optional< uint8_t > m_fhMaxMcsAssignable
Maximum DL MCS assignable due to FH limitations.
Ptr< const ComplexMatrixArray > m_ulPrecMats
UL Precoding matrices.
uint32_t m_srsPeriodicity
SRS periodicity.
NrMacHarqVector m_ulHarq
HARQ process vector for UL.
NrMacSchedulerUeInfo()=delete
Default Constructor (deleted)
uint16_t m_rnti
RNTI of the UE.
virtual ~NrMacSchedulerUeInfo()
~NrMacSchedulerUeInfo deconstructor
std::vector< SbMcsInfo > m_dlSbMcsInfo
static std::unordered_map< uint8_t, LCGPtr > & GetDlLCG(const UePtr &ue)
GetDlLCG.
CqiInfo m_ulCqi
UL CQI information.
uint8_t m_startMcsDlUe
Starting DL MCS to be used.
uint8_t GetDlMcs() const
Get the downlink MCS, given by the wideband CQI, or the sub-band CQIs of the currently allocated RBGs...
std::vector< uint8_t > m_dlSym
Corresponding symbol of m_dlRBG in this slot.
CqiInfo m_dlCqi
DL CQI information.
Ptr< const ComplexMatrixArray > m_dlPrecMats
DL Precoding matrices.
BeamId m_beamId
Beam ID of the UE (kept updated as much as possible by MAC)
static uint8_t & GetUlMcs(const UePtr &ue)
GetUlMcs.
std::unordered_map< uint8_t, LCGPtr > m_dlLCG
DL LCG.
static std::vector< uint8_t > & GetDlSym(const UePtr &ue)
GetDlSym.
std::unordered_map< uint8_t, LCGPtr > m_ulLCG
UL LCG.
virtual void UpdateDlMetric()
Update DL metrics after resources have been assigned.
virtual void ResetUlSchedInfo()
Reset UL information.
static NrMacHarqVector & GetDlHarqVector(const UePtr &ue)
GetDlHarqVector.
static uint32_t & GetDlTBS(const UePtr &ue)
GetDlTBS.
Ptr< NrAmc > m_ulAmc
AMC instance of scheduler associated with UL.
McsCsiSource m_mcsCsiSource
Source of MCS computation based on CSI feedback.
Received CQI information.
std::vector< uint8_t > m_sbCqi
Sub-band CQI reported values.
std::vector< double > m_sinr
Vector of SINR for the entire band.
uint8_t m_wbCqi
CQI reported value.
enum ns3::NrMacSchedulerUeInfo::CqiInfo::CqiType WB
CQI type.