QoSAwareScheduler.h Source File

Simu5G: QoSAwareScheduler.h Source File
Simu5G
QoSAwareScheduler.h
1//
2// Simu5G
3//
4// Authors: Mohamed Seliem (University College Cork)
5//
6// This file is part of a software released under the license included in file
7// "license.pdf". Please read LICENSE and README files before using it.
8// The above files and the present reference are part of the software itself,
9// and cannot be removed from it.
10//
11
12
13#ifndef STACK_MAC_SCHEDULING_MODULES_QOSAWARESCHEDULER_H_
14#define STACK_MAC_SCHEDULING_MODULES_QOSAWARESCHEDULER_H_
15
16#include "simu5g/stack/mac/scheduler/LteScheduler.h"
17#include "simu5g/stack/mac/DrbQosProfile.h"
18#include <map>
19#include <queue>
20#include <vector>
21
22namespace simu5g {
23
24class LteMacBase;
25
38class QoSAwareScheduler : public LteScheduler
39{
40 protected:
41 typedef std::map<MacCid, double> PfRate;
42 typedef std::pair<MacCid, double> ScoredCid;
43
44 PfRate pfRate_;
45 std::map<MacCid, unsigned int> grantedBytes_;
46 double pfAlpha_;
47 const double scoreEpsilon_ = 1e-6;
48
49 const std::map<DrbKey, DrbQosProfile> *drbQosMap_ = nullptr;
50
51 // QoS weight parameters TODO initialize from NED parameters
52 double gbrMultiplier_ = 2.0;
53 double priorityBase_ = 10.0; // weight contribution = priorityBase_ / priorityLevel (scale-free: only priority ratios matter)
54 double delayUrgentMs_ = 10.0; // delay budget thresholds (ms)
55 double delayTightMs_ = 50.0;
56 double delayLooseMs_ = 100.0;
57 double delayUrgentMultiplier_ = 5.0; // multipliers for each tier
58 double delayTightMultiplier_ = 3.0;
59 double delayLooseMultiplier_ = 1.5;
60
61 // scratch for the aggregated profile getQosForUlGroup() returns a pointer to
62 DrbQosProfile groupQos_;
63
64 // Helpers
65 virtual double computeQosWeight(const DrbQosProfile& e);
66 virtual const DrbQosProfile *getDrbQosForCid(MacCid cid);
67 virtual const DrbQosProfile *getQosForUlGroup(MacNodeId ueId, Lcg lcg);
68
69 public:
77 static std::vector<const DrbQosProfile *> collectUlGroupMembers(
78 const std::map<DrbKey, DrbQosProfile>& drbQosMap, LteMacBase *mac, MacNodeId ueId, Lcg lcg);
79
86 static DrbQosProfile aggregateQosProfiles(const std::vector<const DrbQosProfile *>& members);
87
88 double& pfAlpha() { return pfAlpha_; }
89
90 QoSAwareScheduler(Binder* binder, double pfAlpha);
91 void setDrbQosMap(const std::map<DrbKey, DrbQosProfile> *m) { drbQosMap_ = m; }
92 void prepareSchedule() override;
93 void commitSchedule() override;
94};
95
96} // namespace simu5g
97
98#endif /* STACK_MAC_SCHEDULING_MODULES_QOSAWARESCHEDULER_H_ */
99
Definition Binder.h:48
MAC Layer.
Definition LteMacBase.h:80
Definition LteTypes.h:153
Definition QoSAwareScheduler.h:39
static DrbQosProfile aggregateQosProfiles(const std::vector< const DrbQosProfile * > &members)
static std::vector< const DrbQosProfile * > collectUlGroupMembers(const std::map< DrbKey, DrbQosProfile > &drbQosMap, LteMacBase *mac, MacNodeId ueId, Lcg lcg)
Definition AlertReceiver.h:24