7#include "nr-mac-scheduler-ofdma-symbol-per-beam.h"
8#include "nr-mac-scheduler-tdma.h"
10#include "ns3/traced-value.h"
13#include <unordered_set>
17class NrMacSchedulerOfdmaSymbolPerBeam;
18class NrSchedOfdmaSymbolPerBeamTestCase;
82 PointInFTPlane* spoint,
83 const std::shared_ptr<NrMacSchedulerUeInfo>& ueInfo,
84 uint32_t maxSym)
const override;
86 PointInFTPlane* spoint,
87 const std::shared_ptr<NrMacSchedulerUeInfo>& ueInfo,
88 uint32_t maxSym)
const override;
96 void ChangeDlBeam(PointInFTPlane* spoint, uint32_t symOfBeam)
const override;
98 void ChangeUlBeam(PointInFTPlane* spoint, uint32_t symOfBeam)
const override;
110 uint8_t
GetTpc()
const override;
128 std::vector<bool> CreateRbgBitmaskFromAllocatedRbgs(
129 const std::vector<uint16_t>& allocatedRbgs)
const;
151 bool AdvanceToNextUeToSchedule(std::vector<UePtrAndBufferReq>::iterator& schedInfoIt,
152 const std::vector<UePtrAndBufferReq>::iterator end,
153 uint32_t resourcesAssignable)
const;
164 bool ShouldScheduleUeBasedOnFronthaul(
165 const std::vector<UePtrAndBufferReq>::iterator& schedInfoIt,
166 uint32_t resourcesAssignable)
const;
176 void DeallocateResourcesDueToFronthaulConstraint(
const std::vector<UePtrAndBufferReq>& ueVector,
177 const uint32_t& beamSym,
179 std::vector<bool>& availableRbgs)
const;
189 static void AllocateCurrentResourceToUe(std::shared_ptr<NrMacSchedulerUeInfo> currentUe,
190 const uint32_t& currentRbg,
191 const uint32_t beamSym,
193 std::vector<bool>& availableRbgs);
203 static void DeallocateCurrentResourceFromUe(std::shared_ptr<NrMacSchedulerUeInfo> currentUe,
204 const uint32_t& currentRbg,
205 const uint32_t beamSym,
207 std::vector<bool>& availableRbgs);
218 bool AttemptAllocationOfCurrentResourceToUe(
219 std::vector<UePtrAndBufferReq>::iterator schedInfoIt,
220 std::set<uint32_t>& remainingRbgSet,
221 const uint32_t beamSym,
223 std::vector<bool>& availableRbgs)
const;
226 TracedValue<uint32_t>
227 m_tracedValueSymPerBeam;
230 Ptr<NrMacSchedulerOfdmaSymbolPerBeam> m_symPerBeam;
std::unordered_map< BeamId, uint32_t, BeamIdHash > BeamSymbolMap
Map between a BeamId and the symbol assigned to that beam.
std::unordered_map< BeamId, std::vector< UePtrAndBufferReq >, BeamIdHash > ActiveUeMap
Map between a BeamId and a vector of UE (the UE are in that beam)
PointInFTPlane FTResources
Represent an amount of RBG/symbols that can be, or is, assigned.
The base for all the OFDMA schedulers.
std::shared_ptr< DciInfoElementTdma > CreateDlDci(PointInFTPlane *spoint, const std::shared_ptr< NrMacSchedulerUeInfo > &ueInfo, uint32_t maxSym) const override
Create the DL DCI in OFDMA mode.
void ChangeDlBeam(PointInFTPlane *spoint, uint32_t symOfBeam) const override
Advance the starting point by the number of symbols specified, resetting the RB count to 0.
~NrMacSchedulerOfdma() override
Deconstructor.
friend class NrSchedOfdmaSymbolPerBeamTestCase
Make it friend of the test case, so that the test case can access m_symPerBeam.
NrMacSchedulerOfdma()
NrMacSchedulerOfdma constructor.
std::shared_ptr< DciInfoElementTdma > CreateUlDci(PointInFTPlane *spoint, const std::shared_ptr< NrMacSchedulerUeInfo > &ueInfo, uint32_t maxSym) const override
Create a DCI for the specified UE for UL data.
NrMacSchedulerOfdma::BeamSymbolMap GetSymPerBeam(uint32_t symAvail, const ActiveUeMap &activeDl) const
Calculate the number of symbols to assign to each beam by calling using the technique selected in m_s...
BeamSymbolMap AssignULRBG(uint32_t symAvail, const ActiveUeMap &activeUl) const override
Assign the UL RBG to the active UE, and return the distribution of symbols per beam.
BeamSymbolMap AssignDLRBG(uint32_t symAvail, const ActiveUeMap &activeDl) const override
Assign the available DL RBG to the UEs.
SymPerBeamType
Enumeration of techniques to distribute the available symbols to the active beams.
@ ROUND_ROBIN
Distributes all symbols to the first active beam in the m_rrBeams queue.
@ PROPORTIONAL_FAIR
Distributes symbols to beams proportionally to mean achievable rate.
@ LOAD_BASED
Distributes symbols to beams proportionally to the buffer size of its users.
uint8_t GetTpc() const override
Returns TPC command.
static TypeId GetTypeId()
GetTypeId.
void ChangeUlBeam(PointInFTPlane *spoint, uint32_t symOfBeam) const override
Perform a custom operation on the starting point each time all the UE of an UL beam have been schedul...
The base for all the TDMA schedulers.