21 #include <ns3/boolean.h>
23 #include <ns3/lte-amc.h>
24 #include <ns3/lte-vendor-specific-parameters.h>
26 #include <ns3/pointer.h>
27 #include <ns3/pss-ff-mac-scheduler.h>
28 #include <ns3/simulator.h>
29 #include <ns3/string.h>
51 : m_cschedSapUser(nullptr),
52 m_schedSapUser(nullptr),
56 m_amc = CreateObject<LteAmc>();
88 TypeId(
"ns3::PssFfMacScheduler")
92 .AddAttribute(
"CqiTimerThreshold",
93 "The number of TTIs a CQI is valid (default 1000 - 1 sec.)",
96 MakeUintegerChecker<uint32_t>())
97 .AddAttribute(
"PssFdSchedulerType",
98 "FD scheduler in PSS (default value is PFsch)",
102 .AddAttribute(
"nMux",
103 "The number of UE selected by TD scheduler (default value is 0)",
106 MakeUintegerChecker<uint32_t>())
107 .AddAttribute(
"HarqEnabled",
108 "Activate/Deactivate the HARQ [by default is active].",
112 .AddAttribute(
"UlGrantMcs",
113 "The MCS of the UL grant, must be [0..15] (default 0)",
116 MakeUintegerChecker<uint8_t>());
174 << (uint16_t)
params.m_transmissionMode);
182 dlHarqPrcStatus.resize(8, 0);
184 std::pair<uint16_t, DlHarqProcessesStatus_t>(
params.m_rnti, dlHarqPrcStatus));
186 dlHarqProcessesTimer.resize(8, 0);
188 std::pair<uint16_t, DlHarqProcessesTimer_t>(
params.m_rnti, dlHarqProcessesTimer));
192 std::pair<uint16_t, DlHarqProcessesDciBuffer_t>(
params.m_rnti, dlHarqdci));
194 dlHarqRlcPdu.resize(2);
195 dlHarqRlcPdu.at(0).resize(8);
196 dlHarqRlcPdu.at(1).resize(8);
198 std::pair<uint16_t, DlHarqRlcPduListBuffer_t>(
params.m_rnti, dlHarqRlcPdu));
201 ulHarqPrcStatus.resize(8, 0);
203 std::pair<uint16_t, UlHarqProcessesStatus_t>(
params.m_rnti, ulHarqPrcStatus));
207 std::pair<uint16_t, UlHarqProcessesDciBuffer_t>(
params.m_rnti, ulHarqdci));
211 (*it).second =
params.m_transmissionMode;
221 std::map<uint16_t, pssFlowPerf_t>::iterator it;
222 for (std::size_t i = 0; i <
params.m_logicalChannelConfigList.size(); i++)
228 double tbrDlInBytes =
229 params.m_logicalChannelConfigList.at(i).m_eRabGuaranteedBitrateDl / 8;
230 double tbrUlInBytes =
231 params.m_logicalChannelConfigList.at(i).m_eRabGuaranteedBitrateUl / 8;
253 double tbrDlInBytes =
254 params.m_logicalChannelConfigList.at(i).m_eRabGuaranteedBitrateDl / 8;
255 double tbrUlInBytes =
256 params.m_logicalChannelConfigList.at(i).m_eRabGuaranteedBitrateUl / 8;
268 for (std::size_t i = 0; i <
params.m_logicalChannelIdentity.size(); i++)
270 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it =
272 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator temp;
275 if (((*it).first.m_rnti ==
params.m_rnti) &&
276 ((*it).first.m_lcId ==
params.m_logicalChannelIdentity.at(i)))
308 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it =
310 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator temp;
313 if ((*it).first.m_rnti ==
params.m_rnti)
337 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
346 std::pair<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>(flow,
374 for (
int i = 0; i < 4; i++)
388 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
389 unsigned int lcActive = 0;
392 if (((*it).first.m_rnti == rnti) && (((*it).second.m_rlcTransmissionQueueSize > 0) ||
393 ((*it).second.m_rlcRetransmissionQueueSize > 0) ||
394 ((*it).second.m_rlcStatusPduSize > 0)))
398 if ((*it).first.m_rnti > rnti)
416 std::map<uint16_t, DlHarqProcessesStatus_t>::iterator itStat =
420 NS_FATAL_ERROR(
"No Process Id Statusfound for this RNTI " << rnti);
422 uint8_t i = (*it).second;
426 }
while (((*itStat).second.at(i) != 0) && (i != (*it).second));
427 if ((*itStat).second.at(i) == 0)
452 std::map<uint16_t, DlHarqProcessesStatus_t>::iterator itStat =
456 NS_FATAL_ERROR(
"No Process Id Statusfound for this RNTI " << rnti);
458 uint8_t i = (*it).second;
462 }
while (((*itStat).second.at(i) != 0) && (i != (*it).second));
463 if ((*itStat).second.at(i) == 0)
466 (*itStat).second.at(i) = 1;
471 << rnti <<
" check before update with HarqProcessAvailability");
474 return ((*it).second);
482 std::map<uint16_t, DlHarqProcessesTimer_t>::iterator itTimers;
492 NS_LOG_DEBUG(
this <<
" Reset HARQ proc " << i <<
" for RNTI " << (*itTimers).first);
493 std::map<uint16_t, DlHarqProcessesStatus_t>::iterator itStat =
498 << (*itTimers).first);
500 (*itStat).second.at(i) = 0;
501 (*itTimers).second.at(i) = 0;
505 (*itTimers).second.at(i)++;
516 << (0xF &
params.m_sfnSf));
527 std::map<uint16_t, std::vector<uint16_t>> allocationMap;
528 std::vector<bool> rbgMap;
529 uint16_t rbgAllocatedNum = 0;
530 std::set<uint16_t> rntiAllocated;
534 for (std::vector<bool>::iterator it = rbgMap.begin(); it != rbgMap.end(); it++)
545 std::map<uint16_t, uint8_t>::iterator itProcId;
549 (*itProcId).second = ((*itProcId).second + 1) %
HARQ_PROC_NUM;
553 std::vector<bool> ulRbMap;
556 uint8_t maxContinuousUlBandwidth = 0;
557 uint8_t tmpMinBandwidth = 0;
558 uint16_t ffrRbStartOffset = 0;
559 uint16_t tmpFfrRbStartOffset = 0;
562 for (std::vector<bool>::iterator it = ulRbMap.begin(); it != ulRbMap.end(); it++)
566 if (tmpMinBandwidth > maxContinuousUlBandwidth)
568 maxContinuousUlBandwidth = tmpMinBandwidth;
569 ffrRbStartOffset = tmpFfrRbStartOffset;
575 if (tmpMinBandwidth == 0)
577 tmpFfrRbStartOffset = index;
584 if (tmpMinBandwidth > maxContinuousUlBandwidth)
586 maxContinuousUlBandwidth = tmpMinBandwidth;
587 ffrRbStartOffset = tmpFfrRbStartOffset;
591 uint16_t rbStart = 0;
592 rbStart = ffrRbStartOffset;
593 std::vector<struct RachListElement_s>::iterator itRach;
597 (*itRach).m_estimatedSize,
598 " Default UL Grant MCS does not allow to send RACH messages");
600 newRar.
m_rnti = (*itRach).m_rnti;
607 uint16_t tbSizeBits = 0;
609 while ((tbSizeBits < (*itRach).m_estimatedSize) &&
610 (rbStart + rbLen < (ffrRbStartOffset + maxContinuousUlBandwidth)))
615 if (tbSizeBits < (*itRach).m_estimatedSize)
627 NS_LOG_INFO(
this <<
" UL grant allocated to RNTI " << (*itRach).m_rnti <<
" rbStart "
628 << rbStart <<
" rbLen " << rbLen <<
" MCS " << (uint16_t)
m_ulGrantMcs
630 for (uint16_t i = rbStart; i < rbStart + rbLen; i++)
658 std::map<uint16_t, uint8_t>::iterator itProcId;
664 harqId = (*itProcId).second;
665 std::map<uint16_t, UlHarqProcessesDciBuffer_t>::iterator itDci =
669 NS_FATAL_ERROR(
"Unable to find RNTI entry in UL DCI HARQ buffer for RNTI "
672 (*itDci).second.at(harqId) = uldci;
675 rbStart = rbStart + rbLen;
685 if (!
params.m_dlInfoList.empty())
689 params.m_dlInfoList.begin(),
690 params.m_dlInfoList.end());
695 if (!
params.m_dlInfoList.empty())
705 std::vector<struct DlInfoListElement_s> dlInfoListUntxed;
709 if (itRnti != rntiAllocated.end())
715 std::vector<bool> retx;
716 NS_LOG_INFO(
this <<
" Processing DLHARQ feedback");
721 retx.push_back(
false);
730 if (retx.at(0) || retx.at(1))
735 NS_LOG_INFO(
this <<
" HARQ retx RNTI " << rnti <<
" harqId " << (uint16_t)harqId);
736 std::map<uint16_t, DlHarqProcessesDciBuffer_t>::iterator itHarq =
745 if (dci.
m_rv.size() == 1)
757 NS_LOG_INFO(
"Maximum number of retransmissions reached -> drop process");
758 std::map<uint16_t, DlHarqProcessesStatus_t>::iterator it =
762 NS_LOG_ERROR(
"No info find in HARQ buffer for UE (might change eNB) "
765 (*it).second.at(harqId) = 0;
766 std::map<uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu =
770 NS_FATAL_ERROR(
"Unable to find RlcPdcList in HARQ buffer for RNTI "
773 for (std::size_t
k = 0;
k < (*itRlcPdu).second.size();
k++)
775 (*itRlcPdu).second.at(
k).at(harqId).clear();
781 std::vector<int> dciRbg;
784 for (
int j = 0; j < 32; j++)
794 for (std::size_t j = 0; j < dciRbg.size(); j++)
796 if (rbgMap.at(dciRbg.at(j)) ==
true)
806 for (std::size_t j = 0; j < dciRbg.size(); j++)
808 rbgMap.at(dciRbg.at(j)) =
true;
809 NS_LOG_INFO(
"RBG " << dciRbg.at(j) <<
" assigned");
813 NS_LOG_INFO(
this <<
" Send retx in the same RBGs");
819 uint8_t rbgId = (dciRbg.at(dciRbg.size() - 1) + 1) % rbgNum;
820 uint8_t startRbg = dciRbg.at(dciRbg.size() - 1);
821 std::vector<bool> rbgMapCopy = rbgMap;
822 while ((j < dciRbg.size()) && (startRbg != rbgId))
824 if (rbgMapCopy.at(rbgId) ==
false)
826 rbgMapCopy.at(rbgId) =
true;
827 dciRbg.at(j) = rbgId;
830 rbgId = (rbgId + 1) % rbgNum;
832 if (j == dciRbg.size())
835 uint32_t rbgMask = 0;
836 for (std::size_t
k = 0;
k < dciRbg.size();
k++)
838 rbgMask = rbgMask + (0x1 << dciRbg.at(
k));
843 NS_LOG_INFO(
this <<
" Move retx in RBGs " << dciRbg.size());
849 NS_LOG_INFO(
this <<
" No resource for this retx -> buffer it");
854 std::map<uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu =
858 NS_FATAL_ERROR(
"Unable to find RlcPdcList in HARQ buffer for RNTI " << rnti);
860 for (std::size_t j = 0; j < nLayers; j++)
864 if (j >= dci.
m_ndi.size())
867 dci.
m_ndi.push_back(0);
868 dci.
m_rv.push_back(0);
869 dci.
m_mcs.push_back(0);
872 <<
" no txed (MIMO transition)");
878 (*itHarq).second.at(harqId).m_rv.at(j)++;
879 NS_LOG_INFO(
this <<
" layer " << (uint16_t)j <<
" RV "
880 << (uint16_t)dci.
m_rv.at(j));
890 NS_LOG_INFO(
this <<
" layer " << (uint16_t)j <<
" no retx");
893 for (std::size_t
k = 0;
k < (*itRlcPdu).second.at(0).at(dci.
m_harqProcess).size();
k++)
895 std::vector<struct RlcPduListElement_s> rlcPduListPerLc;
896 for (std::size_t j = 0; j < nLayers; j++)
900 if (j < dci.
m_ndi.size())
902 NS_LOG_INFO(
" layer " << (uint16_t)j <<
" tb size "
904 rlcPduListPerLc.push_back(
917 .m_logicalChannelIdentity;
919 rlcPduListPerLc.push_back(emptyElement);
923 if (!rlcPduListPerLc.empty())
930 (*itHarq).second.at(harqId).
m_rv = dci.
m_rv;
932 std::map<uint16_t, DlHarqProcessesTimer_t>::iterator itHarqTimer =
936 NS_FATAL_ERROR(
"Unable to find HARQ timer for RNTI " << (uint16_t)rnti);
938 (*itHarqTimer).second.at(harqId) = 0;
940 rntiAllocated.insert(rnti);
946 std::map<uint16_t, DlHarqProcessesStatus_t>::iterator it =
954 std::map<uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu =
958 NS_FATAL_ERROR(
"Unable to find RlcPdcList in HARQ buffer for RNTI "
961 for (std::size_t
k = 0;
k < (*itRlcPdu).second.size();
k++)
970 if (rbgAllocatedNum == rbgNum)
980 std::map<uint16_t, pssFlowPerf_t>::iterator it;
981 std::map<uint16_t, pssFlowPerf_t> tdUeSet;
984 std::map<uint16_t, pssFlowPerf_t> ueSet;
989 ueSet.insert(std::pair<uint16_t, pssFlowPerf_t>((*it).first, (*it).second));
997 std::vector<std::pair<double, uint16_t>> ueSet1;
998 std::vector<std::pair<double, uint16_t>> ueSet2;
999 for (it = ueSet.begin(); it != ueSet.end(); it++)
1001 std::set<uint16_t>::iterator itRnti = rntiAllocated.find((*it).first);
1005 if (itRnti != rntiAllocated.end())
1007 NS_LOG_DEBUG(
this <<
" RNTI discarded for HARQ tx" << (uint16_t)(*it).first);
1011 NS_LOG_DEBUG(
this <<
" RNTI discarded for HARQ id" << (uint16_t)(*it).first);
1016 double metric = 0.0;
1017 if ((*it).second.lastAveragedThroughput < (*it).second.targetThroughput)
1020 metric = 1 / (*it).second.lastAveragedThroughput;
1023 std::map<uint16_t, uint8_t>::iterator itCqi;
1025 std::map<uint16_t, uint8_t>::iterator itTxMode;
1029 NS_FATAL_ERROR(
"No Transmission Mode info on user " << (*it).first);
1034 for (uint8_t j = 0; j < nLayer; j++)
1042 cqiSum = (*itCqi).second;
1047 ueSet1.emplace_back(metric, (*it).first);
1053 std::map<uint16_t, uint8_t>::iterator itCqi;
1055 std::map<uint16_t, uint8_t>::iterator itTxMode;
1059 NS_FATAL_ERROR(
"No Transmission Mode info on user " << (*it).first);
1069 wbCqi = (*itCqi).second;
1077 double achievableRate = 0.0;
1078 for (uint8_t
k = 0;
k < nLayer;
k++)
1081 mcs =
m_amc->GetMcsFromCqi(wbCqi);
1082 achievableRate += ((
m_amc->GetDlTbSizeFromMcs(mcs, rbgSize) / 8) /
1086 metric = achievableRate / (*it).second.lastAveragedThroughput;
1088 ueSet2.emplace_back(metric, (*it).first);
1093 if (!ueSet1.empty() || !ueSet2.empty())
1096 std::sort(ueSet1.rbegin(), ueSet1.rend());
1097 std::sort(ueSet2.rbegin(), ueSet2.rend());
1108 if (ueSet1.size() + ueSet2.size() <= 2)
1115 nMux = (
int)((ueSet1.size() + ueSet2.size()) / 2);
1120 std::vector<std::pair<double, uint16_t>>::iterator itSet;
1121 for (itSet = ueSet1.begin(); itSet != ueSet1.end() && nMux != 0; itSet++)
1123 std::map<uint16_t, pssFlowPerf_t>::iterator itUe;
1126 std::pair<uint16_t, pssFlowPerf_t>((*itUe).first, (*itUe).second));
1135 for (itSet = ueSet2.begin(); itSet != ueSet2.end() && nMux != 0; itSet++)
1137 std::map<uint16_t, pssFlowPerf_t>::iterator itUe;
1140 std::pair<uint16_t, pssFlowPerf_t>((*itUe).first, (*itUe).second));
1154 std::map<uint16_t, uint8_t> sbCqiSum;
1155 for (it = tdUeSet.begin(); it != tdUeSet.end(); it++)
1158 for (
int i = 0; i < rbgNum; i++)
1160 std::map<uint16_t, SbMeasResult_s>::iterator itCqi;
1162 std::map<uint16_t, uint8_t>::iterator itTxMode;
1166 NS_FATAL_ERROR(
"No Transmission Mode info on user " << (*it).first);
1169 std::vector<uint8_t> sbCqis;
1172 for (uint8_t
k = 0;
k < nLayer;
k++)
1174 sbCqis.push_back(1);
1179 sbCqis = (*itCqi).second.m_higherLayerSelected.at(i).m_sbCqi;
1182 uint8_t cqi1 = sbCqis.at(0);
1184 if (sbCqis.size() > 1)
1186 cqi2 = sbCqis.at(1);
1194 for (uint8_t
k = 0;
k < nLayer;
k++)
1196 if (sbCqis.size() >
k)
1198 sbCqi = sbCqis.at(
k);
1210 sbCqiSum.insert(std::pair<uint16_t, uint8_t>((*it).first, sum));
1213 for (
int i = 0; i < rbgNum; i++)
1215 if (rbgMap.at(i) ==
true)
1220 std::map<uint16_t, pssFlowPerf_t>::iterator itMax = tdUeSet.end();
1221 double metricMax = 0.0;
1222 for (it = tdUeSet.begin(); it != tdUeSet.end(); it++)
1231 (*it).second.targetThroughput / (*it).second.lastAveragedThroughput;
1237 std::map<uint16_t, uint8_t>::iterator itSbCqiSum;
1238 itSbCqiSum = sbCqiSum.find((*it).first);
1240 std::map<uint16_t, SbMeasResult_s>::iterator itCqi;
1242 std::map<uint16_t, uint8_t>::iterator itTxMode;
1246 NS_FATAL_ERROR(
"No Transmission Mode info on user " << (*it).first);
1249 std::vector<uint8_t> sbCqis;
1252 for (uint8_t
k = 0;
k < nLayer;
k++)
1254 sbCqis.push_back(1);
1259 sbCqis = (*itCqi).second.m_higherLayerSelected.at(i).m_sbCqi;
1262 uint8_t cqi1 = sbCqis.at(0);
1264 if (sbCqis.size() > 1)
1266 cqi2 = sbCqis.at(1);
1270 double colMetric = 0.0;
1275 for (uint8_t
k = 0;
k < nLayer;
k++)
1277 if (sbCqis.size() >
k)
1279 sbCqi = sbCqis.at(
k);
1286 colMetric += (double)sbCqi / (
double)(*itSbCqiSum).second;
1290 double metric = 0.0;
1293 metric = weight * colMetric;
1300 if (metric > metricMax)
1307 if (itMax == tdUeSet.end())
1313 allocationMap[(*itMax).first].push_back(i);
1314 rbgMap.at(i) =
true;
1323 for (
int i = 0; i < rbgNum; i++)
1325 if (rbgMap.at(i) ==
true)
1330 std::map<uint16_t, pssFlowPerf_t>::iterator itMax = tdUeSet.end();
1331 double metricMax = 0.0;
1332 for (it = tdUeSet.begin(); it != tdUeSet.end(); it++)
1340 (*it).second.targetThroughput / (*it).second.lastAveragedThroughput;
1346 std::map<uint16_t, SbMeasResult_s>::iterator itCqi;
1348 std::map<uint16_t, uint8_t>::iterator itTxMode;
1352 NS_FATAL_ERROR(
"No Transmission Mode info on user " << (*it).first);
1355 std::vector<uint8_t> sbCqis;
1358 for (uint8_t
k = 0;
k < nLayer;
k++)
1360 sbCqis.push_back(1);
1365 sbCqis = (*itCqi).second.m_higherLayerSelected.at(i).m_sbCqi;
1368 uint8_t cqi1 = sbCqis.at(0);
1370 if (sbCqis.size() > 1)
1372 cqi2 = sbCqis.at(1);
1375 double schMetric = 0.0;
1380 double achievableRate = 0.0;
1381 for (uint8_t
k = 0;
k < nLayer;
k++)
1384 if (sbCqis.size() >
k)
1386 mcs =
m_amc->GetMcsFromCqi(sbCqis.at(
k));
1393 achievableRate += ((
m_amc->GetDlTbSizeFromMcs(mcs, rbgSize) / 8) /
1396 schMetric = achievableRate / (*it).second.secondLastAveragedThroughput;
1399 double metric = 0.0;
1400 metric = weight * schMetric;
1402 if (metric > metricMax)
1409 if (itMax == tdUeSet.end())
1415 allocationMap[(*itMax).first].push_back(i);
1416 rbgMap.at(i) =
true;
1428 std::map<uint16_t, pssFlowPerf_t>::iterator itStats;
1431 (*itStats).second.lastTtiBytesTransmitted = 0;
1436 std::map<uint16_t, std::vector<uint16_t>>::iterator itMap = allocationMap.begin();
1437 while (itMap != allocationMap.end())
1441 newEl.
m_rnti = (*itMap).first;
1444 newDci.
m_rnti = (*itMap).first;
1452 lcActives = (uint16_t)65535;
1454 uint16_t RgbPerRnti = (*itMap).second.size();
1455 std::map<uint16_t, SbMeasResult_s>::iterator itCqi;
1457 std::map<uint16_t, uint8_t>::iterator itTxMode;
1461 NS_FATAL_ERROR(
"No Transmission Mode info on user " << (*itMap).first);
1464 std::vector<uint8_t> worstCqi(2, 15);
1467 for (std::size_t
k = 0;
k < (*itMap).second.size();
k++)
1469 if ((*itCqi).second.m_higherLayerSelected.size() > (*itMap).second.at(
k))
1471 NS_LOG_INFO(
this <<
" RBG " << (*itMap).second.at(
k) <<
" CQI "
1472 << (uint16_t)((*itCqi)
1473 .second.m_higherLayerSelected
1474 .at((*itMap).second.at(
k))
1476 for (uint8_t j = 0; j < nLayer; j++)
1479 .
second.m_higherLayerSelected.at((*itMap).second.at(
k))
1480 .m_sbCqi.size() > j)
1483 .
second.m_higherLayerSelected.at((*itMap).second.at(
k))
1484 .m_sbCqi.at(j)) < worstCqi.at(j))
1488 .second.m_higherLayerSelected.at((*itMap).second.at(
k))
1501 for (uint8_t j = 0; j < nLayer; j++)
1510 for (uint8_t j = 0; j < nLayer; j++)
1515 for (uint8_t j = 0; j < nLayer; j++)
1517 NS_LOG_INFO(
this <<
" Layer " << (uint16_t)j <<
" CQI selected "
1518 << (uint16_t)worstCqi.at(j));
1520 uint32_t bytesTxed = 0;
1521 for (uint8_t j = 0; j < nLayer; j++)
1523 newDci.
m_mcs.push_back(
m_amc->GetMcsFromCqi(worstCqi.at(j)));
1524 int tbSize = (
m_amc->GetDlTbSizeFromMcs(newDci.
m_mcs.at(j), RgbPerRnti * rbgSize) /
1527 NS_LOG_INFO(
this <<
" Layer " << (uint16_t)j <<
" MCS selected"
1528 <<
m_amc->GetMcsFromCqi(worstCqi.at(j)));
1529 bytesTxed += tbSize;
1534 uint32_t rbgMask = 0;
1535 for (std::size_t
k = 0;
k < (*itMap).second.size();
k++)
1537 rbgMask = rbgMask + (0x1 << (*itMap).second.at(
k));
1538 NS_LOG_INFO(
this <<
" Allocated RBG " << (*itMap).second.at(
k));
1543 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator
1547 if (((*itBufReq).first.m_rnti == (*itMap).first) &&
1548 (((*itBufReq).second.m_rlcTransmissionQueueSize > 0) ||
1549 ((*itBufReq).second.m_rlcRetransmissionQueueSize > 0) ||
1550 ((*itBufReq).second.m_rlcStatusPduSize > 0)))
1552 std::vector<struct RlcPduListElement_s> newRlcPduLe;
1553 for (uint8_t j = 0; j < nLayer; j++)
1559 <<
" size " << newRlcEl.
m_size <<
" layer " << (uint16_t)j);
1560 newRlcPduLe.push_back(newRlcEl);
1567 std::map<uint16_t, DlHarqRlcPduListBuffer_t>::iterator itRlcPdu =
1571 NS_FATAL_ERROR(
"Unable to find RlcPdcList in HARQ buffer for RNTI "
1574 (*itRlcPdu).second.at(j).at(newDci.
m_harqProcess).push_back(newRlcEl);
1579 if ((*itBufReq).first.m_rnti > (*itMap).first)
1584 for (uint8_t j = 0; j < nLayer; j++)
1586 newDci.
m_ndi.push_back(1);
1587 newDci.
m_rv.push_back(0);
1592 newEl.
m_dci = newDci;
1597 std::map<uint16_t, DlHarqProcessesDciBuffer_t>::iterator itDci =
1601 NS_FATAL_ERROR(
"Unable to find RNTI entry in DCI HARQ buffer for RNTI "
1606 std::map<uint16_t, DlHarqProcessesTimer_t>::iterator itHarqTimer =
1619 std::map<uint16_t, pssFlowPerf_t>::iterator it;
1623 (*it).second.lastTtiBytesTransmitted = bytesTxed;
1624 NS_LOG_INFO(
this <<
" UE total bytes txed " << (*it).second.lastTtiBytesTransmitted);
1639 std::map<uint16_t, pssFlowPerf_t>::iterator itUeScheduleted = tdUeSet.end();
1640 itUeScheduleted = tdUeSet.find((*itStats).first);
1641 if (itUeScheduleted != tdUeSet.end())
1643 (*itStats).second.secondLastAveragedThroughput =
1644 ((1.0 - (1 /
m_timeWindow)) * (*itStats).second.secondLastAveragedThroughput) +
1645 ((1 /
m_timeWindow) * (double)((*itStats).second.lastTtiBytesTransmitted / 0.001));
1648 (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTransmitted;
1651 (*itStats).second.lastAveragedThroughput =
1652 ((1.0 - (1.0 /
m_timeWindow)) * (*itStats).second.lastAveragedThroughput) +
1653 ((1.0 /
m_timeWindow) * (double)((*itStats).second.lastTtiBytesTransmitted / 0.001));
1654 (*itStats).second.lastTtiBytesTransmitted = 0;
1676 for (
unsigned int i = 0; i <
params.m_cqiList.size(); i++)
1682 std::map<uint16_t, uint8_t>::iterator it;
1683 uint16_t rnti =
params.m_cqiList.at(i).m_rnti;
1690 params.m_cqiList.at(i).m_wbCqi.at(0)));
1697 (*it).second =
params.m_cqiList.at(i).m_wbCqi.at(0);
1699 std::map<uint16_t, uint32_t>::iterator itTimers;
1707 std::map<uint16_t, SbMeasResult_s>::iterator it;
1708 uint16_t rnti =
params.m_cqiList.at(i).m_rnti;
1714 std::pair<uint16_t, SbMeasResult_s>(rnti,
1715 params.m_cqiList.at(i).m_sbMeasResult));
1721 (*it).second =
params.m_cqiList.at(i).m_sbMeasResult;
1722 std::map<uint16_t, uint32_t>::iterator itTimers;
1737 std::map<uint16_t, std::vector<double>>::iterator itCqi =
m_ueCqi.find(rnti);
1747 unsigned int sinrNum = 0;
1750 double sinr = (*itCqi).second.at(i);
1757 double estimatedSinr = (sinrNum > 0) ? (sinrSum / sinrNum) : DBL_MAX;
1759 (*itCqi).second.at(rb) = estimatedSinr;
1760 return (estimatedSinr);
1769 << (0xF &
params.m_sfnSf) <<
" size " <<
params.m_ulInfoList.size());
1776 std::vector<bool> rbMap;
1777 uint16_t rbAllocatedNum = 0;
1778 std::set<uint16_t> rntiAllocated;
1779 std::vector<uint16_t> rbgAllocationMap;
1790 for (std::vector<bool>::iterator it = rbMap.begin(); it != rbMap.end(); it++)
1804 if (rbgAllocationMap.at(i) != 0)
1814 for (std::size_t i = 0; i <
params.m_ulInfoList.size(); i++)
1819 uint16_t rnti =
params.m_ulInfoList.at(i).m_rnti;
1820 std::map<uint16_t, uint8_t>::iterator itProcId =
1824 NS_LOG_ERROR(
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1827 NS_LOG_INFO(
this <<
" UL-HARQ retx RNTI " << rnti <<
" harqId " << (uint16_t)harqId
1828 <<
" i " << i <<
" size " <<
params.m_ulInfoList.size());
1829 std::map<uint16_t, UlHarqProcessesDciBuffer_t>::iterator itHarq =
1833 NS_LOG_ERROR(
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1837 std::map<uint16_t, UlHarqProcessesStatus_t>::iterator itStat =
1841 NS_LOG_ERROR(
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1843 if ((*itStat).second.at(harqId) >= 3)
1845 NS_LOG_INFO(
"Max number of retransmissions reached (UL)-> drop process");
1851 if (rbMap.at(j) ==
true)
1863 rbgAllocationMap.at(j) = dci.
m_rnti;
1869 << (*itStat).second.at(harqId) + 1);
1873 NS_LOG_INFO(
"Cannot allocate retx due to RACH allocations for UE " << rnti);
1878 (*itStat).second.at((*itProcId).second) = (*itStat).second.at(harqId) + 1;
1879 (*itStat).second.at(harqId) = 0;
1880 (*itHarq).second.at((*itProcId).second) = dci;
1882 rntiAllocated.insert(dci.
m_rnti);
1886 NS_LOG_INFO(
this <<
" HARQ-ACK feedback from RNTI "
1887 <<
params.m_ulInfoList.at(i).m_rnti);
1892 std::map<uint16_t, uint32_t>::iterator it;
1897 std::set<uint16_t>::iterator itRnti = rntiAllocated.find((*it).first);
1899 if (((*it).second > 0) && (itRnti == rntiAllocated.end()))
1910 std::pair<uint16_t, std::vector<uint16_t>>(
params.m_sfnSf, rbgAllocationMap));
1919 uint16_t tempRbPerFlow = (ffrUlBandwidth) / (nflows + rntiAllocated.size());
1920 uint16_t rbPerFlow =
1921 (minContinuousUlBandwidth < tempRbPerFlow) ? minContinuousUlBandwidth : tempRbPerFlow;
1928 int rbAllocated = 0;
1930 std::map<uint16_t, pssFlowPerf_t>::iterator itStats;
1952 std::set<uint16_t>::iterator itRnti = rntiAllocated.find((*it).first);
1953 if ((itRnti != rntiAllocated.end()) || ((*it).second == 0))
1956 NS_LOG_DEBUG(
this <<
" UE already allocated in HARQ -> discarded, RNTI "
1980 uldci.
m_rnti = (*it).first;
1982 bool allocated =
false;
1983 NS_LOG_INFO(
this <<
" RB Allocated " << rbAllocated <<
" rbPerFlow " << rbPerFlow
1984 <<
" flows " << nflows);
1990 for (
int j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
1992 if (rbMap.at(j) ==
true)
2005 NS_LOG_INFO(
this <<
"RNTI: " << (*it).first <<
" RB Allocated " << rbAllocated
2006 <<
" rbPerFlow " << rbPerFlow <<
" flows " << nflows);
2009 for (
int j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
2013 rbgAllocationMap.at(j) = (*it).first;
2015 rbAllocated += rbPerFlow;
2045 std::map<uint16_t, std::vector<double>>::iterator itCqi =
m_ueCqi.find((*it).first);
2056 "CQI of RNTI = " << (*it).first <<
" has expired");
2057 double minSinr = (*itCqi).second.at(uldci.
m_rbStart);
2064 double sinr = (*itCqi).second.at(i);
2076 double s = log2(1 + (std::pow(10, minSinr / 10) / ((-std::log(5.0 * 0.00005)) / 1.5)));
2077 cqi =
m_amc->GetCqiFromSpectralEfficiency(s);
2090 rbgAllocationMap.at(i) = 0;
2116 std::map<uint16_t, uint8_t>::iterator itProcId;
2122 harqId = (*itProcId).second;
2123 std::map<uint16_t, UlHarqProcessesDciBuffer_t>::iterator itDci =
2127 NS_FATAL_ERROR(
"Unable to find RNTI entry in UL DCI HARQ buffer for RNTI "
2130 (*itDci).second.at(harqId) = uldci;
2132 std::map<uint16_t, UlHarqProcessesStatus_t>::iterator itStat =
2136 NS_LOG_ERROR(
"No info find in HARQ buffer for UE (might change eNB) "
2139 (*itStat).second.at(harqId) = 0;
2142 NS_LOG_INFO(
this <<
" UE Allocation RNTI " << (*it).first <<
" startPRB "
2144 <<
" CQI " << cqi <<
" MCS " << (uint32_t)uldci.
m_mcs <<
" TBsize "
2145 << uldci.
m_tbSize <<
" RbAlloc " << rbAllocated <<
" harqId "
2146 << (uint16_t)harqId);
2160 }
while (((*it).first !=
m_nextRntiUl) && (rbPerFlow != 0));
2163 std::pair<uint16_t, std::vector<uint16_t>>(
params.m_sfnSf, rbgAllocationMap));
2187 std::map<uint16_t, uint32_t>::iterator it;
2189 for (
unsigned int i = 0; i <
params.m_macCeList.size(); i++)
2200 uint32_t buffer = 0;
2201 for (uint8_t lcg = 0; lcg < 4; ++lcg)
2203 uint8_t bsrId =
params.m_macCeList.at(i).m_macCeValue.m_bufferStatus.at(lcg);
2207 uint16_t rnti =
params.m_macCeList.at(i).m_rnti;
2208 NS_LOG_LOGIC(
this <<
"RNTI=" << rnti <<
" buffer=" << buffer);
2213 m_ceBsrRxed.insert(std::pair<uint16_t, uint32_t>(rnti, buffer));
2218 (*it).second = buffer;
2252 switch (
params.m_ulCqi.m_type)
2255 std::map<uint16_t, std::vector<uint16_t>>::iterator itMap;
2256 std::map<uint16_t, std::vector<double>>::iterator itCqi;
2258 <<
" subframe no. " << (0xF &
params.m_sfnSf));
2264 for (uint32_t i = 0; i < (*itMap).second.size(); i++)
2268 itCqi =
m_ueCqi.find((*itMap).second.at(i));
2272 std::vector<double> newCqi;
2277 newCqi.push_back(sinr);
2286 std::pair<uint16_t, std::vector<double>>((*itMap).second.at(i), newCqi));
2294 (*itCqi).second.at(i) = sinr;
2295 NS_LOG_DEBUG(
this <<
" RNTI " << (*itMap).second.at(i) <<
" RB " << i <<
" SINR "
2298 std::map<uint16_t, uint32_t>::iterator itTimers;
2311 for (std::size_t i = 0; i <
params.m_vendorSpecificList.size(); i++)
2316 DynamicCast<SrsCqiRntiVsp>(
params.m_vendorSpecificList.at(i).m_value);
2317 rnti = vsp->GetRnti();
2320 std::map<uint16_t, std::vector<double>>::iterator itCqi;
2325 std::vector<double> newCqi;
2329 newCqi.push_back(sinr);
2330 NS_LOG_INFO(
this <<
" RNTI " << rnti <<
" new SRS-CQI for RB " << j <<
" value "
2333 m_ueCqi.insert(std::pair<uint16_t, std::vector<double>>(rnti, newCqi));
2343 (*itCqi).second.at(j) = sinr;
2344 NS_LOG_INFO(
this <<
" RNTI " << rnti <<
" update SRS-CQI for RB " << j <<
" value "
2348 std::map<uint16_t, uint32_t>::iterator itTimers;
2357 NS_FATAL_ERROR(
"PssFfMacScheduler supports only PUSCH and SRS UL-CQIs");
2369 std::map<uint16_t, uint32_t>::iterator itP10 =
m_p10CqiTimers.begin();
2372 NS_LOG_INFO(
this <<
" P10-CQI for user " << (*itP10).first <<
" is "
2374 if ((*itP10).second == 0)
2377 std::map<uint16_t, uint8_t>::iterator itMap =
m_p10CqiRxed.find((*itP10).first);
2379 " Does not find CQI report for user " << (*itP10).first);
2380 NS_LOG_INFO(
this <<
" P10-CQI expired for user " << (*itP10).first);
2382 std::map<uint16_t, uint32_t>::iterator temp = itP10;
2394 std::map<uint16_t, uint32_t>::iterator itA30 =
m_a30CqiTimers.begin();
2397 NS_LOG_INFO(
this <<
" A30-CQI for user " << (*itA30).first <<
" is "
2399 if ((*itA30).second == 0)
2402 std::map<uint16_t, SbMeasResult_s>::iterator itMap =
m_a30CqiRxed.find((*itA30).first);
2404 " Does not find CQI report for user " << (*itA30).first);
2405 NS_LOG_INFO(
this <<
" A30-CQI expired for user " << (*itA30).first);
2407 std::map<uint16_t, uint32_t>::iterator temp = itA30;
2423 std::map<uint16_t, uint32_t>::iterator itUl =
m_ueCqiTimers.begin();
2426 NS_LOG_INFO(
this <<
" UL-CQI for user " << (*itUl).first <<
" is "
2428 if ((*itUl).second == 0)
2431 std::map<uint16_t, std::vector<double>>::iterator itMap =
m_ueCqi.find((*itUl).first);
2433 " Does not find CQI report for user " << (*itUl).first);
2434 NS_LOG_INFO(
this <<
" UL-CQI exired for user " << (*itUl).first);
2435 (*itMap).second.clear();
2437 std::map<uint16_t, uint32_t>::iterator temp = itUl;
2452 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
2457 NS_LOG_INFO(
this <<
" UE " << rnti <<
" LC " << (uint16_t)lcid <<
" txqueue "
2458 << (*it).second.m_rlcTransmissionQueueSize <<
" retxqueue "
2459 << (*it).second.m_rlcRetransmissionQueueSize <<
" status "
2460 << (*it).second.m_rlcStatusPduSize <<
" decrease " << size);
2463 if (((*it).second.m_rlcStatusPduSize > 0) && (size >= (*it).second.m_rlcStatusPduSize))
2465 (*it).second.m_rlcStatusPduSize = 0;
2467 else if (((*it).second.m_rlcRetransmissionQueueSize > 0) &&
2468 (size >= (*it).second.m_rlcRetransmissionQueueSize))
2470 (*it).second.m_rlcRetransmissionQueueSize = 0;
2472 else if ((*it).second.m_rlcTransmissionQueueSize > 0)
2474 uint32_t rlcOverhead;
2489 if ((*it).second.m_rlcTransmissionQueueSize <= size - rlcOverhead)
2491 (*it).second.m_rlcTransmissionQueueSize = 0;
2495 (*it).second.m_rlcTransmissionQueueSize -= size - rlcOverhead;
2501 NS_LOG_ERROR(
this <<
" Does not find DL RLC Buffer Report of UE " << rnti);
2509 std::map<uint16_t, uint32_t>::iterator it =
m_ceBsrRxed.find(rnti);
2512 NS_LOG_INFO(
this <<
" UE " << rnti <<
" size " << size <<
" BSR " << (*it).second);
2513 if ((*it).second >= size)
2515 (*it).second -= size;
2524 NS_LOG_ERROR(
this <<
" Does not find BSR report info of UE " << rnti);
2531 NS_LOG_FUNCTION(
this <<
" RNTI " << rnti <<
" txMode " << (uint16_t)txMode);
2534 params.m_transmissionMode = txMode;
AttributeValue implementation for Boolean.
static uint32_t BsrId2BufferSize(uint8_t val)
Convert BSR ID to buffer size.
FfMacCschedSapUser class.
virtual void CschedUeConfigUpdateInd(const struct CschedUeConfigUpdateIndParameters ¶ms)=0
CSCHED_UE_UPDATE_IND.
virtual void CschedUeConfigCnf(const struct CschedUeConfigCnfParameters ¶ms)=0
CSCHED_UE_CONFIG_CNF.
virtual void SchedUlConfigInd(const struct SchedUlConfigIndParameters ¶ms)=0
SCHED_UL_CONFIG_IND.
virtual void SchedDlConfigInd(const struct SchedDlConfigIndParameters ¶ms)=0
SCHED_DL_CONFIG_IND.
This abstract base class identifies the interface by means of which the helper object can plug on the...
UlCqiFilter_t m_ulCqiFilter
UL CQI filter.
static double fpS11dot3toDouble(uint16_t val)
Convert from fixed point S11.3 notation to double.
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the MAC Scheduler ins...
virtual uint8_t GetTpc(uint16_t rnti)=0
GetTpc.
virtual void ReportUlCqiInfo(const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ¶ms)=0
ReportUlCqiInfo.
virtual bool IsUlRbgAvailableForUe(int i, uint16_t rnti)=0
Check if UE can be served on i-th RB in UL.
virtual uint16_t GetMinContinuousUlBandwidth()=0
Get the minimum continuous Ul bandwidth.
virtual bool IsDlRbgAvailableForUe(int i, uint16_t rnti)=0
Check if UE can be served on i-th RB in DL.
virtual void ReportDlCqiInfo(const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters ¶ms)=0
ReportDlCqiInfo.
virtual std::vector< bool > GetAvailableUlRbg()=0
Get vector of available RB in UL for this Cell.
virtual std::vector< bool > GetAvailableDlRbg()=0
Get vector of available RBG in DL for this Cell.
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
Template for the implementation of the LteFfrSapUser as a member of an owner class of type C to which...
Implements the SCHED SAP and CSCHED SAP for a Priority Set scheduler.
std::map< uint16_t, DlHarqProcessesStatus_t > m_dlHarqProcessesStatus
DL HARQ process status.
void DoDispose() override
Destructor implementation.
void DoSchedUlCqiInfoReq(const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ¶ms)
Sched UL CQI info request function.
void DoCschedUeReleaseReq(const struct FfMacCschedSapProvider::CschedUeReleaseReqParameters ¶ms)
CSched UE release request function.
double EstimateUlSinr(uint16_t rnti, uint16_t rb)
Estimate UL SINR function.
std::map< uint16_t, uint32_t > m_p10CqiTimers
Map of UE's timers on DL CQI P01 received.
bool HarqProcessAvailability(uint16_t rnti)
Return the availability of free process for the RNTI specified.
std::map< uint16_t, UlHarqProcessesDciBuffer_t > m_ulHarqProcessesDciBuffer
UL HARQ process DCI buffer.
std::map< uint16_t, uint32_t > m_ceBsrRxed
Map of UE's buffer status reports received.
LteFfrSapUser * GetLteFfrSapUser() override
FfMacSchedSapProvider * GetFfMacSchedSapProvider() override
FfMacCschedSapProvider * m_cschedSapProvider
CSched SAP provider.
std::map< uint16_t, SbMeasResult_s > m_a30CqiRxed
Map of UE's DL CQI A30 received.
friend class MemberSchedSapProvider< PssFfMacScheduler >
allow MemberSchedSapProvider<PssFfMacScheduler> class friend access
void DoSchedDlMacBufferReq(const struct FfMacSchedSapProvider::SchedDlMacBufferReqParameters ¶ms)
Sched DL MAC buffer request function.
std::map< uint16_t, uint8_t > m_p10CqiRxed
Map of UE's DL CQI P01 received.
unsigned int LcActivePerFlow(uint16_t rnti)
Get LC active flow function.
void DoCschedUeConfigReq(const struct FfMacCschedSapProvider::CschedUeConfigReqParameters ¶ms)
CSched UE config request function.
std::vector< uint16_t > m_rachAllocationMap
RACH allocation map.
void DoSchedUlMacCtrlInfoReq(const struct FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters ¶ms)
Sched UL MAC control info request function.
static TypeId GetTypeId()
Get the type ID.
uint8_t m_ulGrantMcs
MCS for UL grant (default 0)
uint32_t m_cqiTimersThreshold
void DoSchedUlSrInfoReq(const struct FfMacSchedSapProvider::SchedUlSrInfoReqParameters ¶ms)
Sched UL SR info request function.
void RefreshDlCqiMaps()
Refresh DL CQI maps function.
std::map< LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters > m_rlcBufferReq
Vectors of UE's LC info.
std::map< uint16_t, std::vector< uint16_t > > m_allocationMaps
Map of previous allocated UE per RBG (used to retrieve info from UL-CQI)
uint8_t UpdateHarqProcessId(uint16_t rnti)
Update and return a new process Id for the RNTI specified.
void DoCschedLcReleaseReq(const struct FfMacCschedSapProvider::CschedLcReleaseReqParameters ¶ms)
CSched LC release request function.
uint32_t m_nMux
TD scheduler selects nMux UEs and transfer them to FD scheduler.
std::vector< DlInfoListElement_s > m_dlInfoListBuffered
HARQ retx buffered.
void SetFfMacCschedSapUser(FfMacCschedSapUser *s) override
set the user part of the FfMacCschedSap that this Scheduler will interact with.
FfMacCschedSapProvider::CschedCellConfigReqParameters m_cschedCellConfig
CSched cell config.
bool m_harqOn
m_harqOn when false inhibit the HARQ mechanisms (by default active)
~PssFfMacScheduler() override
Destructor.
void DoSchedDlTriggerReq(const struct FfMacSchedSapProvider::SchedDlTriggerReqParameters ¶ms)
Sched DL trigger request function.
std::vector< struct RachListElement_s > m_rachList
RACH list.
void DoSchedDlRachInfoReq(const struct FfMacSchedSapProvider::SchedDlRachInfoReqParameters ¶ms)
Sched DL RACH info request function.
std::string m_fdSchedulerType
FD scheduler type.
void RefreshUlCqiMaps()
Refresh UL CQI maps function.
void DoSchedDlPagingBufferReq(const struct FfMacSchedSapProvider::SchedDlPagingBufferReqParameters ¶ms)
Sched DL paging buffer request function.
void UpdateUlRlcBufferInfo(uint16_t rnti, uint16_t size)
Update UL RLC buffer info function.
void UpdateDlRlcBufferInfo(uint16_t rnti, uint8_t lcid, uint16_t size)
Update DL RLC buffer info function.
std::map< uint16_t, std::vector< double > > m_ueCqi
Map of UEs' UL-CQI per RBG.
void TransmissionModeConfigurationUpdate(uint16_t rnti, uint8_t txMode)
Transmission mode configuration update function.
std::map< uint16_t, DlHarqProcessesTimer_t > m_dlHarqProcessesTimer
DL HARQ process timer.
void DoSchedUlTriggerReq(const struct FfMacSchedSapProvider::SchedUlTriggerReqParameters ¶ms)
Sched UL trigger request function.
uint16_t m_nextRntiUl
RNTI of the next user to be served next scheduling in UL.
void DoCschedCellConfigReq(const struct FfMacCschedSapProvider::CschedCellConfigReqParameters ¶ms)
CSched cell config request function.
int GetRbgSize(int dlbandwidth)
Get RBG size function.
LteFfrSapProvider * m_ffrSapProvider
FFR SAP provider.
LteFfrSapUser * m_ffrSapUser
FFR SAP user.
std::map< uint16_t, uint8_t > m_dlHarqCurrentProcessId
DL HARQ current proess ID.
void DoSchedDlRlcBufferReq(const struct FfMacSchedSapProvider::SchedDlRlcBufferReqParameters ¶ms)
Sched DL RLC buffer request function.
std::map< uint16_t, DlHarqProcessesDciBuffer_t > m_dlHarqProcessesDciBuffer
DL HARQ process DCI buffer.
std::map< uint16_t, uint8_t > m_ulHarqCurrentProcessId
UL HARQ process ID.
void RefreshHarqProcesses()
Refresh HARQ processes according to the timers.
std::map< uint16_t, UlHarqProcessesStatus_t > m_ulHarqProcessesStatus
UL HARQ process status.
FfMacSchedSapUser * m_schedSapUser
Sched SAP user.
FfMacCschedSapUser * m_cschedSapUser
CSched SAP user.
PssFfMacScheduler()
Constructor.
FfMacSchedSapProvider * m_schedSapProvider
Sched SAP provider.
friend class MemberCschedSapProvider< PssFfMacScheduler >
allow MemberCschedSapProvider<PssFfMacScheduler> class friend access
void DoSchedUlNoiseInterferenceReq(const struct FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters ¶ms)
Sched UL noise interference request function.
FfMacCschedSapProvider * GetFfMacCschedSapProvider() override
std::map< uint16_t, pssFlowPerf_t > m_flowStatsDl
Map of UE statistics (per RNTI basis) in downlink.
std::map< uint16_t, uint8_t > m_uesTxMode
txMode of the UEs
void DoSchedDlCqiInfoReq(const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters ¶ms)
Sched DL CQI info request function.
std::map< uint16_t, DlHarqRlcPduListBuffer_t > m_dlHarqProcessesRlcPduListBuffer
DL HARQ ELC PDU list buffer.
double m_timeWindow
time window
std::map< uint16_t, pssFlowPerf_t > m_flowStatsUl
Map of UE statistics (per RNTI basis)
std::map< uint16_t, uint32_t > m_a30CqiTimers
Map of UE's timers on DL CQI A30 received.
std::map< uint16_t, uint32_t > m_ueCqiTimers
Map of UEs' timers on UL-CQI per RBG.
void SetFfMacSchedSapUser(FfMacSchedSapUser *s) override
set the user part of the FfMacSchedSap that this Scheduler will interact with.
void DoCschedLcConfigReq(const struct FfMacCschedSapProvider::CschedLcConfigReqParameters ¶ms)
CSched LC config request function.
void SetLteFfrSapProvider(LteFfrSapProvider *s) override
Set the Provider part of the LteFfrSap that this Scheduler will interact with.
Smart pointer class similar to boost::intrusive_ptr.
static Time Now()
Return the current simulation virtual time.
Hold variables of type string.
static uint8_t TxMode2LayerNum(uint8_t txMode)
Transmit mode 2 layer number.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeChecker > MakeBooleanChecker()
Ptr< const AttributeChecker > MakeStringChecker()
Ptr< const AttributeAccessor > MakeStringAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::vector< UlDciListElement_s > UlHarqProcessesDciBuffer_t
UL HARQ process DCI buffer vector.
std::vector< uint8_t > DlHarqProcessesTimer_t
DL HARQ process timer vector typedef.
std::vector< uint8_t > DlHarqProcessesStatus_t
DL HARQ process status vector typedef.
std::vector< RlcPduList_t > DlHarqRlcPduListBuffer_t
vector of the 8 HARQ processes per UE
static const int PssType0AllocationRbg[4]
PSS type 0 allocation RBG.
std::vector< DlDciListElement_s > DlHarqProcessesDciBuffer_t
DL HARQ process DCI buffer vector typedef.
std::vector< uint8_t > UlHarqProcessesStatus_t
UL HARQ process status vector.
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.
See section 4.3.8 builDataListElement.
std::vector< std::vector< struct RlcPduListElement_s > > m_rlcPduList
RLC PDU list.
struct DlDciListElement_s m_dci
DCI.
See section 4.3.10 buildRARListElement.
See section 4.3.1 dlDciListElement.
std::vector< uint8_t > m_ndi
New data indicator.
uint8_t m_harqProcess
HARQ process.
uint32_t m_rbBitmap
RB bitmap.
std::vector< uint8_t > m_mcs
MCS.
uint8_t m_resAlloc
The type of resource allocation.
std::vector< uint16_t > m_tbsSize
The TBs size.
std::vector< uint8_t > m_rv
Redundancy version.
uint8_t m_tpc
Tx power control command.
Parameters of the API primitives.
uint16_t m_dlBandwidth
DL bandwidth.
uint16_t m_ulBandwidth
UL bandwidth.
Parameters of the CSCHED_LC_CONFIG_REQ primitive.
Parameters of the CSCHED_LC_RELEASE_REQ primitive.
Parameters of the CSCHED_UE_CONFIG_REQ primitive.
Parameters of the CSCHED_UE_RELEASE_REQ primitive.
Parameters of the CSCHED_UE_CONFIG_CNF primitive.
enum Result_e m_result
result
Parameters of the CSCHED_UE_CONFIG_UPDATE_IND primitive.
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
Parameters of the SCHED_DL_MAC_BUFFER_REQ primitive.
Parameters of the SCHED_DL_PAGING_BUFFER_REQ primitive.
Parameters of the SCHED_DL_RACH_INFO_REQ primitive.
Parameters of the API primitives.
Parameters of the SCHED_DL_TRIGGER_REQ primitive.
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
Parameters of the SCHED_UL_MAC_CTRL_INFO_REQ primitive.
Parameters of the SCHED_UL_NOISE_INTERFERENCE_REQ primitive.
Parameters of the SCHED_UL_SR_INFO_REQ primitive.
Parameters of the SCHED_UL_TRIGGER_REQ primitive.
Parameters of the API primitives.
uint8_t m_nrOfPdcchOfdmSymbols
number of PDCCH OFDM symbols
std::vector< struct BuildDataListElement_s > m_buildDataList
build data list
std::vector< struct BuildRarListElement_s > m_buildRarList
build rar list
Parameters of the SCHED_UL_CONFIG_IND primitive.
std::vector< struct UlDciListElement_s > m_dciList
DCI list.
See section 4.3.9 rlcPDU_ListElement.
uint8_t m_logicalChannelIdentity
logical channel identity
See section 4.3.2 ulDciListElement.
int8_t m_pdcchPowerOffset
CCH power offset.
int8_t m_tpc
Tx power control command.
uint8_t m_dai
DL assignment index.
uint8_t m_cceIndex
Control Channel Element index.
uint8_t m_ulIndex
UL index.
uint8_t m_ueTxAntennaSelection
UE antenna selection.
bool m_cqiRequest
CQI request.
uint8_t m_freqHopping
freq hopping
uint8_t m_aggrLevel
The aggregation level.
int8_t m_tpc
Tx power control command.
bool m_cqiRequest
CQI request?
double secondLastAveragedThroughput
Second last average throughput.
double lastAveragedThroughput
Past average throughput.
double targetThroughput
Target throughput.
Time flowStart
flow start time
unsigned int lastTtiBytesTransmitted
Total bytes send by eNB in last tti for this UE.
unsigned long totalBytesTransmitted
Total bytes send by eNb for this UE.