22 #include <ns3/pointer.h>
25 #include <ns3/simulator.h>
26 #include <ns3/lte-amc.h>
27 #include <ns3/pf-ff-mac-scheduler.h>
28 #include <ns3/lte-vendor-specific-parameters.h>
29 #include <ns3/boolean.h>
141 : m_scheduler (scheduler)
216 : m_cschedSapUser (0),
221 m_amc = CreateObject <LteAmc> ();
251 .AddConstructor<PfFfMacScheduler> ()
252 .AddAttribute (
"CqiTimerThreshold",
253 "The number of TTIs a CQI is valid (default 1000 - 1 sec.)",
256 MakeUintegerChecker<uint32_t> ())
257 .AddAttribute (
"HarqEnabled",
258 "Activate/Deactivate the HARQ [by default is active].",
261 MakeBooleanChecker ())
262 .AddAttribute (
"UlGrantMcs",
263 "The MCS of the UL grant, must be [0..15] (default 0)",
266 MakeUintegerChecker<uint8_t> ())
321 dlHarqPrcStatus.resize (8,0);
324 dlHarqProcessesTimer.resize (8,0);
327 dlHarqdci.resize (8);
330 dlHarqRlcPdu.resize (2);
331 dlHarqRlcPdu.at (0).resize (8);
332 dlHarqRlcPdu.at (1).resize (8);
336 ulHarqPrcStatus.resize (8,0);
339 ulHarqdci.resize (8);
354 std::map <uint16_t, pfsFlowPerf_t>::iterator it;
385 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it =
m_rlcBufferReq.begin ();
386 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator temp;
421 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it =
m_rlcBufferReq.begin ();
422 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator temp;
425 if ((*it).first.m_rnti == params.
m_rnti)
451 std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
459 m_rlcBufferReq.insert (std::pair <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters> (flow, params));
463 (*it).second = params;
488 for (
int i = 0; i < 4; i++)
503 std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
507 if (((*it).first.m_rnti == rnti) && (((*it).second.m_rlcTransmissionQueueSize > 0)
508 || ((*it).second.m_rlcRetransmissionQueueSize > 0)
509 || ((*it).second.m_rlcStatusPduSize > 0) ))
513 if ((*it).first.m_rnti > rnti)
536 NS_FATAL_ERROR (
"No Process Id Statusfound for this RNTI " << rnti);
538 uint8_t i = (*it).second;
543 while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
544 if ((*itStat).second.at (i) == 0)
575 NS_FATAL_ERROR (
"No Process Id Statusfound for this RNTI " << rnti);
577 uint8_t i = (*it).second;
582 while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
583 if ((*itStat).second.at (i) == 0)
586 (*itStat).second.at (i) = 1;
590 NS_FATAL_ERROR (
"No HARQ process available for RNTI " << rnti <<
" check before update with HarqProcessAvailability");
593 return ((*it).second);
602 std::map <uint16_t, DlHarqProcessesTimer_t>::iterator itTimers;
611 NS_LOG_DEBUG (
this <<
" Reset HARQ proc " << i <<
" for RNTI " << (*itTimers).first);
612 std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat =
m_dlHarqProcessesStatus.find ((*itTimers).first);
615 NS_FATAL_ERROR (
"No Process Id Status found for this RNTI " << (*itTimers).first);
617 (*itStat).second.at (i) = 0;
618 (*itTimers).second.at (i) = 0;
622 (*itTimers).second.at (i)++;
645 std::map <uint16_t, std::vector <uint16_t> > allocationMap;
646 std::vector <bool> rbgMap;
647 uint16_t rbgAllocatedNum = 0;
648 std::set <uint16_t> rntiAllocated;
654 uint16_t rbStart = 0;
655 std::vector <struct RachListElement_s>::iterator itRach;
660 newRar.
m_rnti = (*itRach).m_rnti;
664 newRar.m_grant.m_rnti = newRar.m_rnti;
667 uint16_t tbSizeBits = 0;
674 if (tbSizeBits < (*itRach).m_estimatedSize)
679 newRar.m_grant.m_rbStart = rbStart;
680 newRar.m_grant.m_rbLen = rbLen;
681 newRar.m_grant.m_tbSize = tbSizeBits / 8;
682 newRar.m_grant.m_hopping =
false;
683 newRar.m_grant.m_tpc = 0;
684 newRar.m_grant.m_cqiRequest =
false;
685 newRar.m_grant.m_ulDelay =
false;
686 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);
687 for (uint16_t i = rbStart; i < rbStart + rbLen; i++)
691 rbStart = rbStart + rbLen;
705 NS_LOG_INFO (
this <<
" Received DL-HARQ feedback");
721 std::vector <struct DlInfoListElement_s> dlInfoListUntxed;
725 if (itRnti != rntiAllocated.end ())
731 std::vector <bool> retx;
732 NS_LOG_INFO (
this <<
" Processing DLHARQ feedback");
736 retx.push_back (
false);
743 if (retx.at (0) || retx.at (1))
748 NS_LOG_INFO (
this <<
" HARQ retx RNTI " << rnti <<
" harqId " << (uint16_t)harqId);
757 if (dci.
m_rv.size () == 1)
759 rv = dci.
m_rv.at (0);
763 rv = (dci.
m_rv.at (0) > dci.
m_rv.at (1) ? dci.
m_rv.at (0) : dci.
m_rv.at (1));
769 NS_LOG_INFO (
"Maximum number of retransmissions reached -> drop process");
775 (*it).second.at (harqId) = 0;
781 for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++)
783 (*itRlcPdu).second.at (k).at (harqId).clear ();
789 std::vector <int> dciRbg;
792 for (
int j = 0; j < 32; j++)
796 dciRbg.push_back (j);
802 for (uint8_t j = 0; j < dciRbg.size (); j++)
804 if (rbgMap.at (dciRbg.at (j)) ==
true)
814 for (uint8_t j = 0; j < dciRbg.size (); j++)
816 rbgMap.at (dciRbg.at (j)) =
true;
817 NS_LOG_INFO (
"RBG " << dciRbg.at (j) <<
" assigned");
821 NS_LOG_INFO (
this <<
" Send retx in the same RBGs");
827 uint8_t rbgId = (dciRbg.at (dciRbg.size () - 1) + 1) % rbgNum;
828 uint8_t startRbg = dciRbg.at (dciRbg.size () - 1);
829 std::vector <bool> rbgMapCopy = rbgMap;
830 while ((j < dciRbg.size ())&&(startRbg != rbgId))
832 if (rbgMapCopy.at (rbgId) ==
false)
834 rbgMapCopy.at (rbgId) =
true;
835 dciRbg.at (j) = rbgId;
840 if (j == dciRbg.size ())
843 uint32_t rbgMask = 0;
844 for (uint16_t k = 0; k < dciRbg.size (); k++)
846 rbgMask = rbgMask + (0x1 << dciRbg.at (k));
851 NS_LOG_INFO (
this <<
" Move retx in RBGs " << dciRbg.size ());
856 dlInfoListUntxed.push_back (params.
m_dlInfoList.at (i));
857 NS_LOG_INFO (
this <<
" No resource for this retx -> buffer it");
865 NS_FATAL_ERROR (
"Unable to find RlcPdcList in HARQ buffer for RNTI " << rnti);
867 for (uint8_t j = 0; j < nLayers; j++)
871 if (j >= dci.
m_ndi.size ())
874 dci.
m_ndi.push_back (0);
875 dci.
m_rv.push_back (0);
876 dci.
m_mcs.push_back (0);
878 NS_LOG_INFO (
this <<
" layer " << (uint16_t)j <<
" no txed (MIMO transition)");
882 dci.
m_ndi.at (j) = 0;
884 (*itHarq).second.at (harqId).m_rv.at (j)++;
885 NS_LOG_INFO (
this <<
" layer " << (uint16_t)j <<
" RV " << (uint16_t)dci.
m_rv.at (j));
891 dci.
m_ndi.at (j) = 0;
893 dci.
m_mcs.at (j) = 0;
895 NS_LOG_INFO (
this <<
" layer " << (uint16_t)j <<
" no retx");
898 for (uint16_t k = 0; k < (*itRlcPdu).second.at (0).at (dci.
m_harqProcess).size (); k++)
900 std::vector <struct RlcPduListElement_s> rlcPduListPerLc;
901 for (uint8_t j = 0; j < nLayers; j++)
905 if (j < dci.
m_ndi.size ())
907 rlcPduListPerLc.push_back ((*itRlcPdu).second.at (j).at (dci.
m_harqProcess).at (k));
912 if (rlcPduListPerLc.size () > 0)
919 (*itHarq).second.at (harqId).
m_rv = dci.
m_rv;
924 NS_FATAL_ERROR (
"Unable to find HARQ timer for RNTI " << (uint16_t)rnti);
926 (*itHarqTimer).second.at (harqId) = 0;
928 rntiAllocated.insert (rnti);
945 for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++)
956 for (
int i = 0; i < rbgNum; i++)
958 NS_LOG_INFO (
this <<
" ALLOCATION for RBG " << i <<
" of " << rbgNum);
959 if (rbgMap.at (i) ==
false)
961 std::map <uint16_t, pfsFlowPerf_t>::iterator it;
962 std::map <uint16_t, pfsFlowPerf_t>::iterator itMax =
m_flowStatsDl.end ();
963 double rcqiMax = 0.0;
966 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
970 if (itRnti != rntiAllocated.end ())
972 NS_LOG_DEBUG (
this <<
" RNTI discared for HARQ tx" << (uint16_t)(*it).first);
976 NS_LOG_DEBUG (
this <<
" RNTI discared for HARQ id" << (uint16_t)(*it).first);
980 std::map <uint16_t,SbMeasResult_s>::iterator itCqi;
982 std::map <uint16_t,uint8_t>::iterator itTxMode;
986 NS_FATAL_ERROR (
"No Transmission Mode info on user " << (*it).first);
989 std::vector <uint8_t> sbCqi;
992 for (uint8_t k = 0; k < nLayer; k++)
999 sbCqi = (*itCqi).second.m_higherLayerSelected.at (i).m_sbCqi;
1001 uint8_t cqi1 = sbCqi.at (0);
1003 if (sbCqi.size () > 1)
1005 cqi2 = sbCqi.at (1);
1008 if ((cqi1 > 0)||(cqi2 > 0))
1013 double achievableRate = 0.0;
1015 for (uint8_t k = 0; k < nLayer; k++)
1017 if (sbCqi.size () > k)
1029 double rcqi = achievableRate / (*it).second.lastAveragedThroughput;
1030 NS_LOG_INFO (
this <<
" RNTI " << (*it).first <<
" MCS " << (uint32_t)mcs <<
" achievableRate " << achievableRate <<
" avgThr " << (*it).second.lastAveragedThroughput <<
" RCQI " << rcqi);
1048 rbgMap.at (i) =
true;
1049 std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
1050 itMap = allocationMap.find ((*itMax).first);
1051 if (itMap == allocationMap.end ())
1054 std::vector <uint16_t> tempMap;
1055 tempMap.push_back (i);
1056 allocationMap.insert (std::pair <uint16_t, std::vector <uint16_t> > ((*itMax).first, tempMap));
1060 (*itMap).second.push_back (i);
1062 NS_LOG_INFO (
this <<
" UE assigned " << (*itMax).first);
1068 std::map <uint16_t, pfsFlowPerf_t>::iterator itStats;
1071 (*itStats).second.lastTtiBytesTrasmitted = 0;
1076 std::map <uint16_t, std::vector <uint16_t> >::iterator itMap = allocationMap.begin ();
1077 while (itMap != allocationMap.end ())
1081 newEl.
m_rnti = (*itMap).first;
1084 newDci.
m_rnti = (*itMap).first;
1092 lcActives = (uint16_t)65535;
1094 uint16_t RgbPerRnti = (*itMap).second.size ();
1095 std::map <uint16_t,SbMeasResult_s>::iterator itCqi;
1097 std::map <uint16_t,uint8_t>::iterator itTxMode;
1101 NS_FATAL_ERROR (
"No Transmission Mode info on user " << (*itMap).first);
1104 std::vector <uint8_t> worstCqi (2, 15);
1107 for (uint16_t k = 0; k < (*itMap).second.size (); k++)
1109 if ((*itCqi).second.m_higherLayerSelected.size () > (*itMap).second.at (k))
1111 NS_LOG_INFO (
this <<
" RBG " << (*itMap).second.at (k) <<
" CQI " << (uint16_t)((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (0)) );
1112 for (uint8_t j = 0; j < nLayer; j++)
1114 if ((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.size () > j)
1116 if (((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (j)) < worstCqi.at (j))
1118 worstCqi.at (j) = ((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (j));
1124 worstCqi.at (j) = 1;
1130 for (uint8_t j = 0; j < nLayer; j++)
1132 worstCqi.at (j) = 1;
1139 for (uint8_t j = 0; j < nLayer; j++)
1141 worstCqi.at (j) = 1;
1144 for (uint8_t j = 0; j < nLayer; j++)
1146 NS_LOG_INFO (
this <<
" Layer " << (uint16_t)j <<
" CQI selected " << (uint16_t)worstCqi.at (j));
1148 uint32_t bytesTxed = 0;
1149 for (uint8_t j = 0; j < nLayer; j++)
1155 bytesTxed += tbSize;
1160 uint32_t rbgMask = 0;
1161 for (uint16_t k = 0; k < (*itMap).second.size (); k++)
1163 rbgMask = rbgMask + (0x1 << (*itMap).second.at (k));
1164 NS_LOG_INFO (
this <<
" Allocated RBG " << (*itMap).second.at (k));
1169 std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator itBufReq;
1172 if (((*itBufReq).first.m_rnti == (*itMap).first)
1173 && (((*itBufReq).second.m_rlcTransmissionQueueSize > 0)
1174 || ((*itBufReq).second.m_rlcRetransmissionQueueSize > 0)
1175 || ((*itBufReq).second.m_rlcStatusPduSize > 0) ))
1177 std::vector <struct RlcPduListElement_s> newRlcPduLe;
1178 for (uint8_t j = 0; j < nLayer; j++)
1184 newRlcPduLe.push_back (newRlcEl);
1192 NS_FATAL_ERROR (
"Unable to find RlcPdcList in HARQ buffer for RNTI " << (*itMap).first);
1194 (*itRlcPdu).second.at (j).at (newDci.
m_harqProcess).push_back (newRlcEl);
1199 if ((*itBufReq).first.m_rnti > (*itMap).first)
1204 for (uint8_t j = 0; j < nLayer; j++)
1206 newDci.
m_ndi.push_back (1);
1207 newDci.
m_rv.push_back (0);
1210 newEl.
m_dci = newDci;
1234 std::map <uint16_t, pfsFlowPerf_t>::iterator it;
1238 (*it).second.lastTtiBytesTrasmitted = bytesTxed;
1239 NS_LOG_INFO (
this <<
" UE total bytes txed " << (*it).second.lastTtiBytesTrasmitted);
1257 (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTrasmitted;
1259 (*itStats).second.lastAveragedThroughput = ((1.0 - (1.0 /
m_timeWindow)) * (*itStats).second.lastAveragedThroughput) + ((1.0 /
m_timeWindow) * (double)((*itStats).second.lastTtiBytesTrasmitted / 0.001));
1260 NS_LOG_INFO (
this <<
" UE total bytes " << (*itStats).second.totalBytesTransmitted);
1261 NS_LOG_INFO (
this <<
" UE average throughput " << (*itStats).second.lastAveragedThroughput);
1262 (*itStats).second.lastTtiBytesTrasmitted = 0;
1286 for (
unsigned int i = 0; i < params.
m_cqiList.size (); i++)
1291 std::map <uint16_t,uint8_t>::iterator it;
1292 uint16_t rnti = params.
m_cqiList.at (i).m_rnti;
1297 m_p10CqiRxed.insert ( std::pair<uint16_t, uint8_t > (rnti, params.
m_cqiList.at (i).m_wbCqi.at (0)) );
1304 (*it).second = params.
m_cqiList.at (i).m_wbCqi.at (0);
1306 std::map <uint16_t,uint32_t>::iterator itTimers;
1314 std::map <uint16_t,SbMeasResult_s>::iterator it;
1315 uint16_t rnti = params.
m_cqiList.at (i).m_rnti;
1320 m_a30CqiRxed.insert ( std::pair<uint16_t, SbMeasResult_s > (rnti, params.
m_cqiList.at (i).m_sbMeasResult) );
1326 (*it).second = params.
m_cqiList.at (i).m_sbMeasResult;
1327 std::map <uint16_t,uint32_t>::iterator itTimers;
1345 std::map <uint16_t, std::vector <double> >::iterator itCqi =
m_ueCqi.find (rnti);
1359 double sinr = (*itCqi).second.at (i);
1366 double estimatedSinr = (sinrNum > 0) ? (sinrSum / sinrNum) : DBL_MAX;
1368 (*itCqi).second.at (rb) = estimatedSinr;
1369 return (estimatedSinr);
1382 std::vector <bool> rbMap;
1383 uint16_t rbAllocatedNum = 0;
1384 std::set <uint16_t> rntiAllocated;
1385 std::vector <uint16_t> rbgAllocationMap;
1396 if (rbgAllocationMap.at (i) != 0)
1398 rbMap.at (i) =
true;
1408 std::map <uint16_t, uint8_t>::iterator itProcId;
1411 (*itProcId).second = ((*itProcId).second + 1) %
HARQ_PROC_NUM;
1414 for (uint16_t i = 0; i < params.
m_ulInfoList.size (); i++)
1423 NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1426 NS_LOG_INFO (
this <<
" UL-HARQ retx RNTI " << rnti <<
" harqId " << (uint16_t)harqId <<
" i " << i <<
" size " << params.
m_ulInfoList.size ());
1430 NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1437 NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1439 if ((*itStat).second.at (harqId) >= 3)
1441 NS_LOG_INFO (
"Max number of retransmissions reached (UL)-> drop process");
1447 if (rbMap.at (j) ==
true)
1458 rbMap.at (j) =
true;
1459 rbgAllocationMap.at (j) = dci.
m_rnti;
1467 NS_LOG_INFO (
"Cannot allocate retx due to RACH allocations for UE " << rnti);
1472 (*itStat).second.at ((*itProcId).second) = (*itStat).second.at (harqId) + 1;
1473 (*itStat).second.at (harqId) = 0;
1474 (*itHarq).second.at ((*itProcId).second) = dci;
1476 rntiAllocated.insert (dci.
m_rnti);
1485 std::map <uint16_t,uint32_t>::iterator it;
1490 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
1492 if (((*it).second > 0)&&(itRnti == rntiAllocated.end ()))
1515 int rbAllocated = 0;
1517 std::map <uint16_t, pfsFlowPerf_t>::iterator itStats;
1539 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
1540 if ((itRnti != rntiAllocated.end ())||((*it).second == 0))
1543 NS_LOG_DEBUG (
this <<
" UE already allocated in HARQ -> discared, RNTI " << (*it).first);
1565 uldci.
m_rnti = (*it).first;
1567 bool allocated =
false;
1568 NS_LOG_INFO (
this <<
" RB Allocated " << rbAllocated <<
" rbPerFlow " << rbPerFlow <<
" flows " << nflows);
1573 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
1575 if (rbMap.at (j) ==
true)
1585 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
1587 rbMap.at (j) =
true;
1589 rbgAllocationMap.at (j) = (*it).first;
1591 rbAllocated += rbPerFlow;
1622 std::map <uint16_t, std::vector <double> >::iterator itCqi =
m_ueCqi.find ((*it).first);
1632 double minSinr = (*itCqi).second.at (uldci.
m_rbStart);
1639 double sinr = (*itCqi).second.at (i);
1644 if ((*itCqi).second.at (i) < minSinr)
1646 minSinr = (*itCqi).second.at (i);
1651 double s = log2 ( 1 + (
1652 std::pow (10, minSinr / 10 ) /
1653 ( (-std::log (5.0 * 0.00005 )) / 1.5) ));
1667 rbgAllocationMap.at (i) = 0;
1693 std::map <uint16_t, uint8_t>::iterator itProcId;
1699 harqId = (*itProcId).second;
1705 (*itDci).second.at (harqId) = uldci;
1708 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);
1714 (*itStats).second.lastTtiBytesTrasmitted = uldci.
m_tbSize;
1718 NS_LOG_DEBUG (
this <<
" No Stats for this allocated UE");
1742 (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTrasmitted;
1744 (*itStats).second.lastAveragedThroughput = ((1.0 - (1.0 /
m_timeWindow)) * (*itStats).second.lastAveragedThroughput) + ((1.0 /
m_timeWindow) * (double)((*itStats).second.lastTtiBytesTrasmitted / 0.001));
1745 NS_LOG_INFO (
this <<
" UE total bytes " << (*itStats).second.totalBytesTransmitted);
1746 NS_LOG_INFO (
this <<
" UE average throughput " << (*itStats).second.lastAveragedThroughput);
1747 (*itStats).second.lastTtiBytesTrasmitted = 0;
1774 std::map <uint16_t,uint32_t>::iterator it;
1776 for (
unsigned int i = 0; i < params.
m_macCeList.size (); i++)
1787 uint32_t buffer = 0;
1788 for (uint8_t lcg = 0; lcg < 4; ++lcg)
1790 uint8_t bsrId = params.
m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (lcg);
1795 NS_LOG_LOGIC (
this <<
"RNTI=" << rnti <<
" buffer=" << buffer);
1800 m_ceBsrRxed.insert ( std::pair<uint16_t, uint32_t > (rnti, buffer));
1805 (*it).second = buffer;
1848 std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
1849 std::map <uint16_t, std::vector <double> >::iterator itCqi;
1850 NS_LOG_DEBUG (
this <<
" Collect PUSCH CQIs of Frame no. " << (params.
m_sfnSf >> 4) <<
" subframe no. " << (0xF & params.
m_sfnSf));
1856 for (uint32_t i = 0; i < (*itMap).second.size (); i++)
1860 itCqi =
m_ueCqi.find ((*itMap).second.at (i));
1864 std::vector <double> newCqi;
1869 newCqi.push_back (sinr);
1878 m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > ((*itMap).second.at (i), newCqi));
1885 (*itCqi).second.at (i) = sinr;
1886 NS_LOG_DEBUG (
this <<
" RNTI " << (*itMap).second.at (i) <<
" RB " << i <<
" SINR " << sinr);
1888 std::map <uint16_t, uint32_t>::iterator itTimers;
1901 NS_LOG_DEBUG (
this <<
" Collect SRS CQIs of Frame no. " << (params.
m_sfnSf >> 4) <<
" subframe no. " << (0xF & params.
m_sfnSf));
1910 rnti = vsp->GetRnti ();
1913 std::map <uint16_t, std::vector <double> >::iterator itCqi;
1918 std::vector <double> newCqi;
1922 newCqi.push_back (sinr);
1923 NS_LOG_INFO (
this <<
" RNTI " << rnti <<
" new SRS-CQI for RB " << j <<
" value " << sinr);
1926 m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > (rnti, newCqi));
1936 (*itCqi).second.at (j) = sinr;
1937 NS_LOG_INFO (
this <<
" RNTI " << rnti <<
" update SRS-CQI for RB " << j <<
" value " << sinr);
1940 std::map <uint16_t, uint32_t>::iterator itTimers;
1953 NS_FATAL_ERROR (
"PfFfMacScheduler supports only PUSCH and SRS UL-CQIs");
1966 std::map <uint16_t,uint32_t>::iterator itP10 =
m_p10CqiTimers.begin ();
1970 if ((*itP10).second == 0)
1973 std::map <uint16_t,uint8_t>::iterator itMap =
m_p10CqiRxed.find ((*itP10).first);
1975 NS_LOG_INFO (
this <<
" P10-CQI expired for user " << (*itP10).first);
1977 std::map <uint16_t,uint32_t>::iterator temp = itP10;
1989 std::map <uint16_t,uint32_t>::iterator itA30 =
m_a30CqiTimers.begin ();
1993 if ((*itA30).second == 0)
1996 std::map <uint16_t,SbMeasResult_s>::iterator itMap =
m_a30CqiRxed.find ((*itA30).first);
1998 NS_LOG_INFO (
this <<
" A30-CQI expired for user " << (*itA30).first);
2000 std::map <uint16_t,uint32_t>::iterator temp = itA30;
2019 std::map <uint16_t,uint32_t>::iterator itUl =
m_ueCqiTimers.begin ();
2023 if ((*itUl).second == 0)
2026 std::map <uint16_t, std::vector <double> >::iterator itMap =
m_ueCqi.find ((*itUl).first);
2027 NS_ASSERT_MSG (itMap !=
m_ueCqi.end (),
" Does not find CQI report for user " << (*itUl).first);
2028 NS_LOG_INFO (
this <<
" UL-CQI exired for user " << (*itUl).first);
2029 (*itMap).second.clear ();
2031 std::map <uint16_t,uint32_t>::iterator temp = itUl;
2048 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
2053 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);
2056 if (((*it).second.m_rlcStatusPduSize > 0) && (size >= (*it).second.m_rlcStatusPduSize))
2058 (*it).second.m_rlcStatusPduSize = 0;
2060 else if (((*it).second.m_rlcRetransmissionQueueSize > 0) && (size >= (*it).second.m_rlcRetransmissionQueueSize))
2062 (*it).second.m_rlcRetransmissionQueueSize = 0;
2064 else if ((*it).second.m_rlcTransmissionQueueSize > 0)
2066 uint32_t rlcOverhead;
2081 if ((*it).second.m_rlcTransmissionQueueSize <= size - rlcOverhead)
2083 (*it).second.m_rlcTransmissionQueueSize = 0;
2087 (*it).second.m_rlcTransmissionQueueSize -= size - rlcOverhead;
2093 NS_LOG_ERROR (
this <<
" Does not find DL RLC Buffer Report of UE " << rnti);
2102 std::map <uint16_t,uint32_t>::iterator it =
m_ceBsrRxed.find (rnti);
2105 NS_LOG_INFO (
this <<
" UE " << rnti <<
" size " << size <<
" BSR " << (*it).second);
2106 if ((*it).second >= size)
2108 (*it).second -= size;
2117 NS_LOG_ERROR (
this <<
" Does not find BSR report info of UE " << rnti);
2125 NS_LOG_FUNCTION (
this <<
" RNTI " << rnti <<
" txMode " << (uint16_t)txMode);