7#include "nr-mac-scheduler-ns3.h"
64 friend class NrTestSchedulerAiCase;
88 const std::shared_ptr<NrMacSchedulerUeInfo>& ueInfo,
89 uint32_t maxSym)
const override;
92 const std::shared_ptr<NrMacSchedulerUeInfo>& ueInfo,
93 uint32_t maxSym)
const override;
101 [[maybe_unused]] uint32_t symOfBeam)
const override
111 [[maybe_unused]] uint32_t symOfBeam)
const override
115 uint8_t
GetTpc()
const override;
197 const FTResources& assignableInIteration)
const = 0;
209 const FTResources& assignableInIteration)
const = 0;
217 virtual void CallNotifyDlFn(
const std::vector<UePtrAndBufferReq>& ueVector)
const
227 virtual void CallNotifyUlFn(
const std::vector<UePtrAndBufferReq>& ueVector)
const
239 static std::vector<UePtrAndBufferReq> GetUeVectorFromActiveUeMap(
const ActiveUeMap& activeUes);
248 AfterSuccessfulAssignmentFn;
253 AfterUnsuccessfulAssignmentFn;
254 typedef std::function<std::vector<uint16_t>&(
const UePtr& ue)>
256 typedef std::function<uint32_t&(
const UePtr& ue)> GetTBSFn;
257 typedef std::function<std::vector<uint8_t>&(
const UePtr& ue)>
262 typedef std::function<CompareUeFn()> GetCompareUeFn;
263 typedef std::function<void(std::vector<UePtrAndBufferReq>& ueVector)> CallNotifyFn;
267 const std::string& type,
268 const BeforeSchedFn& BeforeSchedFn,
269 const GetCompareUeFn& GetCompareFn,
270 const GetTBSFn& GetTBSFn,
271 const GetRBGFn& GetRBGFn,
272 const GetSymFn& GetSymFn,
273 const AfterSuccessfulAssignmentFn& SuccessfulAssignmentFn,
274 const AfterUnsuccessfulAssignmentFn& UnSuccessfulAssignmentFn,
275 const CallNotifyFn& callNotifyFn)
const;
277 std::shared_ptr<DciInfoElementTdma> CreateDci(
278 PointInFTPlane* spoint,
279 const std::shared_ptr<NrMacSchedulerUeInfo>& ueInfo,
284 Ptr<const ComplexMatrixArray> precMats,
285 uint8_t numSym)
const;
A general scheduler for nr in NS3.
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)
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.
virtual std::function< bool(const NrMacSchedulerNs3::UePtrAndBufferReq &lhs, const NrMacSchedulerNs3::UePtrAndBufferReq &rhs)> GetUeCompareUlFn() const =0
Provide the comparison function to order the UE when scheduling UL.
std::shared_ptr< DciInfoElementTdma > CreateDlDci(PointInFTPlane *spoint, const std::shared_ptr< NrMacSchedulerUeInfo > &ueInfo, uint32_t maxSym) const override
Create a DL DCI starting from spoint and spanning maxSym symbols.
NrMacSchedulerTdma()
NrMacSchedulerTdma constructor.
virtual void AssignedUlResources(const UePtrAndBufferReq &ue, const FTResources &assigned, const FTResources &totalAssigned) const =0
Update the UE representation after a symbol (DL) has been assigned to it.
virtual std::function< bool(const NrMacSchedulerNs3::UePtrAndBufferReq &lhs, const NrMacSchedulerNs3::UePtrAndBufferReq &rhs)> GetUeCompareDlFn() const =0
Provide the comparison function to order the UE when scheduling DL.
BeamSymbolMap AssignDLRBG(uint32_t symAvail, const ActiveUeMap &activeDl) const override
Assign the available DL RBG to the UEs.
static TypeId GetTypeId()
GetTypeId.
virtual void NotAssignedUlResources(const UePtrAndBufferReq &ue, const FTResources ¬Assigned, const FTResources &totalAssigned) const =0
Update the UE representation after a symbol (UL) has been assigned to other UE.
virtual void NotAssignedDlResources(const UePtrAndBufferReq &ue, const FTResources ¬Assigned, const FTResources &totalAssigned) const =0
Update the UE representation after a symbol (DL) has been assigned to other UE.
virtual void AssignedDlResources(const UePtrAndBufferReq &ue, const FTResources &assigned, const FTResources &totalAssigned) const =0
Update the UE representation after a symbol (DL) has been assigned to it.
BeamSymbolMap AssignULRBG(uint32_t symAvail, const ActiveUeMap &activeUl) const override
Assign the available UL RBG to the UEs.
virtual void BeforeUlSched(const UePtrAndBufferReq &ue, const FTResources &assignableInIteration) const =0
Prepare UE for the UL scheduling.
~NrMacSchedulerTdma() override
NrMacSchedulerTdma deconstructor.
uint8_t GetTpc() const override
Returns TPC command.
virtual void CallNotifyDlFn(const std::vector< UePtrAndBufferReq > &ueVector) const
Call the notify callback function in the OpenGymEnv class in the ns3-gym module for downlink.
virtual void CallNotifyUlFn(const std::vector< UePtrAndBufferReq > &ueVector) const
Call the notify callback function in the OpenGymEnv class in the ns3-gym module for uplink.
void ChangeUlBeam(PointInFTPlane *spoint, uint32_t symOfBeam) const override
Not doing anything, moving forward the spoint is done by CreateDci.
void ChangeDlBeam(PointInFTPlane *spoint, uint32_t symOfBeam) const override
Not doing anything, moving forward the spoint is done by CreateDci.
virtual void BeforeDlSched(const UePtrAndBufferReq &ue, const FTResources &assignableInIteration) const =0
Prepare UE for the DL scheduling.
std::shared_ptr< DciInfoElementTdma > CreateUlDci(PointInFTPlane *spoint, const std::shared_ptr< NrMacSchedulerUeInfo > &ueInfo, uint32_t maxSym) const override
Create a UL DCI starting from spoint and spanning maxSym symbols.
DciFormat
Format of the DCI.
Point in the Frequency/Time plane.