5#include "nr-mac-scheduler-tdma-pf.h"
7#include "nr-mac-scheduler-ue-info-pf.h"
17NS_LOG_COMPONENT_DEFINE(
"NrMacSchedulerTdmaPF");
18NS_OBJECT_ENSURE_REGISTERED(NrMacSchedulerTdmaPF);
24 TypeId(
"ns3::NrMacSchedulerTdmaPF")
26 .AddConstructor<NrMacSchedulerTdmaPF>()
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<double>(0, 1))
36 "Weight of the last average throughput in the average throughput calculation",
40 MakeDoubleChecker<double>(0));
47 NS_LOG_FUNCTION(
this);
53 NS_LOG_FUNCTION(
this);
60 NS_LOG_FUNCTION(
this);
67 NS_LOG_FUNCTION(
this);
74 NS_LOG_FUNCTION(
this);
78std::shared_ptr<NrMacSchedulerUeInfo>
82 NS_LOG_FUNCTION(
this);
83 return std::make_shared<NrMacSchedulerUeInfoPF>(
109 NS_LOG_FUNCTION(
this);
110 auto uePtr = std::dynamic_pointer_cast<NrMacSchedulerUeInfoPF>(ue.first);
111 uePtr->UpdateDlPFMetric(totAssigned, m_timeWindow);
120 NS_LOG_FUNCTION(
this);
121 auto uePtr = std::dynamic_pointer_cast<NrMacSchedulerUeInfoPF>(ue.first);
122 uePtr->UpdateDlPFMetric(totAssigned, m_timeWindow);
130 NS_LOG_FUNCTION(
this);
131 auto uePtr = std::dynamic_pointer_cast<NrMacSchedulerUeInfoPF>(ue.first);
132 uePtr->UpdateUlPFMetric(totAssigned, m_timeWindow);
141 NS_LOG_FUNCTION(
this);
142 auto uePtr = std::dynamic_pointer_cast<NrMacSchedulerUeInfoPF>(ue.first);
143 uePtr->UpdateUlPFMetric(totAssigned, m_timeWindow);
150 NS_LOG_FUNCTION(
this);
151 auto uePtr = std::dynamic_pointer_cast<NrMacSchedulerUeInfoPF>(ue.first);
152 uePtr->CalculatePotentialTPutDl(assignableInIteration);
159 NS_LOG_FUNCTION(
this);
160 auto uePtr = std::dynamic_pointer_cast<NrMacSchedulerUeInfoPF>(ue.first);
161 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.
static TypeId GetTypeId()
GetTypeId.
void BeforeDlSched(const UePtrAndBufferReq &ue, const FTResources &assignableInIteration) const override
Calculate the potential throughput for the DL based on the available resources.
double GetFairnessIndex() const
Get the value of attribute "FairnessIndex".
void NotAssignedUlResources(const UePtrAndBufferReq &ue, const FTResources ¬Assigned, const FTResources &totAssigned) const override
Update UL metrics by calling NrMacSchedulerUeInfoPF::UpdatePFUlMetric.
void BeforeUlSched(const UePtrAndBufferReq &ue, const FTResources &assignableInIteration) const override
Calculate the potential throughput for the UL based on the available resources.
void SetFairnessIndex(double v)
Set the value of attribute "FairnessIndex".
void AssignedUlResources(const UePtrAndBufferReq &ue, const FTResources &assigned, const FTResources &totAssigned) const override
Update UL metrics by calling NrMacSchedulerUeInfoPF::UpdatePFUlMetric.
double GetTimeWindow() const
Get the attribute "LastAvgTPutWeight".
NrMacSchedulerTdmaPF()
NrMacSchedulerTdmaPF constructor.
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.
void AssignedDlResources(const UePtrAndBufferReq &ue, const FTResources &assigned, const FTResources &totAssigned) const override
Update DL metrics by calling NrMacSchedulerUeInfoPF::UpdatePFDlMetric.
void NotAssignedDlResources(const UePtrAndBufferReq &ue, const FTResources ¬Assigned, const FTResources &totAssigned) const override
Update DL metrics by calling NrMacSchedulerUeInfoPF::UpdatePFDlMetric.
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.
std::shared_ptr< NrMacSchedulerUeInfo > CreateUeRepresentation(const NrMacCschedSapProvider::CschedUeConfigReqParameters ¶ms) const override
Create an UE representation of the type NrMacSchedulerUeInfoPF.
void SetTimeWindow(double v)
Set the attribute "LastAvgTPutWeight".
Assign entire symbols 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.