5#include "nr-mac-scheduler-ofdma-qos.h"
7#include "nr-mac-scheduler-ue-info-qos.h"
17NS_LOG_COMPONENT_DEFINE(
"NrMacSchedulerOfdmaQos");
18NS_OBJECT_ENSURE_REGISTERED(NrMacSchedulerOfdmaQos);
24 TypeId(
"ns3::NrMacSchedulerOfdmaQos")
26 .AddConstructor<NrMacSchedulerOfdmaQos>()
27 .AddAttribute(
"FairnessIndex",
28 "Value (between 0 and 1) that defines the PF metric (1 is the "
29 "traditional 3GPP PF, 0 is RR in throughput",
33 MakeDoubleChecker<float>(0, 1))
36 "Weight of the last average throughput in the average throughput calculation",
40 MakeDoubleChecker<float>(0));
52 NS_LOG_FUNCTION(
this);
59 NS_LOG_FUNCTION(
this);
66 NS_LOG_FUNCTION(
this);
73 NS_LOG_FUNCTION(
this);
77std::shared_ptr<NrMacSchedulerUeInfo>
81 NS_LOG_FUNCTION(
this);
82 return std::make_shared<NrMacSchedulerUeInfoQos>(
108 NS_LOG_FUNCTION(
this);
109 auto uePtr = std::dynamic_pointer_cast<NrMacSchedulerUeInfoQos>(ue.first);
110 uePtr->UpdateDlQosMetric(totAssigned, m_timeWindow);
119 NS_LOG_FUNCTION(
this);
120 auto uePtr = std::dynamic_pointer_cast<NrMacSchedulerUeInfoQos>(ue.first);
121 uePtr->UpdateDlQosMetric(totAssigned, m_timeWindow);
129 NS_LOG_FUNCTION(
this);
130 auto uePtr = std::dynamic_pointer_cast<NrMacSchedulerUeInfoQos>(ue.first);
131 uePtr->UpdateUlQosMetric(totAssigned, m_timeWindow);
140 NS_LOG_FUNCTION(
this);
141 auto uePtr = std::dynamic_pointer_cast<NrMacSchedulerUeInfoQos>(ue.first);
142 uePtr->UpdateUlQosMetric(totAssigned, m_timeWindow);
149 NS_LOG_FUNCTION(
this);
150 auto uePtr = std::dynamic_pointer_cast<NrMacSchedulerUeInfoQos>(ue.first);
151 uePtr->CalculatePotentialTPutDl(assignableInIteration);
158 NS_LOG_FUNCTION(
this);
159 auto uePtr = std::dynamic_pointer_cast<NrMacSchedulerUeInfoQos>(ue.first);
160 uePtr->CalculatePotentialTPutUl(assignableInIteration);
uint64_t GetNumRbPerRbg() const
Private function that is used to get the number of resource blocks per resource block group and also ...
std::pair< UePtr, uint32_t > UePtrAndBufferReq
Pair between a pointer to NrMacSchedulerUeInfo and its buffer occupancy.
void SetTimeWindow(double v)
Set the attribute "LastAvgTPutWeight".
NrMacSchedulerOfdmaQos()
NrMacSchedulerOfdmaQos constructor.
void BeforeUlSched(const UePtrAndBufferReq &ue, const FTResources &assignableInIteration) const override
Calculate the potential throughput for the UL based on the available resources.
void AssignedDlResources(const UePtrAndBufferReq &ue, const FTResources &assigned, const FTResources &totAssigned) const override
Update the UE representation after a symbol (DL) has been assigned to it.
void SetFairnessIndex(double v)
Set the value of attribute "FairnessIndex".
void NotAssignedDlResources(const UePtrAndBufferReq &ue, const FTResources ¬Assigned, const FTResources &totalAssigned) const override
Update DL metrics by calling NrMacSchedulerUeInfoQos::UpdateQosDlMetric.
std::function< bool(const NrMacSchedulerNs3::UePtrAndBufferReq &lhs, const NrMacSchedulerNs3::UePtrAndBufferReq &rhs)> GetUeCompareDlFn() const override
Return the comparison function to sort DL UE according to the scheduler policy.
std::shared_ptr< NrMacSchedulerUeInfo > CreateUeRepresentation(const NrMacCschedSapProvider::CschedUeConfigReqParameters ¶ms) const override
Create an UE representation of the type NrMacSchedulerUeInfoQos.
void BeforeDlSched(const UePtrAndBufferReq &ue, const FTResources &assignableInIteration) const override
Calculate the potential throughput for the DL based on the available resources.
void AssignedUlResources(const UePtrAndBufferReq &ue, const FTResources &assigned, const FTResources &totAssigned) const override
Update the UE representation after a symbol (UL) has been assigned to it.
double GetTimeWindow() const
Get the attribute "LastAvgTPutWeight".
double GetFairnessIndex() const
Get the value of attribute "FairnessIndex".
std::function< bool(const NrMacSchedulerNs3::UePtrAndBufferReq &lhs, const NrMacSchedulerNs3::UePtrAndBufferReq &rhs)> GetUeCompareUlFn() const override
Return the comparison function to sort UL UE according to the scheduler policy.
void NotAssignedUlResources(const UePtrAndBufferReq &ue, const FTResources ¬Assigned, const FTResources &totalAssigned) const override
Update UL metrics by calling NrMacSchedulerUeInfoQos::UpdateQosUlMetric.
static TypeId GetTypeId()
GetTypeId.
Assign frequencies in a round-robin fashion.
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 ...
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 ...
Point in the Frequency/Time plane.