13#ifndef _LTE_LTESCHEDULER_H_
14#define _LTE_LTESCHEDULER_H_
16#include "simu5g/common/LteCommon.h"
17#include "simu5g/stack/mac/LteMacEnb.h"
21using namespace omnetpp;
29template<
typename T,
typename S>
43 return uniform(getEnvir()->getRNG(0), 0, 1) < 0.5;
52 SortedDesc(
const T x,
const S score) :
x_(x),
score_(score)
65 opp_component_ptr<LteMacEnb> mac_;
68 opp_component_ptr<Binder> binder_;
71 LteSchedulerEnb *eNbScheduler_ =
nullptr;
77 ActiveSet *activeConnectionSet_ =
nullptr;
80 ActiveSet activeConnectionTempSet_;
83 ActiveSet carrierActiveConnectionSet_;
86 GHz carrierFrequency_;
89 BandLimitVector bandLimit_;
92 BandLimitVector slotRacBandLimit_;
95 BandLimitVector slotRtxBandLimit_;
98 BandLimitVector slotReqGrantBandLimit_;
101 typedef std::list<MacCid> CidList;
104 unsigned int numerologyIndex_;
107 unsigned int maxSchedulingPeriodCounter_;
108 unsigned int currentSchedulingPeriodCounter_;
115 LteScheduler(Binder *binder) : binder_(binder)
122 virtual ~LteScheduler()
130 virtual void setEnbScheduler(LteSchedulerEnb *eNbScheduler);
136 virtual void setCarrierFrequency(GHz carrierFrequency);
141 virtual void initializeBandLimit();
146 virtual void initializeSchedulerPeriodCounter(
NumerologyIndex maxNumerologyIndex);
151 virtual unsigned int decreaseSchedulerPeriodCounter();
156 GHz getCarrierFrequency() {
return carrierFrequency_; };
161 void setNumerologyIndex(
unsigned int numerologyIndex) { numerologyIndex_ = numerologyIndex; }
178 virtual void schedule();
180 virtual void prepareSchedule()
184 virtual void commitSchedule()
191 virtual unsigned int requestGrant(MacCid cid,
unsigned int bytes,
bool& terminate,
bool& active,
bool& eligible, std::vector<BandLimit> *bandLim =
nullptr);
194 virtual unsigned int requestGrantBackground(MacCid bgCid,
unsigned int bytes,
bool& terminate,
bool& active,
bool& eligible, std::vector<BandLimit> *bandLim =
nullptr);
197 virtual bool scheduleRetransmissions();
200 virtual bool scheduleRacRequests();
202 virtual void notifyActiveConnection(MacCid activeCid)
206 virtual void updateSchedulingInfo()
216 virtual void buildCarrierActiveConnectionSet();
Definition AlertReceiver.h:24
unsigned short NumerologyIndex
Numerology Index.
Definition LteCommon.h:205
Definition LteScheduler.h:31
unsigned int score_
Definition LteScheduler.h:35
bool operator<(const SortedDesc &y) const
Comparison operator to enable sorting.
Definition LteScheduler.h:38
MacCid x_
Definition LteScheduler.h:33