5G-LENA nr-v3.3-120-gdac69c56
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-mac-scheduler-ofdma-rr.cc
1// Copyright (c) 2019 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2//
3// SPDX-License-Identifier: GPL-2.0-only
4
5#include "nr-mac-scheduler-ofdma-rr.h"
6
7#include "nr-mac-scheduler-ue-info-rr.h"
8
9#include "ns3/log.h"
10
11namespace ns3
12{
13NS_LOG_COMPONENT_DEFINE("NrMacSchedulerOfdmaRR");
14NS_OBJECT_ENSURE_REGISTERED(NrMacSchedulerOfdmaRR);
15
16TypeId
18{
19 static TypeId tid = TypeId("ns3::NrMacSchedulerOfdmaRR")
20 .SetParent<NrMacSchedulerOfdma>()
21 .AddConstructor<NrMacSchedulerOfdmaRR>();
22 return tid;
23}
24
29
30std::shared_ptr<NrMacSchedulerUeInfo>
33{
34 NS_LOG_FUNCTION(this);
35 return std::make_shared<NrMacSchedulerUeInfoRR>(
36 params.m_rnti,
37 params.m_beamId,
39}
40
41void
43 [[maybe_unused]] const FTResources& assigned,
44 [[maybe_unused]] const FTResources& totAssigned) const
45{
46 NS_LOG_FUNCTION(this);
47 GetFirst GetUe;
48 GetUe(ue)->UpdateDlMetric();
49}
50
51void
53 [[maybe_unused]] const FTResources& assigned,
54 [[maybe_unused]] const FTResources& totAssigned) const
55{
56 NS_LOG_FUNCTION(this);
57 GetFirst GetUe;
58 GetUe(ue)->UpdateUlMetric();
59}
60
61std::function<bool(const NrMacSchedulerNs3::UePtrAndBufferReq& lhs,
67
68std::function<bool(const NrMacSchedulerNs3::UePtrAndBufferReq& lhs,
74
75} // namespace ns3
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.
The base for all the OFDMA schedulers.
static TypeId GetTypeId()
GetTypeId.
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 &params) const override
Create an UE representation of the type NrMacSchedulerUeInfoRR.
void AssignedUlResources(const UePtrAndBufferReq &ue, const FTResources &assigned, const FTResources &totAssigned) const override
Update the UE representation after a symbol (DL) has been assigned to it.
NrMacSchedulerOfdmaRR()
NrMacSchedulerTdmaRR constructor.
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 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.
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 ...
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 ...
Point in the Frequency/Time plane.