23 #include <ns3/pointer.h>
26 #include <ns3/simulator.h>
27 #include <ns3/lte-amc.h>
28 #include <ns3/tdtbfq-ff-mac-scheduler.h>
29 #include <ns3/lte-vendor-specific-parameters.h>
30 #include <ns3/boolean.h>
31 #include <ns3/integer.h>
143 : m_scheduler (scheduler)
218 : m_cschedSapUser (0),
224 m_amc = CreateObject <LteAmc> ();
252 static TypeId tid =
TypeId (
"ns3::TdTbfqFfMacScheduler")
254 .AddConstructor<TdTbfqFfMacScheduler> ()
255 .AddAttribute (
"CqiTimerThreshold",
256 "The number of TTIs a CQI is valid (default 1000 - 1 sec.)",
259 MakeUintegerChecker<uint32_t> ())
260 .AddAttribute (
"DebtLimit",
261 "Flow debt limit (default -625000 bytes)",
264 MakeIntegerChecker<int> ())
265 .AddAttribute (
"CreditLimit",
266 "Flow credit limit (default 625000 bytes)",
269 MakeUintegerChecker<uint32_t> ())
270 .AddAttribute (
"TokenPoolSize",
271 "The maximum value of flow token pool (default 1 bytes)",
274 MakeUintegerChecker<uint32_t> ())
275 .AddAttribute (
"CreditableThreshold",
276 "Threshold of flow credit (default 0 bytes)",
279 MakeUintegerChecker<uint32_t> ())
281 .AddAttribute (
"HarqEnabled",
282 "Activate/Deactivate the HARQ [by default is active].",
285 MakeBooleanChecker ())
286 .AddAttribute (
"UlGrantMcs",
287 "The MCS of the UL grant, must be [0..15] (default 0)",
290 MakeUintegerChecker<uint8_t> ())
345 dlHarqPrcStatus.resize (8,0);
348 dlHarqProcessesTimer.resize (8,0);
351 dlHarqdci.resize (8);
354 dlHarqRlcPdu.resize (2);
355 dlHarqRlcPdu.at (0).resize (8);
356 dlHarqRlcPdu.at (1).resize (8);
360 ulHarqPrcStatus.resize (8,0);
363 ulHarqdci.resize (8);
378 std::map <uint16_t, tdtbfqsFlowPerf_t>::iterator it;
398 m_flowStatsDl.insert (std::pair<uint16_t, tdtbfqsFlowPerf_t> (params.
m_rnti, flowStatsDl));
409 m_flowStatsUl.insert (std::pair<uint16_t, tdtbfqsFlowPerf_t> (params.
m_rnti, flowStatsUl));
416 m_flowStatsDl[(*it).first].tokenGenerationRate = mbrDlInBytes;
417 m_flowStatsUl[(*it).first].tokenGenerationRate = mbrUlInBytes;
431 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it =
m_rlcBufferReq.begin ();
432 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator temp;
467 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it =
m_rlcBufferReq.begin ();
468 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator temp;
471 if ((*it).first.m_rnti == params.
m_rnti)
497 std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
505 m_rlcBufferReq.insert (std::pair <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters> (flow, params));
509 (*it).second = params;
534 for (
int i = 0; i < 4; i++)
549 std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
553 if (((*it).first.m_rnti == rnti) && (((*it).second.m_rlcTransmissionQueueSize > 0)
554 || ((*it).second.m_rlcRetransmissionQueueSize > 0)
555 || ((*it).second.m_rlcStatusPduSize > 0) ))
559 if ((*it).first.m_rnti > rnti)
582 NS_FATAL_ERROR (
"No Process Id Statusfound for this RNTI " << rnti);
584 uint8_t i = (*it).second;
589 while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
590 if ((*itStat).second.at (i) == 0)
621 NS_FATAL_ERROR (
"No Process Id Statusfound for this RNTI " << rnti);
623 uint8_t i = (*it).second;
628 while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
629 if ((*itStat).second.at (i) == 0)
632 (*itStat).second.at (i) = 1;
636 NS_FATAL_ERROR (
"No HARQ process available for RNTI " << rnti <<
" check before update with HarqProcessAvailability");
639 return ((*it).second);
648 std::map <uint16_t, DlHarqProcessesTimer_t>::iterator itTimers;
657 NS_LOG_DEBUG (
this <<
" Reset HARQ proc " << i <<
" for RNTI " << (*itTimers).first);
658 std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat =
m_dlHarqProcessesStatus.find ((*itTimers).first);
661 NS_FATAL_ERROR (
"No Process Id Status found for this RNTI " << (*itTimers).first);
663 (*itStat).second.at (i) = 0;
664 (*itTimers).second.at (i) = 0;
668 (*itTimers).second.at (i)++;
691 std::map <uint16_t, std::vector <uint16_t> > allocationMap;
692 std::vector <bool> rbgMap;
693 uint16_t rbgAllocatedNum = 0;
694 std::set <uint16_t> rntiAllocated;
700 uint16_t rbStart = 0;
701 std::vector <struct RachListElement_s>::iterator itRach;
706 newRar.
m_rnti = (*itRach).m_rnti;
710 newRar.m_grant.m_rnti = newRar.m_rnti;
713 uint16_t tbSizeBits = 0;
720 if (tbSizeBits < (*itRach).m_estimatedSize)
725 newRar.m_grant.m_rbStart = rbStart;
726 newRar.m_grant.m_rbLen = rbLen;
727 newRar.m_grant.m_tbSize = tbSizeBits / 8;
728 newRar.m_grant.m_hopping =
false;
729 newRar.m_grant.m_tpc = 0;
730 newRar.m_grant.m_cqiRequest =
false;
731 newRar.m_grant.m_ulDelay =
false;
732 NS_LOG_INFO (
this <<
" UL grant allocated to RNTI " << (*itRach).m_rnti <<
" rbStart " << rbStart <<
" rbLen " << rbLen <<
" MCS " <<
m_ulGrantMcs <<
" tbSize " << newRar.m_grant.m_tbSize);
733 for (uint16_t i = rbStart; i < rbStart + rbLen; i++)
737 rbStart = rbStart + rbLen;
751 NS_LOG_INFO (
this <<
" Received DL-HARQ feedback");
767 std::vector <struct DlInfoListElement_s> dlInfoListUntxed;
771 if (itRnti != rntiAllocated.end ())
777 std::vector <bool> retx;
778 NS_LOG_INFO (
this <<
" Processing DLHARQ feedback");
782 retx.push_back (
false);
789 if (retx.at (0) || retx.at (1))
794 NS_LOG_INFO (
this <<
" HARQ retx RNTI " << rnti <<
" harqId " << (uint16_t)harqId);
803 if (dci.
m_rv.size () == 1)
805 rv = dci.
m_rv.at (0);
809 rv = (dci.
m_rv.at (0) > dci.
m_rv.at (1) ? dci.
m_rv.at (0) : dci.
m_rv.at (1));
815 NS_LOG_INFO (
"Maximum number of retransmissions reached -> drop process");
821 (*it).second.at (harqId) = 0;
827 for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++)
829 (*itRlcPdu).second.at (k).at (harqId).clear ();
835 std::vector <int> dciRbg;
838 for (
int j = 0; j < 32; j++)
842 dciRbg.push_back (j);
848 for (uint8_t j = 0; j < dciRbg.size (); j++)
850 if (rbgMap.at (dciRbg.at (j)) ==
true)
860 for (uint8_t j = 0; j < dciRbg.size (); j++)
862 rbgMap.at (dciRbg.at (j)) =
true;
863 NS_LOG_INFO (
"RBG " << dciRbg.at (j) <<
" assigned");
867 NS_LOG_INFO (
this <<
" Send retx in the same RBGs");
873 uint8_t rbgId = (dciRbg.at (dciRbg.size () - 1) + 1) % rbgNum;
874 uint8_t startRbg = dciRbg.at (dciRbg.size () - 1);
875 std::vector <bool> rbgMapCopy = rbgMap;
876 while ((j < dciRbg.size ())&&(startRbg != rbgId))
878 if (rbgMapCopy.at (rbgId) ==
false)
880 rbgMapCopy.at (rbgId) =
true;
881 dciRbg.at (j) = rbgId;
886 if (j == dciRbg.size ())
889 uint32_t rbgMask = 0;
890 for (uint16_t k = 0; k < dciRbg.size (); k++)
892 rbgMask = rbgMask + (0x1 << dciRbg.at (k));
897 NS_LOG_INFO (
this <<
" Move retx in RBGs " << dciRbg.size ());
902 dlInfoListUntxed.push_back (params.
m_dlInfoList.at (i));
903 NS_LOG_INFO (
this <<
" No resource for this retx -> buffer it");
911 NS_FATAL_ERROR (
"Unable to find RlcPdcList in HARQ buffer for RNTI " << rnti);
913 for (uint8_t j = 0; j < nLayers; j++)
917 if (j >= dci.
m_ndi.size ())
920 dci.
m_ndi.push_back (0);
921 dci.
m_rv.push_back (0);
922 dci.
m_mcs.push_back (0);
924 NS_LOG_INFO (
this <<
" layer " << (uint16_t)j <<
" no txed (MIMO transition)");
928 dci.
m_ndi.at (j) = 0;
930 (*itHarq).second.at (harqId).m_rv.at (j)++;
931 NS_LOG_INFO (
this <<
" layer " << (uint16_t)j <<
" RV " << (uint16_t)dci.
m_rv.at (j));
937 dci.
m_ndi.at (j) = 0;
939 dci.
m_mcs.at (j) = 0;
941 NS_LOG_INFO (
this <<
" layer " << (uint16_t)j <<
" no retx");
944 for (uint16_t k = 0; k < (*itRlcPdu).second.at (0).at (dci.
m_harqProcess).size (); k++)
946 std::vector <struct RlcPduListElement_s> rlcPduListPerLc;
947 for (uint8_t j = 0; j < nLayers; j++)
951 if (j < dci.
m_ndi.size ())
953 rlcPduListPerLc.push_back ((*itRlcPdu).second.at (j).at (dci.
m_harqProcess).at (k));
958 if (rlcPduListPerLc.size () > 0)
965 (*itHarq).second.at (harqId).
m_rv = dci.
m_rv;
970 NS_FATAL_ERROR (
"Unable to find HARQ timer for RNTI " << (uint16_t)rnti);
972 (*itHarqTimer).second.at (harqId) = 0;
974 rntiAllocated.insert (rnti);
991 for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++)
1002 std::map <uint16_t, tdtbfqsFlowPerf_t>::iterator itStats;
1005 if ( (*itStats).second.tokenGenerationRate / 1000 + (*itStats).second.tokenPoolSize > (*itStats).second.maxTokenPoolSize )
1007 (*itStats).second.counter += (*itStats).second.tokenGenerationRate / 1000 - ( (*itStats).second.maxTokenPoolSize - (*itStats).second.tokenPoolSize );
1008 (*itStats).second.tokenPoolSize = (*itStats).second.maxTokenPoolSize;
1009 bankSize += (*itStats).second.tokenGenerationRate / 1000 - ( (*itStats).second.maxTokenPoolSize - (*itStats).second.tokenPoolSize );
1013 (*itStats).second.tokenPoolSize += (*itStats).second.tokenGenerationRate / 1000;
1019 std::map <uint16_t, tdtbfqsFlowPerf_t>::iterator it;
1020 std::map <uint16_t, tdtbfqsFlowPerf_t>::iterator itMax =
m_flowStatsDl.end ();
1021 double metricMax = 0.0;
1022 bool firstRnti =
true;
1025 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
1029 if (itRnti != rntiAllocated.end ())
1031 NS_LOG_DEBUG (
this <<
" RNTI discared for HARQ tx" << (uint16_t)(*it).first);
1035 NS_LOG_DEBUG (
this <<
" RNTI discared for HARQ id" << (uint16_t)(*it).first);
1047 double metric = ( ( (double)(*it).second.counter ) / ( (double)(*it).second.tokenGenerationRate ) );
1049 if (firstRnti ==
true)
1056 if (metric > metricMax)
1071 std::vector <uint16_t> tempMap;
1072 for (
int i = 0; i < rbgNum; i++)
1074 if ( rbgMap.at (i) ==
true)
1077 tempMap.push_back (i);
1078 rbgMap.at (i) =
true;
1080 allocationMap.insert (std::pair <uint16_t, std::vector <uint16_t> > ((*itMax).first, tempMap));
1087 std::map <uint16_t, std::vector <uint16_t> >::iterator itMap = allocationMap.begin ();
1088 while (itMap != allocationMap.end ())
1092 newEl.
m_rnti = (*itMap).first;
1095 newDci.
m_rnti = (*itMap).first;
1103 lcActives = (uint16_t)65535;
1105 uint16_t RgbPerRnti = (*itMap).second.size ();
1106 std::map <uint16_t,SbMeasResult_s>::iterator itCqi;
1108 std::map <uint16_t,uint8_t>::iterator itTxMode;
1112 NS_FATAL_ERROR (
"No Transmission Mode info on user " << (*itMap).first);
1115 std::vector <uint8_t> worstCqi (2, 15);
1118 for (uint16_t k = 0; k < (*itMap).second.size (); k++)
1120 if ((*itCqi).second.m_higherLayerSelected.size () > (*itMap).second.at (k))
1122 for (uint8_t j = 0; j < nLayer; j++)
1124 if ((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.size () > j)
1126 if (((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (j)) < worstCqi.at (j))
1128 worstCqi.at (j) = ((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (j));
1134 worstCqi.at (j) = 1;
1140 for (uint8_t j = 0; j < nLayer; j++)
1142 worstCqi.at (j) = 1;
1149 for (uint8_t j = 0; j < nLayer; j++)
1151 worstCqi.at (j) = 1;
1154 uint32_t bytesTxed = 0;
1155 for (uint8_t j = 0; j < nLayer; j++)
1160 bytesTxed += tbSize;
1165 uint32_t rbgMask = 0;
1166 for (uint16_t k = 0; k < (*itMap).second.size (); k++)
1168 rbgMask = rbgMask + (0x1 << (*itMap).second.at (k));
1169 NS_LOG_INFO (
this <<
" Allocated RBG " << (*itMap).second.at (k));
1174 std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator itBufReq;
1177 if (((*itBufReq).first.m_rnti == (*itMap).first)
1178 && (((*itBufReq).second.m_rlcTransmissionQueueSize > 0)
1179 || ((*itBufReq).second.m_rlcRetransmissionQueueSize > 0)
1180 || ((*itBufReq).second.m_rlcStatusPduSize > 0) ))
1182 std::vector <struct RlcPduListElement_s> newRlcPduLe;
1183 for (uint8_t j = 0; j < nLayer; j++)
1189 newRlcPduLe.push_back (newRlcEl);
1197 NS_FATAL_ERROR (
"Unable to find RlcPdcList in HARQ buffer for RNTI " << (*itMap).first);
1199 (*itRlcPdu).second.at (j).at (newDci.
m_harqProcess).push_back (newRlcEl);
1204 if ((*itBufReq).first.m_rnti > (*itMap).first)
1209 for (uint8_t j = 0; j < nLayer; j++)
1211 newDci.
m_ndi.push_back (1);
1212 newDci.
m_rv.push_back (0);
1215 newEl.
m_dci = newDci;
1237 if ( bytesTxed <= (*itMax).second.tokenPoolSize )
1239 (*itMax).second.tokenPoolSize -= bytesTxed;
1243 (*itMax).second.counter = (*itMax).second.counter - ( bytesTxed - (*itMax).second.tokenPoolSize );
1244 (*itMax).second.tokenPoolSize = 0;
1245 if (
bankSize <= ( bytesTxed - (*itMax).second.tokenPoolSize ))
1281 for (
unsigned int i = 0; i < params.
m_cqiList.size (); i++)
1286 std::map <uint16_t,uint8_t>::iterator it;
1287 uint16_t rnti = params.
m_cqiList.at (i).m_rnti;
1292 m_p10CqiRxed.insert ( std::pair<uint16_t, uint8_t > (rnti, params.
m_cqiList.at (i).m_wbCqi.at (0)) );
1299 (*it).second = params.
m_cqiList.at (i).m_wbCqi.at (0);
1301 std::map <uint16_t,uint32_t>::iterator itTimers;
1309 std::map <uint16_t,SbMeasResult_s>::iterator it;
1310 uint16_t rnti = params.
m_cqiList.at (i).m_rnti;
1315 m_a30CqiRxed.insert ( std::pair<uint16_t, SbMeasResult_s > (rnti, params.
m_cqiList.at (i).m_sbMeasResult) );
1321 (*it).second = params.
m_cqiList.at (i).m_sbMeasResult;
1322 std::map <uint16_t,uint32_t>::iterator itTimers;
1340 std::map <uint16_t, std::vector <double> >::iterator itCqi =
m_ueCqi.find (rnti);
1354 double sinr = (*itCqi).second.at (i);
1361 double estimatedSinr = (sinrNum > 0) ? (sinrSum / sinrNum) : DBL_MAX;
1363 (*itCqi).second.at (rb) = estimatedSinr;
1364 return (estimatedSinr);
1377 std::vector <bool> rbMap;
1378 uint16_t rbAllocatedNum = 0;
1379 std::set <uint16_t> rntiAllocated;
1380 std::vector <uint16_t> rbgAllocationMap;
1391 if (rbgAllocationMap.at (i) != 0)
1393 rbMap.at (i) =
true;
1403 std::map <uint16_t, uint8_t>::iterator itProcId;
1406 (*itProcId).second = ((*itProcId).second + 1) %
HARQ_PROC_NUM;
1409 for (uint16_t i = 0; i < params.
m_ulInfoList.size (); i++)
1418 NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1421 NS_LOG_INFO (
this <<
" UL-HARQ retx RNTI " << rnti <<
" harqId " << (uint16_t)harqId <<
" i " << i <<
" size " << params.
m_ulInfoList.size ());
1425 NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1432 NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1434 if ((*itStat).second.at (harqId) >= 3)
1436 NS_LOG_INFO (
"Max number of retransmissions reached (UL)-> drop process");
1442 if (rbMap.at (j) ==
true)
1453 rbMap.at (j) =
true;
1454 rbgAllocationMap.at (j) = dci.
m_rnti;
1462 NS_LOG_INFO (
"Cannot allocate retx due to RACH allocations for UE " << rnti);
1467 (*itStat).second.at ((*itProcId).second) = (*itStat).second.at (harqId) + 1;
1468 (*itStat).second.at (harqId) = 0;
1469 (*itHarq).second.at ((*itProcId).second) = dci;
1471 rntiAllocated.insert (dci.
m_rnti);
1480 std::map <uint16_t,uint32_t>::iterator it;
1485 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
1487 if (((*it).second > 0)&&(itRnti == rntiAllocated.end ()))
1510 int rbAllocated = 0;
1512 std::map <uint16_t, tdtbfqsFlowPerf_t>::iterator itStats;
1534 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
1535 if ((itRnti != rntiAllocated.end ())||((*it).second == 0))
1538 NS_LOG_DEBUG (
this <<
" UE already allocated in HARQ -> discared, RNTI " << (*it).first);
1560 uldci.
m_rnti = (*it).first;
1562 bool allocated =
false;
1563 NS_LOG_INFO (
this <<
" RB Allocated " << rbAllocated <<
" rbPerFlow " << rbPerFlow <<
" flows " << nflows);
1568 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
1570 if (rbMap.at (j) ==
true)
1580 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
1582 rbMap.at (j) =
true;
1584 rbgAllocationMap.at (j) = (*it).first;
1586 rbAllocated += rbPerFlow;
1617 std::map <uint16_t, std::vector <double> >::iterator itCqi =
m_ueCqi.find ((*it).first);
1627 double minSinr = (*itCqi).second.at (uldci.
m_rbStart);
1634 double sinr = (*itCqi).second.at (i);
1639 if ((*itCqi).second.at (i) < minSinr)
1641 minSinr = (*itCqi).second.at (i);
1646 double s = log2 ( 1 + (
1647 std::pow (10, minSinr / 10 ) /
1648 ( (-std::log (5.0 * 0.00005 )) / 1.5) ));
1662 rbgAllocationMap.at (i) = 0;
1688 std::map <uint16_t, uint8_t>::iterator itProcId;
1694 harqId = (*itProcId).second;
1700 (*itDci).second.at (harqId) = uldci;
1703 NS_LOG_INFO (
this <<
" UE Allocation RNTI " << (*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 <<
" harqId " << (uint16_t)harqId);
1746 std::map <uint16_t,uint32_t>::iterator it;
1748 for (
unsigned int i = 0; i < params.
m_macCeList.size (); i++)
1759 uint32_t buffer = 0;
1760 for (uint8_t lcg = 0; lcg < 4; ++lcg)
1762 uint8_t bsrId = params.
m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (lcg);
1767 NS_LOG_LOGIC (
this <<
"RNTI=" << rnti <<
" buffer=" << buffer);
1772 m_ceBsrRxed.insert ( std::pair<uint16_t, uint32_t > (rnti, buffer));
1777 (*it).second = buffer;
1820 std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
1821 std::map <uint16_t, std::vector <double> >::iterator itCqi;
1822 NS_LOG_DEBUG (
this <<
" Collect PUSCH CQIs of Frame no. " << (params.
m_sfnSf >> 4) <<
" subframe no. " << (0xF & params.
m_sfnSf));
1828 for (uint32_t i = 0; i < (*itMap).second.size (); i++)
1832 itCqi =
m_ueCqi.find ((*itMap).second.at (i));
1836 std::vector <double> newCqi;
1841 newCqi.push_back (sinr);
1850 m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > ((*itMap).second.at (i), newCqi));
1857 (*itCqi).second.at (i) = sinr;
1858 NS_LOG_DEBUG (
this <<
" RNTI " << (*itMap).second.at (i) <<
" RB " << i <<
" SINR " << sinr);
1860 std::map <uint16_t, uint32_t>::iterator itTimers;
1881 rnti = vsp->GetRnti ();
1884 std::map <uint16_t, std::vector <double> >::iterator itCqi;
1889 std::vector <double> newCqi;
1893 newCqi.push_back (sinr);
1894 NS_LOG_INFO (
this <<
" RNTI " << rnti <<
" new SRS-CQI for RB " << j <<
" value " << sinr);
1897 m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > (rnti, newCqi));
1907 (*itCqi).second.at (j) = sinr;
1908 NS_LOG_INFO (
this <<
" RNTI " << rnti <<
" update SRS-CQI for RB " << j <<
" value " << sinr);
1911 std::map <uint16_t, uint32_t>::iterator itTimers;
1924 NS_FATAL_ERROR (
"TdTbfqFfMacScheduler supports only PUSCH and SRS UL-CQIs");
1937 std::map <uint16_t,uint32_t>::iterator itP10 =
m_p10CqiTimers.begin ();
1941 if ((*itP10).second == 0)
1944 std::map <uint16_t,uint8_t>::iterator itMap =
m_p10CqiRxed.find ((*itP10).first);
1946 NS_LOG_INFO (
this <<
" P10-CQI expired for user " << (*itP10).first);
1948 std::map <uint16_t,uint32_t>::iterator temp = itP10;
1960 std::map <uint16_t,uint32_t>::iterator itA30 =
m_a30CqiTimers.begin ();
1964 if ((*itA30).second == 0)
1967 std::map <uint16_t,SbMeasResult_s>::iterator itMap =
m_a30CqiRxed.find ((*itA30).first);
1969 NS_LOG_INFO (
this <<
" A30-CQI expired for user " << (*itA30).first);
1971 std::map <uint16_t,uint32_t>::iterator temp = itA30;
1990 std::map <uint16_t,uint32_t>::iterator itUl =
m_ueCqiTimers.begin ();
1994 if ((*itUl).second == 0)
1997 std::map <uint16_t, std::vector <double> >::iterator itMap =
m_ueCqi.find ((*itUl).first);
1998 NS_ASSERT_MSG (itMap !=
m_ueCqi.end (),
" Does not find CQI report for user " << (*itUl).first);
1999 NS_LOG_INFO (
this <<
" UL-CQI exired for user " << (*itUl).first);
2000 (*itMap).second.clear ();
2002 std::map <uint16_t,uint32_t>::iterator temp = itUl;
2019 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
2024 NS_LOG_INFO (
this <<
" UE " << rnti <<
" LC " << (uint16_t)lcid <<
" txqueue " << (*it).second.m_rlcTransmissionQueueSize <<
" retxqueue " << (*it).second.m_rlcRetransmissionQueueSize <<
" status " << (*it).second.m_rlcStatusPduSize <<
" decrease " << size);
2027 if (((*it).second.m_rlcStatusPduSize > 0) && (size >= (*it).second.m_rlcStatusPduSize))
2029 (*it).second.m_rlcStatusPduSize = 0;
2031 else if (((*it).second.m_rlcRetransmissionQueueSize > 0) && (size >= (*it).second.m_rlcRetransmissionQueueSize))
2033 (*it).second.m_rlcRetransmissionQueueSize = 0;
2035 else if ((*it).second.m_rlcTransmissionQueueSize > 0)
2037 uint32_t rlcOverhead;
2052 if ((*it).second.m_rlcTransmissionQueueSize <= size - rlcOverhead)
2054 (*it).second.m_rlcTransmissionQueueSize = 0;
2058 (*it).second.m_rlcTransmissionQueueSize -= size - rlcOverhead;
2064 NS_LOG_ERROR (
this <<
" Does not find DL RLC Buffer Report of UE " << rnti);
2073 std::map <uint16_t,uint32_t>::iterator it =
m_ceBsrRxed.find (rnti);
2076 NS_LOG_INFO (
this <<
" UE " << rnti <<
" size " << size <<
" BSR " << (*it).second);
2077 if ((*it).second >= size)
2079 (*it).second -= size;
2088 NS_LOG_ERROR (
this <<
" Does not find BSR report info of UE " << rnti);
2096 NS_LOG_FUNCTION (
this <<
" RNTI " << rnti <<
" txMode " << (uint16_t)txMode);