author | Dizhi Zhou <dizhi.zhou@gmail.com> |
Sat, 01 Dec 2012 19:08:52 -0500 | |
changeset 9159 | e4545deccc31 |
parent 9153 | f04612961e79 |
child 9180 | 818aee3d2c7b |
permissions | -rw-r--r-- |
9149
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
2 |
/* |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
3 |
* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
4 |
* |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
8 |
* |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
13 |
* |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
17 |
* |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
18 |
* Author: Marco Miozzo <marco.miozzo@cttc.es> // original version |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
19 |
* Modification: Dizhi Zhou <dizhi.zhou@gmail.com> // modify codes related to downlink scheduler |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
20 |
*/ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
21 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
22 |
#include <ns3/log.h> |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
23 |
#include <ns3/pointer.h> |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
24 |
#include <ns3/integer.h> |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
25 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
26 |
#include <ns3/simulator.h> |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
27 |
#include <ns3/lte-amc.h> |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
28 |
#include <ns3/tdtbfq-ff-mac-scheduler.h> |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
29 |
#include <ns3/lte-vendor-specific-parameters.h> |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
30 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
31 |
NS_LOG_COMPONENT_DEFINE ("TdTbfqFfMacScheduler"); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
32 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
33 |
// value for SINR outside the range defined by LTE, used to indicate that there |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
34 |
// is no CQI for this element |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
35 |
#define NO_SINR -5000 |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
36 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
37 |
namespace ns3 { |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
38 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
39 |
int TdTbfqType0AllocationRbg[4] = { |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
40 |
10, // RGB size 1 |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
41 |
26, // RGB size 2 |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
42 |
63, // RGB size 3 |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
43 |
110 // RGB size 4 |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
44 |
}; // see table 7.1.6.1-1 of 36.213 |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
45 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
46 |
NS_OBJECT_ENSURE_REGISTERED (TdTbfqFfMacScheduler); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
47 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
48 |
class TdTbfqSchedulerMemberCschedSapProvider : public FfMacCschedSapProvider |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
49 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
50 |
public: |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
51 |
TdTbfqSchedulerMemberCschedSapProvider (TdTbfqFfMacScheduler* scheduler); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
52 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
53 |
// inherited from FfMacCschedSapProvider |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
54 |
virtual void CschedCellConfigReq (const struct CschedCellConfigReqParameters& params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
55 |
virtual void CschedUeConfigReq (const struct CschedUeConfigReqParameters& params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
56 |
virtual void CschedLcConfigReq (const struct CschedLcConfigReqParameters& params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
57 |
virtual void CschedLcReleaseReq (const struct CschedLcReleaseReqParameters& params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
58 |
virtual void CschedUeReleaseReq (const struct CschedUeReleaseReqParameters& params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
59 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
60 |
private: |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
61 |
TdTbfqSchedulerMemberCschedSapProvider (); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
62 |
TdTbfqFfMacScheduler* m_scheduler; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
63 |
}; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
64 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
65 |
TdTbfqSchedulerMemberCschedSapProvider::TdTbfqSchedulerMemberCschedSapProvider () |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
66 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
67 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
68 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
69 |
TdTbfqSchedulerMemberCschedSapProvider::TdTbfqSchedulerMemberCschedSapProvider (TdTbfqFfMacScheduler* scheduler) : m_scheduler (scheduler) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
70 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
71 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
72 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
73 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
74 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
75 |
TdTbfqSchedulerMemberCschedSapProvider::CschedCellConfigReq (const struct CschedCellConfigReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
76 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
77 |
m_scheduler->DoCschedCellConfigReq (params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
78 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
79 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
80 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
81 |
TdTbfqSchedulerMemberCschedSapProvider::CschedUeConfigReq (const struct CschedUeConfigReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
82 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
83 |
m_scheduler->DoCschedUeConfigReq (params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
84 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
85 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
86 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
87 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
88 |
TdTbfqSchedulerMemberCschedSapProvider::CschedLcConfigReq (const struct CschedLcConfigReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
89 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
90 |
m_scheduler->DoCschedLcConfigReq (params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
91 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
92 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
93 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
94 |
TdTbfqSchedulerMemberCschedSapProvider::CschedLcReleaseReq (const struct CschedLcReleaseReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
95 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
96 |
m_scheduler->DoCschedLcReleaseReq (params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
97 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
98 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
99 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
100 |
TdTbfqSchedulerMemberCschedSapProvider::CschedUeReleaseReq (const struct CschedUeReleaseReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
101 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
102 |
m_scheduler->DoCschedUeReleaseReq (params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
103 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
104 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
105 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
106 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
107 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
108 |
class TdTbfqSchedulerMemberSchedSapProvider : public FfMacSchedSapProvider |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
109 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
110 |
public: |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
111 |
TdTbfqSchedulerMemberSchedSapProvider (TdTbfqFfMacScheduler* scheduler); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
112 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
113 |
// inherited from FfMacSchedSapProvider |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
114 |
virtual void SchedDlRlcBufferReq (const struct SchedDlRlcBufferReqParameters& params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
115 |
virtual void SchedDlPagingBufferReq (const struct SchedDlPagingBufferReqParameters& params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
116 |
virtual void SchedDlMacBufferReq (const struct SchedDlMacBufferReqParameters& params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
117 |
virtual void SchedDlTriggerReq (const struct SchedDlTriggerReqParameters& params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
118 |
virtual void SchedDlRachInfoReq (const struct SchedDlRachInfoReqParameters& params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
119 |
virtual void SchedDlCqiInfoReq (const struct SchedDlCqiInfoReqParameters& params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
120 |
virtual void SchedUlTriggerReq (const struct SchedUlTriggerReqParameters& params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
121 |
virtual void SchedUlNoiseInterferenceReq (const struct SchedUlNoiseInterferenceReqParameters& params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
122 |
virtual void SchedUlSrInfoReq (const struct SchedUlSrInfoReqParameters& params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
123 |
virtual void SchedUlMacCtrlInfoReq (const struct SchedUlMacCtrlInfoReqParameters& params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
124 |
virtual void SchedUlCqiInfoReq (const struct SchedUlCqiInfoReqParameters& params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
125 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
126 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
127 |
private: |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
128 |
TdTbfqSchedulerMemberSchedSapProvider (); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
129 |
TdTbfqFfMacScheduler* m_scheduler; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
130 |
}; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
131 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
132 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
133 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
134 |
TdTbfqSchedulerMemberSchedSapProvider::TdTbfqSchedulerMemberSchedSapProvider () |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
135 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
136 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
137 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
138 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
139 |
TdTbfqSchedulerMemberSchedSapProvider::TdTbfqSchedulerMemberSchedSapProvider (TdTbfqFfMacScheduler* scheduler) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
140 |
: m_scheduler (scheduler) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
141 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
142 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
143 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
144 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
145 |
TdTbfqSchedulerMemberSchedSapProvider::SchedDlRlcBufferReq (const struct SchedDlRlcBufferReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
146 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
147 |
m_scheduler->DoSchedDlRlcBufferReq (params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
148 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
149 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
150 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
151 |
TdTbfqSchedulerMemberSchedSapProvider::SchedDlPagingBufferReq (const struct SchedDlPagingBufferReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
152 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
153 |
m_scheduler->DoSchedDlPagingBufferReq (params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
154 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
155 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
156 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
157 |
TdTbfqSchedulerMemberSchedSapProvider::SchedDlMacBufferReq (const struct SchedDlMacBufferReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
158 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
159 |
m_scheduler->DoSchedDlMacBufferReq (params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
160 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
161 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
162 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
163 |
TdTbfqSchedulerMemberSchedSapProvider::SchedDlTriggerReq (const struct SchedDlTriggerReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
164 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
165 |
m_scheduler->DoSchedDlTriggerReq (params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
166 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
167 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
168 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
169 |
TdTbfqSchedulerMemberSchedSapProvider::SchedDlRachInfoReq (const struct SchedDlRachInfoReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
170 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
171 |
m_scheduler->DoSchedDlRachInfoReq (params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
172 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
173 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
174 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
175 |
TdTbfqSchedulerMemberSchedSapProvider::SchedDlCqiInfoReq (const struct SchedDlCqiInfoReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
176 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
177 |
m_scheduler->DoSchedDlCqiInfoReq (params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
178 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
179 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
180 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
181 |
TdTbfqSchedulerMemberSchedSapProvider::SchedUlTriggerReq (const struct SchedUlTriggerReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
182 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
183 |
m_scheduler->DoSchedUlTriggerReq (params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
184 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
185 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
186 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
187 |
TdTbfqSchedulerMemberSchedSapProvider::SchedUlNoiseInterferenceReq (const struct SchedUlNoiseInterferenceReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
188 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
189 |
m_scheduler->DoSchedUlNoiseInterferenceReq (params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
190 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
191 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
192 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
193 |
TdTbfqSchedulerMemberSchedSapProvider::SchedUlSrInfoReq (const struct SchedUlSrInfoReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
194 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
195 |
m_scheduler->DoSchedUlSrInfoReq (params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
196 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
197 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
198 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
199 |
TdTbfqSchedulerMemberSchedSapProvider::SchedUlMacCtrlInfoReq (const struct SchedUlMacCtrlInfoReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
200 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
201 |
m_scheduler->DoSchedUlMacCtrlInfoReq (params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
202 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
203 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
204 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
205 |
TdTbfqSchedulerMemberSchedSapProvider::SchedUlCqiInfoReq (const struct SchedUlCqiInfoReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
206 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
207 |
m_scheduler->DoSchedUlCqiInfoReq (params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
208 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
209 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
210 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
211 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
212 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
213 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
214 |
TdTbfqFfMacScheduler::TdTbfqFfMacScheduler () |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
215 |
: m_cschedSapUser (0), |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
216 |
m_schedSapUser (0), |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
217 |
m_timeWindow (99.0), |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
218 |
m_nextRntiUl (0) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
219 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
220 |
m_amc = CreateObject <LteAmc> (); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
221 |
m_cschedSapProvider = new TdTbfqSchedulerMemberCschedSapProvider (this); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
222 |
m_schedSapProvider = new TdTbfqSchedulerMemberSchedSapProvider (this); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
223 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
224 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
225 |
TdTbfqFfMacScheduler::~TdTbfqFfMacScheduler () |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
226 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
227 |
NS_LOG_FUNCTION (this); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
228 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
229 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
230 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
231 |
TdTbfqFfMacScheduler::DoDispose () |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
232 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
233 |
NS_LOG_FUNCTION (this); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
234 |
delete m_cschedSapProvider; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
235 |
delete m_schedSapProvider; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
236 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
237 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
238 |
TypeId |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
239 |
TdTbfqFfMacScheduler::GetTypeId (void) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
240 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
241 |
static TypeId tid = TypeId ("ns3::TdTbfqFfMacScheduler") |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
242 |
.SetParent<FfMacScheduler> () |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
243 |
.AddConstructor<TdTbfqFfMacScheduler> () |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
244 |
.AddAttribute ("CqiTimerThreshold", |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
245 |
"The number of TTIs a CQI is valid (default 1000 - 1 sec.)", |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
246 |
UintegerValue (1000), |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
247 |
MakeUintegerAccessor (&TdTbfqFfMacScheduler::m_cqiTimersThreshold), |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
248 |
MakeUintegerChecker<uint32_t> ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
249 |
.AddAttribute ("DebtLimit", |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
250 |
"Flow debt limit (default -625000 bytes)", |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
251 |
IntegerValue (-625000), |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
252 |
MakeIntegerAccessor (&TdTbfqFfMacScheduler::m_debtLimit), |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
253 |
MakeIntegerChecker<int> ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
254 |
.AddAttribute ("CreditLimit", |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
255 |
"Flow credit limit (default 625000 bytes)", |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
256 |
UintegerValue (625000), |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
257 |
MakeUintegerAccessor (&TdTbfqFfMacScheduler::m_creditLimit), |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
258 |
MakeUintegerChecker<uint32_t> ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
259 |
.AddAttribute ("TokenPoolSize", |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
260 |
"The maximum value of flow token pool (default 1 bytes)", |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
261 |
UintegerValue (1), |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
262 |
MakeUintegerAccessor (&TdTbfqFfMacScheduler::m_tokenPoolSize), |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
263 |
MakeUintegerChecker<uint32_t> ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
264 |
.AddAttribute ("CreditableThreshold", |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
265 |
"Threshold of flow credit (default 0 bytes)", |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
266 |
UintegerValue (0), |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
267 |
MakeUintegerAccessor (&TdTbfqFfMacScheduler::m_creditableThreshold), |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
268 |
MakeUintegerChecker<uint32_t> ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
269 |
; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
270 |
return tid; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
271 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
272 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
273 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
274 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
275 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
276 |
TdTbfqFfMacScheduler::SetFfMacCschedSapUser (FfMacCschedSapUser* s) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
277 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
278 |
m_cschedSapUser = s; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
279 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
280 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
281 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
282 |
TdTbfqFfMacScheduler::SetFfMacSchedSapUser (FfMacSchedSapUser* s) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
283 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
284 |
m_schedSapUser = s; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
285 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
286 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
287 |
FfMacCschedSapProvider* |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
288 |
TdTbfqFfMacScheduler::GetFfMacCschedSapProvider () |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
289 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
290 |
return m_cschedSapProvider; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
291 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
292 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
293 |
FfMacSchedSapProvider* |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
294 |
TdTbfqFfMacScheduler::GetFfMacSchedSapProvider () |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
295 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
296 |
return m_schedSapProvider; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
297 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
298 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
299 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
300 |
TdTbfqFfMacScheduler::DoCschedCellConfigReq (const struct FfMacCschedSapProvider::CschedCellConfigReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
301 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
302 |
NS_LOG_FUNCTION (this); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
303 |
// Read the subset of parameters used |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
304 |
m_cschedCellConfig = params; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
305 |
FfMacCschedSapUser::CschedUeConfigCnfParameters cnf; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
306 |
cnf.m_result = SUCCESS; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
307 |
m_cschedSapUser->CschedUeConfigCnf (cnf); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
308 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
309 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
310 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
311 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
312 |
TdTbfqFfMacScheduler::DoCschedUeConfigReq (const struct FfMacCschedSapProvider::CschedUeConfigReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
313 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
314 |
NS_LOG_FUNCTION (this << " RNTI " << params.m_rnti << " txMode " << (uint16_t)params.m_transmissionMode); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
315 |
std::map <uint16_t,uint8_t>::iterator it = m_uesTxMode.find (params.m_rnti); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
316 |
if (it == m_uesTxMode.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
317 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
318 |
m_uesTxMode.insert (std::pair <uint16_t, double> (params.m_rnti, params.m_transmissionMode)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
319 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
320 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
321 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
322 |
(*it).second = params.m_transmissionMode; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
323 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
324 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
325 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
326 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
327 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
328 |
TdTbfqFfMacScheduler::DoCschedLcConfigReq (const struct FfMacCschedSapProvider::CschedLcConfigReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
329 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
330 |
NS_LOG_FUNCTION (this << " New LC, rnti: " << params.m_rnti); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
331 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
332 |
std::map <uint16_t, tdtbfqsFlowPerf_t>::iterator it; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
333 |
for (uint16_t i = 0; i < params.m_logicalChannelConfigList.size (); i++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
334 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
335 |
it = m_flowStatsDl.find (params.m_rnti); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
336 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
337 |
if (it == m_flowStatsDl.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
338 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
339 |
uint64_t mbrDlInBytes = params.m_logicalChannelConfigList.at (i).m_eRabMaximulBitrateDl / 8; // byte/s |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
340 |
uint64_t mbrUlInBytes = params.m_logicalChannelConfigList.at (i).m_eRabMaximulBitrateUl / 8; // byte/s |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
341 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
342 |
tdtbfqsFlowPerf_t flowStatsDl; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
343 |
flowStatsDl.flowStart = Simulator::Now (); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
344 |
flowStatsDl.packetArrivalRate = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
345 |
flowStatsDl.tokenGenerationRate = mbrDlInBytes; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
346 |
flowStatsDl.tokenPoolSize = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
347 |
flowStatsDl.maxTokenPoolSize = m_tokenPoolSize; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
348 |
flowStatsDl.counter = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
349 |
flowStatsDl.burstCredit = m_creditLimit; // bytes |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
350 |
flowStatsDl.debtLimit = m_debtLimit; // bytes |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
351 |
flowStatsDl.creditableThreshold = m_creditableThreshold; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
352 |
m_flowStatsDl.insert (std::pair<uint16_t, tdtbfqsFlowPerf_t> (params.m_rnti, flowStatsDl)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
353 |
tdtbfqsFlowPerf_t flowStatsUl; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
354 |
flowStatsUl.flowStart = Simulator::Now (); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
355 |
flowStatsUl.packetArrivalRate = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
356 |
flowStatsUl.tokenGenerationRate = mbrUlInBytes; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
357 |
flowStatsUl.tokenPoolSize = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
358 |
flowStatsUl.maxTokenPoolSize = m_tokenPoolSize; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
359 |
flowStatsUl.counter = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
360 |
flowStatsUl.burstCredit = m_creditLimit; // bytes |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
361 |
flowStatsUl.debtLimit = m_debtLimit; // bytes |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
362 |
flowStatsUl.creditableThreshold = m_creditableThreshold; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
363 |
m_flowStatsUl.insert (std::pair<uint16_t, tdtbfqsFlowPerf_t> (params.m_rnti, flowStatsUl)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
364 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
365 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
366 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
367 |
NS_LOG_ERROR ("RNTI already exists"); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
368 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
369 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
370 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
371 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
372 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
373 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
374 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
375 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
376 |
TdTbfqFfMacScheduler::DoCschedLcReleaseReq (const struct FfMacCschedSapProvider::CschedLcReleaseReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
377 |
{ |
9152
3135c059ff79
GSoC 2012 NS-3 LTE schedulers: updated version based on Tom's comment
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
9151
diff
changeset
|
378 |
NS_FATAL_ERROR ("unimplemented"); |
9149
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
379 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
380 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
381 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
382 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
383 |
TdTbfqFfMacScheduler::DoCschedUeReleaseReq (const struct FfMacCschedSapProvider::CschedUeReleaseReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
384 |
{ |
9152
3135c059ff79
GSoC 2012 NS-3 LTE schedulers: updated version based on Tom's comment
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
9151
diff
changeset
|
385 |
NS_FATAL_ERROR ("unimplemented"); |
9149
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
386 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
387 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
388 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
389 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
390 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
391 |
TdTbfqFfMacScheduler::DoSchedDlRlcBufferReq (const struct FfMacSchedSapProvider::SchedDlRlcBufferReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
392 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
393 |
NS_LOG_FUNCTION (this << params.m_rnti << (uint32_t) params.m_logicalChannelIdentity); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
394 |
// API generated by RLC for updating RLC parameters on a LC (tx and retx queues) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
395 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
396 |
std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
397 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
398 |
LteFlowId_t flow (params.m_rnti, params.m_logicalChannelIdentity); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
399 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
400 |
it = m_rlcBufferReq.find (flow); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
401 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
402 |
if (it == m_rlcBufferReq.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
403 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
404 |
m_rlcBufferReq.insert (std::pair <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters> (flow, params)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
405 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
406 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
407 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
408 |
(*it).second = params; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
409 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
410 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
411 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
412 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
413 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
414 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
415 |
TdTbfqFfMacScheduler::DoSchedDlPagingBufferReq (const struct FfMacSchedSapProvider::SchedDlPagingBufferReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
416 |
{ |
9152
3135c059ff79
GSoC 2012 NS-3 LTE schedulers: updated version based on Tom's comment
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
9151
diff
changeset
|
417 |
NS_FATAL_ERROR ("unimplemented"); |
9149
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
418 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
419 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
420 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
421 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
422 |
TdTbfqFfMacScheduler::DoSchedDlMacBufferReq (const struct FfMacSchedSapProvider::SchedDlMacBufferReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
423 |
{ |
9152
3135c059ff79
GSoC 2012 NS-3 LTE schedulers: updated version based on Tom's comment
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
9151
diff
changeset
|
424 |
NS_FATAL_ERROR ("unimplemented"); |
9149
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
425 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
426 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
427 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
428 |
int |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
429 |
TdTbfqFfMacScheduler::GetRbgSize (int dlbandwidth) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
430 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
431 |
for (int i = 0; i < 4; i++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
432 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
433 |
if (dlbandwidth < TdTbfqType0AllocationRbg[i]) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
434 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
435 |
return (i + 1); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
436 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
437 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
438 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
439 |
return (-1); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
440 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
441 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
442 |
int |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
443 |
TdTbfqFfMacScheduler::LcActivePerFlow (uint16_t rnti) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
444 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
445 |
std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
446 |
int lcActive = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
447 |
for (it = m_rlcBufferReq.begin (); it != m_rlcBufferReq.end (); it++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
448 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
449 |
if (((*it).first.m_rnti == rnti) && (((*it).second.m_rlcTransmissionQueueSize > 0) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
450 |
|| ((*it).second.m_rlcRetransmissionQueueSize > 0) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
451 |
|| ((*it).second.m_rlcStatusPduSize > 0) )) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
452 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
453 |
lcActive++; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
454 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
455 |
if ((*it).first.m_rnti > rnti) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
456 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
457 |
break; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
458 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
459 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
460 |
return (lcActive); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
461 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
462 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
463 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
464 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
465 |
TdTbfqFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::SchedDlTriggerReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
466 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
467 |
NS_LOG_FUNCTION (this << " Frame no. " << (params.m_sfnSf >> 4) << " subframe no. " << (0xF & params.m_sfnSf)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
468 |
// API generated by RLC for triggering the scheduling of a DL subframe |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
469 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
470 |
// evaluate the relative channel quality indicator for each UE per each RBG |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
471 |
// (since we are using allocation type 0 the small unit of allocation is RBG) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
472 |
// Resource allocation type 0 (see sec 7.1.6.1 of 36.213) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
473 |
RefreshDlCqiMaps (); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
474 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
475 |
// update token pool, counter and bank size |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
476 |
std::map <uint16_t, tdtbfqsFlowPerf_t>::iterator itStats; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
477 |
for (itStats = m_flowStatsDl.begin (); itStats != m_flowStatsDl.end (); itStats++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
478 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
479 |
if ( (*itStats).second.tokenGenerationRate / 1000 + (*itStats).second.tokenPoolSize > (*itStats).second.maxTokenPoolSize ) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
480 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
481 |
(*itStats).second.counter += (*itStats).second.tokenGenerationRate / 1000 - ( (*itStats).second.maxTokenPoolSize - (*itStats).second.tokenPoolSize ); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
482 |
(*itStats).second.tokenPoolSize = (*itStats).second.maxTokenPoolSize; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
483 |
bankSize += (*itStats).second.tokenGenerationRate / 1000 - ( (*itStats).second.maxTokenPoolSize - (*itStats).second.tokenPoolSize ); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
484 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
485 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
486 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
487 |
(*itStats).second.tokenPoolSize += (*itStats).second.tokenGenerationRate / 1000; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
488 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
489 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
490 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
491 |
int rbgSize = GetRbgSize (m_cschedCellConfig.m_dlBandwidth); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
492 |
int rbgNum = m_cschedCellConfig.m_dlBandwidth / rbgSize; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
493 |
std::map <uint16_t, std::vector <uint16_t> > allocationMap; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
494 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
495 |
// select UE with largest metric |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
496 |
std::map <uint16_t, tdtbfqsFlowPerf_t>::iterator it; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
497 |
std::map <uint16_t, tdtbfqsFlowPerf_t>::iterator itMax = m_flowStatsDl.end (); |
9159
e4545deccc31
Initialize some metric parameters in GSoC 2012 LTE NS-3 MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
9153
diff
changeset
|
498 |
double metricMax = 0.0; |
9149
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
499 |
bool firstRnti = true; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
500 |
for (it = m_flowStatsDl.begin (); it != m_flowStatsDl.end (); it++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
501 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
502 |
if (LcActivePerFlow ((*it).first) == 0) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
503 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
504 |
continue; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
505 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
506 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
507 |
double metric = ( ( (double)(*it).second.counter ) / ( (double)(*it).second.tokenGenerationRate ) ); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
508 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
509 |
if (firstRnti == true) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
510 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
511 |
metricMax = metric; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
512 |
itMax = it; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
513 |
firstRnti = false; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
514 |
continue; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
515 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
516 |
if (metric > metricMax) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
517 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
518 |
metricMax = metric; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
519 |
itMax = it; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
520 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
521 |
} // end for m_flowStatsDl |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
522 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
523 |
if (itMax == m_flowStatsDl.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
524 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
525 |
// no UE available for downlink |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
526 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
527 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
528 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
529 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
530 |
// assign all RBGs to this UE |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
531 |
std::vector <uint16_t> tempMap; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
532 |
for (int i = 0; i < rbgNum; i++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
533 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
534 |
tempMap.push_back (i); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
535 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
536 |
allocationMap.insert (std::pair <uint16_t, std::vector <uint16_t> > ((*itMax).first, tempMap)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
537 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
538 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
539 |
// generate the transmission opportunities by grouping the RBGs of the same RNTI and |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
540 |
// creating the correspondent DCIs |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
541 |
FfMacSchedSapUser::SchedDlConfigIndParameters ret; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
542 |
std::map <uint16_t, std::vector <uint16_t> >::iterator itMap = allocationMap.begin (); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
543 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
544 |
while (itMap != allocationMap.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
545 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
546 |
// create new BuildDataListElement_s for this LC |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
547 |
BuildDataListElement_s newEl; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
548 |
newEl.m_rnti = (*itMap).first; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
549 |
// create the DlDciListElement_s |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
550 |
DlDciListElement_s newDci; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
551 |
std::vector <struct RlcPduListElement_s> newRlcPduLe; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
552 |
newDci.m_rnti = (*itMap).first; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
553 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
554 |
uint16_t lcActives = LcActivePerFlow ((*itMap).first); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
555 |
uint16_t RgbPerRnti = (*itMap).second.size (); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
556 |
std::map <uint16_t,SbMeasResult_s>::iterator itCqi; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
557 |
itCqi = m_a30CqiRxed.find ((*itMap).first); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
558 |
std::map <uint16_t,uint8_t>::iterator itTxMode; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
559 |
itTxMode = m_uesTxMode.find ((*itMap).first); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
560 |
if (itTxMode == m_uesTxMode.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
561 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
562 |
NS_FATAL_ERROR ("No Transmission Mode info on user " << (*itMap).first); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
563 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
564 |
int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
565 |
std::vector <uint8_t> worstCqi (2, 15); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
566 |
if (itCqi != m_a30CqiRxed.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
567 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
568 |
for (uint16_t k = 0; k < (*itMap).second.size (); k++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
569 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
570 |
if ((*itCqi).second.m_higherLayerSelected.size () > (*itMap).second.at (k)) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
571 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
572 |
for (uint8_t j = 0; j < nLayer; j++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
573 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
574 |
if ((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.size () > j) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
575 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
576 |
if (((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (j)) < worstCqi.at (j)) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
577 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
578 |
worstCqi.at (j) = ((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (j)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
579 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
580 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
581 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
582 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
583 |
// no CQI for this layer of this suband -> worst one |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
584 |
worstCqi.at (j) = 1; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
585 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
586 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
587 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
588 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
589 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
590 |
for (uint8_t j = 0; j < nLayer; j++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
591 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
592 |
worstCqi.at (j) = 1; // try with lowest MCS in RBG with no info on channel |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
593 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
594 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
595 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
596 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
597 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
598 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
599 |
for (uint8_t j = 0; j < nLayer; j++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
600 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
601 |
worstCqi.at (j) = 1; // try with lowest MCS in RBG with no info on channel |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
602 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
603 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
604 |
uint32_t bytesTxed = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
605 |
for (uint8_t j = 0; j < nLayer; j++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
606 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
607 |
newDci.m_mcs.push_back (m_amc->GetMcsFromCqi (worstCqi.at (j))); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
608 |
int tbSize = (m_amc->GetTbSizeFromMcs (newDci.m_mcs.at (j), RgbPerRnti * rbgSize) / 8); // (size of TB in bytes according to table 7.1.7.2.1-1 of 36.213) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
609 |
newDci.m_tbsSize.push_back (tbSize); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
610 |
bytesTxed += tbSize; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
611 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
612 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
613 |
newDci.m_resAlloc = 0; // only allocation type 0 at this stage |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
614 |
newDci.m_rbBitmap = 0; // TBD (32 bit bitmap see 7.1.6 of 36.213) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
615 |
uint32_t rbgMask = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
616 |
for (uint16_t k = 0; k < (*itMap).second.size (); k++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
617 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
618 |
rbgMask = rbgMask + (0x1 << (*itMap).second.at (k)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
619 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
620 |
newDci.m_rbBitmap = rbgMask; // (32 bit bitmap see 7.1.6 of 36.213) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
621 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
622 |
// create the rlc PDUs -> equally divide resources among actives LCs |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
623 |
std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator itBufReq; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
624 |
for (itBufReq = m_rlcBufferReq.begin (); itBufReq != m_rlcBufferReq.end (); itBufReq++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
625 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
626 |
if (((*itBufReq).first.m_rnti == (*itMap).first) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
627 |
&& (((*itBufReq).second.m_rlcTransmissionQueueSize > 0) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
628 |
|| ((*itBufReq).second.m_rlcRetransmissionQueueSize > 0) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
629 |
|| ((*itBufReq).second.m_rlcStatusPduSize > 0) )) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
630 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
631 |
for (uint8_t j = 0; j < nLayer; j++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
632 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
633 |
RlcPduListElement_s newRlcEl; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
634 |
newRlcEl.m_logicalChannelIdentity = (*itBufReq).first.m_lcId; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
635 |
newRlcEl.m_size = newDci.m_tbsSize.at (j) / lcActives; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
636 |
newRlcPduLe.push_back (newRlcEl); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
637 |
UpdateDlRlcBufferInfo (newDci.m_rnti, newRlcEl.m_logicalChannelIdentity, newRlcEl.m_size); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
638 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
639 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
640 |
if ((*itBufReq).first.m_rnti > (*itMap).first) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
641 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
642 |
break; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
643 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
644 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
645 |
newDci.m_ndi.push_back (1); // TBD (new data indicator) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
646 |
newDci.m_rv.push_back (0); // TBD (redundancy version) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
647 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
648 |
newEl.m_dci = newDci; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
649 |
// ...more parameters -> ingored in this version |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
650 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
651 |
newEl.m_rlcPduList.push_back (newRlcPduLe); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
652 |
ret.m_buildDataList.push_back (newEl); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
653 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
654 |
// update UE stats |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
655 |
std::map <uint16_t, tdtbfqsFlowPerf_t>::iterator it; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
656 |
it = m_flowStatsDl.find ((*itMap).first); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
657 |
if (it != m_flowStatsDl.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
658 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
659 |
if ( bytesTxed <= (*it).second.tokenPoolSize ) |
9153
f04612961e79
correct code style errors in GSoC 2012 LTE NS-3 MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
9152
diff
changeset
|
660 |
{ |
f04612961e79
correct code style errors in GSoC 2012 LTE NS-3 MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
9152
diff
changeset
|
661 |
(*it).second.tokenPoolSize -= bytesTxed; |
f04612961e79
correct code style errors in GSoC 2012 LTE NS-3 MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
9152
diff
changeset
|
662 |
} |
f04612961e79
correct code style errors in GSoC 2012 LTE NS-3 MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
9152
diff
changeset
|
663 |
else |
f04612961e79
correct code style errors in GSoC 2012 LTE NS-3 MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
9152
diff
changeset
|
664 |
{ |
f04612961e79
correct code style errors in GSoC 2012 LTE NS-3 MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
9152
diff
changeset
|
665 |
(*it).second.counter = (*it).second.counter - ( bytesTxed - (*it).second.tokenPoolSize ); |
f04612961e79
correct code style errors in GSoC 2012 LTE NS-3 MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
9152
diff
changeset
|
666 |
(*it).second.tokenPoolSize = 0; |
f04612961e79
correct code style errors in GSoC 2012 LTE NS-3 MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
9152
diff
changeset
|
667 |
if (bankSize <= ( bytesTxed - (*it).second.tokenPoolSize )) |
f04612961e79
correct code style errors in GSoC 2012 LTE NS-3 MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
9152
diff
changeset
|
668 |
bankSize = 0; |
f04612961e79
correct code style errors in GSoC 2012 LTE NS-3 MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
9152
diff
changeset
|
669 |
else |
f04612961e79
correct code style errors in GSoC 2012 LTE NS-3 MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
9152
diff
changeset
|
670 |
bankSize = bankSize - ( bytesTxed - (*it).second.tokenPoolSize ); |
f04612961e79
correct code style errors in GSoC 2012 LTE NS-3 MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
9152
diff
changeset
|
671 |
} |
9149
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
672 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
673 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
674 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
675 |
NS_LOG_DEBUG (this << " No Stats for this allocated UE"); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
676 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
677 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
678 |
itMap++; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
679 |
} // end while allocation |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
680 |
ret.m_nrOfPdcchOfdmSymbols = 1; // TODO: check correct value according the DCIs txed |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
681 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
682 |
m_schedSapUser->SchedDlConfigInd (ret); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
683 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
684 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
685 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
686 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
687 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
688 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
689 |
TdTbfqFfMacScheduler::DoSchedDlRachInfoReq (const struct FfMacSchedSapProvider::SchedDlRachInfoReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
690 |
{ |
9152
3135c059ff79
GSoC 2012 NS-3 LTE schedulers: updated version based on Tom's comment
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
9151
diff
changeset
|
691 |
NS_FATAL_ERROR ("unimplemented"); |
9149
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
692 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
693 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
694 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
695 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
696 |
TdTbfqFfMacScheduler::DoSchedDlCqiInfoReq (const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
697 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
698 |
NS_LOG_FUNCTION (this); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
699 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
700 |
for (unsigned int i = 0; i < params.m_cqiList.size (); i++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
701 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
702 |
if ( params.m_cqiList.at (i).m_cqiType == CqiListElement_s::P10 ) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
703 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
704 |
// wideband CQI reporting |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
705 |
std::map <uint16_t,uint8_t>::iterator it; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
706 |
uint16_t rnti = params.m_cqiList.at (i).m_rnti; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
707 |
it = m_p10CqiRxed.find (rnti); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
708 |
if (it == m_p10CqiRxed.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
709 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
710 |
// create the new entry |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
711 |
m_p10CqiRxed.insert ( std::pair<uint16_t, uint8_t > (rnti, params.m_cqiList.at (i).m_wbCqi.at (0)) ); // only codeword 0 at this stage (SISO) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
712 |
// generate correspondent timer |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
713 |
m_p10CqiTimers.insert ( std::pair<uint16_t, uint32_t > (rnti, m_cqiTimersThreshold)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
714 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
715 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
716 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
717 |
// update the CQI value and refresh correspondent timer |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
718 |
(*it).second = params.m_cqiList.at (i).m_wbCqi.at (0); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
719 |
// update correspondent timer |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
720 |
std::map <uint16_t,uint32_t>::iterator itTimers; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
721 |
itTimers = m_p10CqiTimers.find (rnti); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
722 |
(*itTimers).second = m_cqiTimersThreshold; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
723 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
724 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
725 |
else if ( params.m_cqiList.at (i).m_cqiType == CqiListElement_s::A30 ) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
726 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
727 |
// subband CQI reporting high layer configured |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
728 |
std::map <uint16_t,SbMeasResult_s>::iterator it; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
729 |
uint16_t rnti = params.m_cqiList.at (i).m_rnti; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
730 |
it = m_a30CqiRxed.find (rnti); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
731 |
if (it == m_a30CqiRxed.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
732 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
733 |
// create the new entry |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
734 |
m_a30CqiRxed.insert ( std::pair<uint16_t, SbMeasResult_s > (rnti, params.m_cqiList.at (i).m_sbMeasResult) ); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
735 |
m_a30CqiTimers.insert ( std::pair<uint16_t, uint32_t > (rnti, m_cqiTimersThreshold)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
736 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
737 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
738 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
739 |
// update the CQI value and refresh correspondent timer |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
740 |
(*it).second = params.m_cqiList.at (i).m_sbMeasResult; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
741 |
std::map <uint16_t,uint32_t>::iterator itTimers; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
742 |
itTimers = m_a30CqiTimers.find (rnti); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
743 |
(*itTimers).second = m_cqiTimersThreshold; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
744 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
745 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
746 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
747 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
748 |
NS_LOG_ERROR (this << " CQI type unknown"); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
749 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
750 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
751 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
752 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
753 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
754 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
755 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
756 |
double |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
757 |
TdTbfqFfMacScheduler::EstimateUlSinr (uint16_t rnti, uint16_t rb) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
758 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
759 |
std::map <uint16_t, std::vector <double> >::iterator itCqi = m_ueCqi.find (rnti); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
760 |
if (itCqi == m_ueCqi.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
761 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
762 |
// no cqi info about this UE |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
763 |
return (NO_SINR); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
764 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
765 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
766 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
767 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
768 |
// take the average SINR value among the available |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
769 |
double sinrSum = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
770 |
int sinrNum = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
771 |
for (uint32_t i = 0; i < m_cschedCellConfig.m_ulBandwidth; i++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
772 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
773 |
double sinr = (*itCqi).second.at (i); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
774 |
if (sinr != NO_SINR) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
775 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
776 |
sinrSum += sinr; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
777 |
sinrNum++; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
778 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
779 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
780 |
double estimatedSinr = sinrSum / (double)sinrNum; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
781 |
// store the value |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
782 |
(*itCqi).second.at (rb) = estimatedSinr; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
783 |
return (estimatedSinr); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
784 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
785 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
786 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
787 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
788 |
TdTbfqFfMacScheduler::DoSchedUlTriggerReq (const struct FfMacSchedSapProvider::SchedUlTriggerReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
789 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
790 |
NS_LOG_FUNCTION (this << " UL - Frame no. " << (params.m_sfnSf >> 4) << " subframe no. " << (0xF & params.m_sfnSf)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
791 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
792 |
RefreshUlCqiMaps (); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
793 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
794 |
std::map <uint16_t,uint32_t>::iterator it; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
795 |
int nflows = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
796 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
797 |
for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
798 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
799 |
// remove old entries of this UE-LC |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
800 |
if ((*it).second > 0) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
801 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
802 |
nflows++; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
803 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
804 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
805 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
806 |
if (nflows == 0) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
807 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
808 |
return ; // no flows to be scheduled |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
809 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
810 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
811 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
812 |
// Divide the resource equally among the active users |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
813 |
int rbPerFlow = m_cschedCellConfig.m_ulBandwidth / nflows; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
814 |
if (rbPerFlow == 0) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
815 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
816 |
rbPerFlow = 1; // at least 1 rbg per flow (till available resource) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
817 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
818 |
int rbAllocated = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
819 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
820 |
FfMacSchedSapUser::SchedUlConfigIndParameters ret; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
821 |
std::vector <uint16_t> rbgAllocationMap; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
822 |
if (m_nextRntiUl != 0) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
823 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
824 |
for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
825 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
826 |
if ((*it).first == m_nextRntiUl) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
827 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
828 |
break; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
829 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
830 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
831 |
if (it == m_ceBsrRxed.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
832 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
833 |
NS_LOG_ERROR (this << " no user found"); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
834 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
835 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
836 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
837 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
838 |
it = m_ceBsrRxed.begin (); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
839 |
m_nextRntiUl = (*it).first; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
840 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
841 |
do |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
842 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
843 |
if (rbAllocated + rbPerFlow > m_cschedCellConfig.m_ulBandwidth) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
844 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
845 |
// limit to physical resources last resource assignment |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
846 |
rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
847 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
848 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
849 |
UlDciListElement_s uldci; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
850 |
uldci.m_rnti = (*it).first; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
851 |
uldci.m_rbStart = rbAllocated; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
852 |
uldci.m_rbLen = rbPerFlow; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
853 |
std::map <uint16_t, std::vector <double> >::iterator itCqi = m_ueCqi.find ((*it).first); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
854 |
int cqi = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
855 |
if (itCqi == m_ueCqi.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
856 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
857 |
// no cqi info about this UE |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
858 |
uldci.m_mcs = 0; // MCS 0 -> UL-AMC TBD |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
859 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
860 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
861 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
862 |
// take the lowest CQI value (worst RB) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
863 |
double minSinr = (*itCqi).second.at (uldci.m_rbStart); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
864 |
if (minSinr == NO_SINR) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
865 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
866 |
minSinr = EstimateUlSinr ((*it).first, uldci.m_rbStart); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
867 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
868 |
for (uint16_t i = uldci.m_rbStart; i < uldci.m_rbStart + uldci.m_rbLen; i++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
869 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
870 |
double sinr = (*itCqi).second.at (i); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
871 |
if (sinr == NO_SINR) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
872 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
873 |
sinr = EstimateUlSinr ((*it).first, i); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
874 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
875 |
if ((*itCqi).second.at (i) < minSinr) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
876 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
877 |
minSinr = (*itCqi).second.at (i); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
878 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
879 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
880 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
881 |
// translate SINR -> cqi: WILD ACK: same as DL |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
882 |
double s = log2 ( 1 + ( |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
883 |
std::pow (10, minSinr / 10 ) / |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
884 |
( (-std::log (5.0 * 0.00005 )) / 1.5) )); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
885 |
cqi = m_amc->GetCqiFromSpectralEfficiency (s); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
886 |
if (cqi == 0) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
887 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
888 |
it++; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
889 |
if (it == m_ceBsrRxed.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
890 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
891 |
// restart from the first |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
892 |
it = m_ceBsrRxed.begin (); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
893 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
894 |
continue; // CQI == 0 means "out of range" (see table 7.2.3-1 of 36.213) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
895 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
896 |
uldci.m_mcs = m_amc->GetMcsFromCqi (cqi); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
897 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
898 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
899 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
900 |
rbAllocated += rbPerFlow; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
901 |
// store info on allocation for managing ul-cqi interpretation |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
902 |
for (int i = 0; i < rbPerFlow; i++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
903 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
904 |
rbgAllocationMap.push_back ((*it).first); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
905 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
906 |
uldci.m_tbSize = (m_amc->GetTbSizeFromMcs (uldci.m_mcs, rbPerFlow) / 8); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
907 |
NS_LOG_DEBUG (this << " UE " << (*it).first << " startPRB " << (uint32_t)uldci.m_rbStart << " nPRB " << (uint32_t)uldci.m_rbLen << " CQI " << cqi << " MCS " << (uint32_t)uldci.m_mcs << " TBsize " << uldci.m_tbSize << " RbAlloc " << rbAllocated); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
908 |
UpdateUlRlcBufferInfo (uldci.m_rnti, uldci.m_tbSize); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
909 |
uldci.m_ndi = 1; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
910 |
uldci.m_cceIndex = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
911 |
uldci.m_aggrLevel = 1; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
912 |
uldci.m_ueTxAntennaSelection = 3; // antenna selection OFF |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
913 |
uldci.m_hopping = false; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
914 |
uldci.m_n2Dmrs = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
915 |
uldci.m_tpc = 0; // no power control |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
916 |
uldci.m_cqiRequest = false; // only period CQI at this stage |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
917 |
uldci.m_ulIndex = 0; // TDD parameter |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
918 |
uldci.m_dai = 1; // TDD parameter |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
919 |
uldci.m_freqHopping = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
920 |
uldci.m_pdcchPowerOffset = 0; // not used |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
921 |
ret.m_dciList.push_back (uldci); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
922 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
923 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
924 |
it++; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
925 |
if (it == m_ceBsrRxed.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
926 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
927 |
// restart from the first |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
928 |
it = m_ceBsrRxed.begin (); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
929 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
930 |
if (rbAllocated == m_cschedCellConfig.m_ulBandwidth) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
931 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
932 |
// Stop allocation: no more PRBs |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
933 |
m_nextRntiUl = (*it).first; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
934 |
break; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
935 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
936 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
937 |
while ((*it).first != m_nextRntiUl); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
938 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
939 |
m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params.m_sfnSf, rbgAllocationMap)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
940 |
m_schedSapUser->SchedUlConfigInd (ret); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
941 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
942 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
943 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
944 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
945 |
TdTbfqFfMacScheduler::DoSchedUlNoiseInterferenceReq (const struct FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
946 |
{ |
9152
3135c059ff79
GSoC 2012 NS-3 LTE schedulers: updated version based on Tom's comment
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
9151
diff
changeset
|
947 |
NS_FATAL_ERROR ("unimplemented"); |
9149
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
948 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
949 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
950 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
951 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
952 |
TdTbfqFfMacScheduler::DoSchedUlSrInfoReq (const struct FfMacSchedSapProvider::SchedUlSrInfoReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
953 |
{ |
9152
3135c059ff79
GSoC 2012 NS-3 LTE schedulers: updated version based on Tom's comment
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
9151
diff
changeset
|
954 |
NS_FATAL_ERROR ("unimplemented"); |
9149
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
955 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
956 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
957 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
958 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
959 |
TdTbfqFfMacScheduler::DoSchedUlMacCtrlInfoReq (const struct FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
960 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
961 |
NS_LOG_FUNCTION (this); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
962 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
963 |
std::map <uint16_t,uint32_t>::iterator it; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
964 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
965 |
for (unsigned int i = 0; i < params.m_macCeList.size (); i++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
966 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
967 |
if ( params.m_macCeList.at (i).m_macCeType == MacCeListElement_s::BSR ) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
968 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
969 |
// buffer status report |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
970 |
// note that we only consider LCG 0, the other three LCGs are neglected |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
971 |
// this is consistent with the assumption in LteUeMac that the first LCG gathers all LCs |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
972 |
uint16_t rnti = params.m_macCeList.at (i).m_rnti; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
973 |
it = m_ceBsrRxed.find (rnti); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
974 |
if (it == m_ceBsrRxed.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
975 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
976 |
// create the new entry |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
977 |
uint8_t bsrId = params.m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (0); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
978 |
int buffer = BufferSizeLevelBsr::BsrId2BufferSize (bsrId); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
979 |
m_ceBsrRxed.insert ( std::pair<uint16_t, uint32_t > (rnti, buffer)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
980 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
981 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
982 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
983 |
// update the buffer size value |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
984 |
(*it).second = BufferSizeLevelBsr::BsrId2BufferSize (params.m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (0)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
985 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
986 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
987 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
988 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
989 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
990 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
991 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
992 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
993 |
TdTbfqFfMacScheduler::DoSchedUlCqiInfoReq (const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters& params) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
994 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
995 |
NS_LOG_FUNCTION (this); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
996 |
// retrieve the allocation for this subframe |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
997 |
switch (m_ulCqiFilter) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
998 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
999 |
case FfMacScheduler::SRS_UL_CQI: |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1000 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1001 |
// filter all the CQIs that are not SRS based |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1002 |
if (params.m_ulCqi.m_type!=UlCqi_s::SRS) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1003 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1004 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1005 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1006 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1007 |
break; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1008 |
case FfMacScheduler::PUSCH_UL_CQI: |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1009 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1010 |
// filter all the CQIs that are not SRS based |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1011 |
if (params.m_ulCqi.m_type!=UlCqi_s::PUSCH) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1012 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1013 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1014 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1015 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1016 |
case FfMacScheduler::ALL_UL_CQI: |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1017 |
break; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1018 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1019 |
default: |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1020 |
NS_FATAL_ERROR ("Unknown UL CQI type"); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1021 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1022 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1023 |
switch (params.m_ulCqi.m_type) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1024 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1025 |
case UlCqi_s::PUSCH: |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1026 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1027 |
std::map <uint16_t, std::vector <uint16_t> >::iterator itMap; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1028 |
std::map <uint16_t, std::vector <double> >::iterator itCqi; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1029 |
itMap = m_allocationMaps.find (params.m_sfnSf); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1030 |
if (itMap == m_allocationMaps.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1031 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1032 |
NS_LOG_DEBUG (this << " Does not find info on allocation, size : " << m_allocationMaps.size ()); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1033 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1034 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1035 |
for (uint32_t i = 0; i < (*itMap).second.size (); i++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1036 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1037 |
// convert from fixed point notation Sxxxxxxxxxxx.xxx to double |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1038 |
// NS_LOG_INFO (this << " i " << i << " size " << params.m_ulCqi.m_sinr.size () << " mapSIze " << (*itMap).second.size ()); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1039 |
double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (i)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1040 |
itCqi = m_ueCqi.find ((*itMap).second.at (i)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1041 |
if (itCqi == m_ueCqi.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1042 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1043 |
// create a new entry |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1044 |
std::vector <double> newCqi; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1045 |
for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1046 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1047 |
if (i == j) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1048 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1049 |
newCqi.push_back (sinr); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1050 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1051 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1052 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1053 |
// initialize with NO_SINR value. |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1054 |
newCqi.push_back (NO_SINR); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1055 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1056 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1057 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1058 |
m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > ((*itMap).second.at (i), newCqi)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1059 |
// generate correspondent timer |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1060 |
m_ueCqiTimers.insert (std::pair <uint16_t, uint32_t > ((*itMap).second.at (i), m_cqiTimersThreshold)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1061 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1062 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1063 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1064 |
// update the value |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1065 |
(*itCqi).second.at (i) = sinr; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1066 |
// update correspondent timer |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1067 |
std::map <uint16_t, uint32_t>::iterator itTimers; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1068 |
itTimers = m_ueCqiTimers.find ((*itMap).second.at (i)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1069 |
(*itTimers).second = m_cqiTimersThreshold; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1070 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1071 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1072 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1073 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1074 |
// remove obsolete info on allocation |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1075 |
m_allocationMaps.erase (itMap); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1076 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1077 |
break; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1078 |
case UlCqi_s::SRS: |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1079 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1080 |
// get the RNTI from vendor specific parameters |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1081 |
uint16_t rnti = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1082 |
NS_ASSERT (params.m_vendorSpecificList.size () > 0); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1083 |
for (uint16_t i = 0; i < params.m_vendorSpecificList.size (); i++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1084 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1085 |
if (params.m_vendorSpecificList.at (i).m_type == SRS_CQI_RNTI_VSP) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1086 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1087 |
Ptr<SrsCqiRntiVsp> vsp = DynamicCast<SrsCqiRntiVsp> (params.m_vendorSpecificList.at (i).m_value); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1088 |
rnti = vsp->GetRnti (); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1089 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1090 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1091 |
std::map <uint16_t, std::vector <double> >::iterator itCqi; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1092 |
itCqi = m_ueCqi.find (rnti); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1093 |
if (itCqi == m_ueCqi.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1094 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1095 |
// create a new entry |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1096 |
std::vector <double> newCqi; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1097 |
for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1098 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1099 |
double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (j)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1100 |
newCqi.push_back (sinr); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1101 |
NS_LOG_DEBUG (this << " RNTI " << rnti << " new SRS-CQI for RB " << j << " value " << sinr); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1102 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1103 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1104 |
m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > (rnti, newCqi)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1105 |
// generate correspondent timer |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1106 |
m_ueCqiTimers.insert (std::pair <uint16_t, uint32_t > (rnti, m_cqiTimersThreshold)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1107 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1108 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1109 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1110 |
// update the values |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1111 |
for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1112 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1113 |
double sinr = LteFfConverter::fpS11dot3toDouble (params.m_ulCqi.m_sinr.at (j)); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1114 |
(*itCqi).second.at (j) = sinr; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1115 |
NS_LOG_DEBUG (this << " RNTI " << rnti << " update SRS-CQI for RB " << j << " value " << sinr); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1116 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1117 |
// update correspondent timer |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1118 |
std::map <uint16_t, uint32_t>::iterator itTimers; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1119 |
itTimers = m_ueCqiTimers.find (rnti); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1120 |
(*itTimers).second = m_cqiTimersThreshold; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1121 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1122 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1123 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1124 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1125 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1126 |
break; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1127 |
case UlCqi_s::PUCCH_1: |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1128 |
case UlCqi_s::PUCCH_2: |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1129 |
case UlCqi_s::PRACH: |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1130 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1131 |
NS_FATAL_ERROR ("TdTbfqFfMacScheduler supports only PUSCH and SRS UL-CQIs"); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1132 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1133 |
break; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1134 |
default: |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1135 |
NS_FATAL_ERROR ("Unknown type of UL-CQI"); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1136 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1137 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1138 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1139 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1140 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1141 |
TdTbfqFfMacScheduler::RefreshDlCqiMaps(void) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1142 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1143 |
// refresh DL CQI P01 Map |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1144 |
std::map <uint16_t,uint32_t>::iterator itP10 = m_p10CqiTimers.begin (); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1145 |
while (itP10!=m_p10CqiTimers.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1146 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1147 |
// NS_LOG_INFO (this << " P10-CQI for user " << (*itP10).first << " is " << (uint32_t)(*itP10).second << " thr " << (uint32_t)m_cqiTimersThreshold); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1148 |
if ((*itP10).second == 0) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1149 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1150 |
// delete correspondent entries |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1151 |
std::map <uint16_t,uint8_t>::iterator itMap = m_p10CqiRxed.find ((*itP10).first); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1152 |
NS_ASSERT_MSG (itMap != m_p10CqiRxed.end (), " Does not find CQI report for user " << (*itP10).first); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1153 |
NS_LOG_INFO (this << " P10-CQI exired for user " << (*itP10).first); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1154 |
m_p10CqiRxed.erase (itMap); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1155 |
std::map <uint16_t,uint32_t>::iterator temp = itP10; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1156 |
itP10++; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1157 |
m_p10CqiTimers.erase (temp); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1158 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1159 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1160 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1161 |
(*itP10).second--; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1162 |
itP10++; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1163 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1164 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1165 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1166 |
// refresh DL CQI A30 Map |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1167 |
std::map <uint16_t,uint32_t>::iterator itA30 = m_a30CqiTimers.begin (); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1168 |
while (itA30!=m_a30CqiTimers.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1169 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1170 |
// NS_LOG_INFO (this << " A30-CQI for user " << (*itA30).first << " is " << (uint32_t)(*itA30).second << " thr " << (uint32_t)m_cqiTimersThreshold); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1171 |
if ((*itA30).second == 0) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1172 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1173 |
// delete correspondent entries |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1174 |
std::map <uint16_t,SbMeasResult_s>::iterator itMap = m_a30CqiRxed.find ((*itA30).first); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1175 |
NS_ASSERT_MSG (itMap != m_a30CqiRxed.end (), " Does not find CQI report for user " << (*itA30).first); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1176 |
NS_LOG_INFO (this << " A30-CQI exired for user " << (*itA30).first); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1177 |
m_a30CqiRxed.erase (itMap); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1178 |
std::map <uint16_t,uint32_t>::iterator temp = itA30; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1179 |
itA30++; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1180 |
m_a30CqiTimers.erase (temp); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1181 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1182 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1183 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1184 |
(*itA30).second--; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1185 |
itA30++; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1186 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1187 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1188 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1189 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1190 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1191 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1192 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1193 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1194 |
TdTbfqFfMacScheduler::RefreshUlCqiMaps(void) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1195 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1196 |
// refresh UL CQI Map |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1197 |
std::map <uint16_t,uint32_t>::iterator itUl = m_ueCqiTimers.begin (); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1198 |
while (itUl!=m_ueCqiTimers.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1199 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1200 |
// NS_LOG_INFO (this << " UL-CQI for user " << (*itUl).first << " is " << (uint32_t)(*itUl).second << " thr " << (uint32_t)m_cqiTimersThreshold); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1201 |
if ((*itUl).second == 0) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1202 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1203 |
// delete correspondent entries |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1204 |
std::map <uint16_t, std::vector <double> >::iterator itMap = m_ueCqi.find ((*itUl).first); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1205 |
NS_ASSERT_MSG (itMap != m_ueCqi.end (), " Does not find CQI report for user " << (*itUl).first); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1206 |
NS_LOG_INFO (this << " UL-CQI exired for user " << (*itUl).first); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1207 |
(*itMap).second.clear (); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1208 |
m_ueCqi.erase (itMap); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1209 |
std::map <uint16_t,uint32_t>::iterator temp = itUl; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1210 |
itUl++; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1211 |
m_ueCqiTimers.erase (temp); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1212 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1213 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1214 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1215 |
(*itUl).second--; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1216 |
itUl++; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1217 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1218 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1219 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1220 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1221 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1222 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1223 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1224 |
TdTbfqFfMacScheduler::UpdateDlRlcBufferInfo (uint16_t rnti, uint8_t lcid, uint16_t size) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1225 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1226 |
size = size - 2; // remove the minimum RLC overhead |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1227 |
std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1228 |
LteFlowId_t flow (rnti, lcid); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1229 |
it = m_rlcBufferReq.find (flow); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1230 |
if (it!=m_rlcBufferReq.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1231 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1232 |
// Update queues: RLC tx order Status, ReTx, Tx |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1233 |
// Update status queue |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1234 |
if ((*it).second.m_rlcStatusPduSize <= size) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1235 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1236 |
size -= (*it).second.m_rlcStatusPduSize; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1237 |
(*it).second.m_rlcStatusPduSize = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1238 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1239 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1240 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1241 |
(*it).second.m_rlcStatusPduSize -= size; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1242 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1243 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1244 |
// update retransmission queue |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1245 |
if ((*it).second.m_rlcRetransmissionQueueSize <= size) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1246 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1247 |
size -= (*it).second.m_rlcRetransmissionQueueSize; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1248 |
(*it).second.m_rlcRetransmissionQueueSize = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1249 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1250 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1251 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1252 |
(*it).second.m_rlcRetransmissionQueueSize -= size; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1253 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1254 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1255 |
// update transmission queue |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1256 |
if ((*it).second.m_rlcTransmissionQueueSize <= size) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1257 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1258 |
size -= (*it).second.m_rlcTransmissionQueueSize; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1259 |
(*it).second.m_rlcTransmissionQueueSize = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1260 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1261 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1262 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1263 |
(*it).second.m_rlcTransmissionQueueSize -= size; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1264 |
return; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1265 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1266 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1267 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1268 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1269 |
NS_LOG_ERROR (this << " Does not find DL RLC Buffer Report of UE " << rnti); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1270 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1271 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1272 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1273 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1274 |
TdTbfqFfMacScheduler::UpdateUlRlcBufferInfo (uint16_t rnti, uint16_t size) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1275 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1276 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1277 |
size = size - 2; // remove the minimum RLC overhead |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1278 |
std::map <uint16_t,uint32_t>::iterator it = m_ceBsrRxed.find (rnti); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1279 |
if (it!=m_ceBsrRxed.end ()) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1280 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1281 |
if ((*it).second >= size) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1282 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1283 |
(*it).second -= size; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1284 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1285 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1286 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1287 |
(*it).second = 0; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1288 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1289 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1290 |
else |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1291 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1292 |
NS_LOG_ERROR (this << " Does not find BSR report info of UE " << rnti); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1293 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1294 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1295 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1296 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1297 |
void |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1298 |
TdTbfqFfMacScheduler::TransmissionModeConfigurationUpdate (uint16_t rnti, uint8_t txMode) |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1299 |
{ |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1300 |
NS_LOG_FUNCTION (this << " RNTI " << rnti << " txMode " << (uint16_t)txMode); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1301 |
FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1302 |
params.m_rnti = rnti; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1303 |
params.m_transmissionMode = txMode; |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1304 |
m_cschedSapUser->CschedUeConfigUpdateInd (params); |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1305 |
} |
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1306 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1307 |
|
2580b67c83b3
GSoC 2012 NS-3 LTE MAC schedulers
Dizhi Zhou <dizhi.zhou@gmail.com>
parents:
diff
changeset
|
1308 |
} |