5G-LENA nr-v4.0-29-g6d8085cd
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-mac-scheduler-tdma-rr.h
1// Copyright (c) 2019 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2//
3// SPDX-License-Identifier: GPL-2.0-only
4
5#pragma once
6
7#include "nr-mac-scheduler-tdma.h"
8
9#include <unordered_set>
10
11namespace ns3
12{
13
31{
32 public:
37 static TypeId GetTypeId();
38
43
48 {
49 }
50
51 protected:
57 std::shared_ptr<NrMacSchedulerUeInfo> CreateUeRepresentation(
58 const NrMacCschedSapProvider::CschedUeConfigReqParameters& params) const override;
59
64 std::function<bool(const NrMacSchedulerNs3::UePtrAndBufferReq& lhs,
66 GetUeCompareDlFn() const override;
67
72 std::function<bool(const NrMacSchedulerNs3::UePtrAndBufferReq& lhs,
74 GetUeCompareUlFn() const override;
75
85 const FTResources& assigned,
86 const FTResources& totAssigned) const override;
87
97 const FTResources& assigned,
98 const FTResources& totAssigned) const override;
99
100 // RR is a simple scheduler: it doesn't do anything in the next
101 // inherited calls.
103 const FTResources& notAssigned,
104 const FTResources& totalAssigned) const override
105 {
106 }
107
109 const FTResources& notAssigned,
110 const FTResources& totalAssigned) const override
111 {
112 }
113
115 const FTResources& assignableInIteration) const override
116 {
117 }
118
120 const FTResources& assignableInIteration) const override
121 {
122 }
123
124 private:
132 mutable std::deque<uint16_t> m_dlRrRntiDeque;
133 mutable std::unordered_set<uint16_t> m_dlRntiSet;
134};
135
136} // namespace ns3
std::pair< UePtr, uint32_t > UePtrAndBufferReq
Pair between a pointer to NrMacSchedulerUeInfo and its buffer occupancy.
PointInFTPlane FTResources
Represent an amount of RBG/symbols that can be, or is, assigned.
The base for all the TDMA schedulers.
Implements a Round-Robin (RR) Time-Division Multiple Access (TDMA) MAC scheduler for NR (New Radio).
void BeforeDlSched(const UePtrAndBufferReq &ue, const FTResources &assignableInIteration) const override
Prepare UE for the DL scheduling.
void NotAssignedDlResources(const UePtrAndBufferReq &ue, const FTResources &notAssigned, const FTResources &totalAssigned) const override
Update the UE representation after a symbol (DL) has been assigned to other UE.
std::shared_ptr< NrMacSchedulerUeInfo > CreateUeRepresentation(const NrMacCschedSapProvider::CschedUeConfigReqParameters &params) const override
Create an UE representation of the type NrMacSchedulerUeInfoRR.
NrMacSchedulerTdmaRR()
NrMacSchedulerTdmaRR constructor.
void BeforeUlSched(const UePtrAndBufferReq &ue, const FTResources &assignableInIteration) const override
Prepare UE for the UL scheduling.
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 &notAssigned, const FTResources &totalAssigned) const override
Update the UE representation after a symbol (UL) has been assigned to other UE.
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 the UE representation after a symbol (DL) has been assigned to it.
static TypeId GetTypeId()
GetTypeId.
~NrMacSchedulerTdmaRR() override
~NrMacSchedulerTdmaRR deconstructor
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.
Point in the Frequency/Time plane.