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>
140 : m_scheduler (scheduler)
215 : m_cschedSapUser (0),
220 m_amc = CreateObject <LteAmc> ();
250 .AddConstructor<PfFfMacScheduler> ()
251 .AddAttribute (
"CqiTimerThreshold",
252 "The number of TTIs a CQI is valid (default 1000 - 1 sec.)",
255 MakeUintegerChecker<uint32_t> ())
256 .AddAttribute (
"HarqEnabled",
257 "Activate/Deactivate the HARQ [by default is active].",
260 MakeBooleanChecker ())
261 .AddAttribute (
"UlGrantMcs",
262 "The MCS of the UL grant, must be [0..15] (default 0)",
265 MakeUintegerChecker<uint8_t> ())
320 dlHarqPrcStatus.resize (8,0);
323 dlHarqProcessesTimer.resize (8,0);
326 dlHarqdci.resize (8);
329 dlHarqRlcPdu.resize (2);
330 dlHarqRlcPdu.at (0).resize (8);
331 dlHarqRlcPdu.at (1).resize (8);
335 ulHarqPrcStatus.resize (8,0);
338 ulHarqdci.resize (8);
353 std::map <uint16_t, pfsFlowPerf_t>::iterator it;
388 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it =
m_rlcBufferReq.begin ();
389 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator temp;
424 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it =
m_rlcBufferReq.begin ();
425 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator temp;
428 if ((*it).first.m_rnti == params.
m_rnti)
454 std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
462 m_rlcBufferReq.insert (std::pair <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters> (flow, params));
466 (*it).second = params;
491 for (
int i = 0; i < 4; i++)
506 std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
510 if (((*it).first.m_rnti == rnti) && (((*it).second.m_rlcTransmissionQueueSize > 0)
511 || ((*it).second.m_rlcRetransmissionQueueSize > 0)
512 || ((*it).second.m_rlcStatusPduSize > 0) ))
516 if ((*it).first.m_rnti > rnti)
539 NS_FATAL_ERROR (
"No Process Id Statusfound for this RNTI " << rnti);
541 uint8_t i = (*it).second;
546 while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
547 if ((*itStat).second.at (i) == 0)
578 NS_FATAL_ERROR (
"No Process Id Statusfound for this RNTI " << rnti);
580 uint8_t i = (*it).second;
585 while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
586 if ((*itStat).second.at (i) == 0)
589 (*itStat).second.at (i) = 1;
593 NS_FATAL_ERROR (
"No HARQ process available for RNTI " << rnti <<
" check before update with HarqProcessAvailability");
596 return ((*it).second);
605 std::map <uint16_t, DlHarqProcessesTimer_t>::iterator itTimers;
614 NS_LOG_DEBUG (
this <<
" Reset HARQ proc " << i <<
" for RNTI " << (*itTimers).first);
615 std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat =
m_dlHarqProcessesStatus.find ((*itTimers).first);
618 NS_FATAL_ERROR (
"No Process Id Status found for this RNTI " << (*itTimers).first);
620 (*itStat).second.at (i) = 0;
621 (*itTimers).second.at (i) = 0;
625 (*itTimers).second.at (i)++;
648 std::map <uint16_t, std::vector <uint16_t> > allocationMap;
649 std::vector <bool> rbgMap;
650 uint16_t rbgAllocatedNum = 0;
651 std::set <uint16_t> rntiAllocated;
657 uint16_t rbStart = 0;
658 std::vector <struct RachListElement_s>::iterator itRach;
663 newRar.
m_rnti = (*itRach).m_rnti;
667 newRar.m_grant.m_rnti = newRar.m_rnti;
670 uint16_t tbSizeBits = 0;
677 if (tbSizeBits < (*itRach).m_estimatedSize)
682 newRar.m_grant.m_rbStart = rbStart;
683 newRar.m_grant.m_rbLen = rbLen;
684 newRar.m_grant.m_tbSize = tbSizeBits / 8;
685 newRar.m_grant.m_hopping =
false;
686 newRar.m_grant.m_tpc = 0;
687 newRar.m_grant.m_cqiRequest =
false;
688 newRar.m_grant.m_ulDelay =
false;
689 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);
690 for (uint16_t i = rbStart; i < rbStart + rbLen; i++)
694 rbStart = rbStart + rbLen;
708 NS_LOG_INFO (
this <<
" Received DL-HARQ feedback");
724 std::vector <struct DlInfoListElement_s> dlInfoListUntxed;
728 if (itRnti != rntiAllocated.end ())
734 std::vector <bool> retx;
735 NS_LOG_INFO (
this <<
" Processing DLHARQ feedback");
739 retx.push_back (
false);
746 if (retx.at (0) || retx.at (1))
751 NS_LOG_INFO (
this <<
" HARQ retx RNTI " << rnti <<
" harqId " << (uint16_t)harqId);
760 if (dci.
m_rv.size () == 1)
762 rv = dci.
m_rv.at (0);
766 rv = (dci.
m_rv.at (0) > dci.
m_rv.at (1) ? dci.
m_rv.at (0) : dci.
m_rv.at (1));
772 NS_LOG_INFO (
"Maximum number of retransmissions reached -> drop process");
778 (*it).second.at (harqId) = 0;
784 for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++)
786 (*itRlcPdu).second.at (k).at (harqId).clear ();
792 std::vector <int> dciRbg;
795 for (
int j = 0; j < 32; j++)
799 dciRbg.push_back (j);
805 for (uint8_t j = 0; j < dciRbg.size (); j++)
807 if (rbgMap.at (dciRbg.at (j)) ==
true)
817 for (uint8_t j = 0; j < dciRbg.size (); j++)
819 rbgMap.at (dciRbg.at (j)) =
true;
820 NS_LOG_INFO (
"RBG " << dciRbg.at (j) <<
" assigned");
824 NS_LOG_INFO (
this <<
" Send retx in the same RBGs");
830 uint8_t rbgId = (dciRbg.at (dciRbg.size () - 1) + 1) % rbgNum;
831 uint8_t startRbg = dciRbg.at (dciRbg.size () - 1);
832 std::vector <bool> rbgMapCopy = rbgMap;
833 while ((j < dciRbg.size ())&&(startRbg != rbgId))
835 if (rbgMapCopy.at (rbgId) ==
false)
837 rbgMapCopy.at (rbgId) =
true;
838 dciRbg.at (j) = rbgId;
843 if (j == dciRbg.size ())
846 uint32_t rbgMask = 0;
847 for (uint16_t k = 0; k < dciRbg.size (); k++)
849 rbgMask = rbgMask + (0x1 << dciRbg.at (k));
854 NS_LOG_INFO (
this <<
" Move retx in RBGs " << dciRbg.size ());
859 dlInfoListUntxed.push_back (params.
m_dlInfoList.at (i));
860 NS_LOG_INFO (
this <<
" No resource for this retx -> buffer it");
868 NS_FATAL_ERROR (
"Unable to find RlcPdcList in HARQ buffer for RNTI " << rnti);
870 for (uint8_t j = 0; j < nLayers; j++)
874 if (j >= dci.
m_ndi.size ())
877 dci.
m_ndi.push_back (0);
878 dci.
m_rv.push_back (0);
879 dci.
m_mcs.push_back (0);
881 NS_LOG_INFO (
this <<
" layer " << (uint16_t)j <<
" no txed (MIMO transition)");
885 dci.
m_ndi.at (j) = 0;
887 (*itHarq).second.at (harqId).m_rv.at (j)++;
888 NS_LOG_INFO (
this <<
" layer " << (uint16_t)j <<
" RV " << (uint16_t)dci.
m_rv.at (j));
894 dci.
m_ndi.at (j) = 0;
896 dci.
m_mcs.at (j) = 0;
898 NS_LOG_INFO (
this <<
" layer " << (uint16_t)j <<
" no retx");
901 for (uint16_t k = 0; k < (*itRlcPdu).second.at (0).at (dci.
m_harqProcess).size (); k++)
903 std::vector <struct RlcPduListElement_s> rlcPduListPerLc;
904 for (uint8_t j = 0; j < nLayers; j++)
908 if (j < dci.
m_ndi.size ())
910 rlcPduListPerLc.push_back ((*itRlcPdu).second.at (j).at (dci.
m_harqProcess).at (k));
915 if (rlcPduListPerLc.size () > 0)
922 (*itHarq).second.at (harqId).
m_rv = dci.
m_rv;
927 NS_FATAL_ERROR (
"Unable to find HARQ timer for RNTI " << (uint16_t)rnti);
929 (*itHarqTimer).second.at (harqId) = 0;
931 rntiAllocated.insert (rnti);
948 for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++)
959 for (
int i = 0; i < rbgNum; i++)
961 NS_LOG_INFO (
this <<
" ALLOCATION for RBG " << i <<
" of " << rbgNum);
962 if (rbgMap.at (i) ==
false)
964 std::map <uint16_t, pfsFlowPerf_t>::iterator it;
965 std::map <uint16_t, pfsFlowPerf_t>::iterator itMax =
m_flowStatsDl.end ();
966 double rcqiMax = 0.0;
969 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
973 if (itRnti != rntiAllocated.end ())
975 NS_LOG_DEBUG (
this <<
" RNTI discared for HARQ tx" << (uint16_t)(*it).first);
979 NS_LOG_DEBUG (
this <<
" RNTI discared for HARQ id" << (uint16_t)(*it).first);
983 std::map <uint16_t,SbMeasResult_s>::iterator itCqi;
985 std::map <uint16_t,uint8_t>::iterator itTxMode;
989 NS_FATAL_ERROR (
"No Transmission Mode info on user " << (*it).first);
992 std::vector <uint8_t> sbCqi;
995 for (uint8_t k = 0; k < nLayer; k++)
1002 sbCqi = (*itCqi).second.m_higherLayerSelected.at (i).m_sbCqi;
1004 uint8_t cqi1 = sbCqi.at (0);
1006 if (sbCqi.size () > 1)
1008 cqi2 = sbCqi.at (1);
1011 if ((cqi1 > 0)||(cqi2 > 0))
1016 double achievableRate = 0.0;
1018 for (uint8_t k = 0; k < nLayer; k++)
1020 if (sbCqi.size () > k)
1032 double rcqi = achievableRate / (*it).second.lastAveragedThroughput;
1033 NS_LOG_INFO (
this <<
" RNTI " << (*it).first <<
" MCS " << (uint32_t)mcs <<
" achievableRate " << achievableRate <<
" avgThr " << (*it).second.lastAveragedThroughput <<
" RCQI " << rcqi);
1051 rbgMap.at (i) =
true;
1052 std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
1053 itMap = allocationMap.find ((*itMax).first);
1054 if (itMap == allocationMap.end ())
1057 std::vector <uint16_t> tempMap;
1058 tempMap.push_back (i);
1059 allocationMap.insert (std::pair <uint16_t, std::vector <uint16_t> > ((*itMax).first, tempMap));
1063 (*itMap).second.push_back (i);
1065 NS_LOG_INFO (
this <<
" UE assigned " << (*itMax).first);
1071 std::map <uint16_t, pfsFlowPerf_t>::iterator itStats;
1074 (*itStats).second.lastTtiBytesTrasmitted = 0;
1079 std::map <uint16_t, std::vector <uint16_t> >::iterator itMap = allocationMap.begin ();
1080 while (itMap != allocationMap.end ())
1084 newEl.
m_rnti = (*itMap).first;
1087 newDci.
m_rnti = (*itMap).first;
1092 uint16_t RgbPerRnti = (*itMap).second.size ();
1093 std::map <uint16_t,SbMeasResult_s>::iterator itCqi;
1095 std::map <uint16_t,uint8_t>::iterator itTxMode;
1099 NS_FATAL_ERROR (
"No Transmission Mode info on user " << (*itMap).first);
1102 std::vector <uint8_t> worstCqi (2, 15);
1105 for (uint16_t k = 0; k < (*itMap).second.size (); k++)
1107 if ((*itCqi).second.m_higherLayerSelected.size () > (*itMap).second.at (k))
1109 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)) );
1110 for (uint8_t j = 0; j < nLayer; j++)
1112 if ((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.size () > j)
1114 if (((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (j)) < worstCqi.at (j))
1116 worstCqi.at (j) = ((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (j));
1122 worstCqi.at (j) = 1;
1128 for (uint8_t j = 0; j < nLayer; j++)
1130 worstCqi.at (j) = 1;
1137 for (uint8_t j = 0; j < nLayer; j++)
1139 worstCqi.at (j) = 1;
1142 for (uint8_t j = 0; j < nLayer; j++)
1144 NS_LOG_INFO (
this <<
" Layer " << (uint16_t)j <<
" CQI selected " << (uint16_t)worstCqi.at (j));
1146 uint32_t bytesTxed = 0;
1147 for (uint8_t j = 0; j < nLayer; j++)
1153 bytesTxed += tbSize;
1158 uint32_t rbgMask = 0;
1159 for (uint16_t k = 0; k < (*itMap).second.size (); k++)
1161 rbgMask = rbgMask + (0x1 << (*itMap).second.at (k));
1162 NS_LOG_INFO (
this <<
" Allocated RBG " << (*itMap).second.at (k));
1167 std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator itBufReq;
1170 if (((*itBufReq).first.m_rnti == (*itMap).first)
1171 && (((*itBufReq).second.m_rlcTransmissionQueueSize > 0)
1172 || ((*itBufReq).second.m_rlcRetransmissionQueueSize > 0)
1173 || ((*itBufReq).second.m_rlcStatusPduSize > 0) ))
1175 std::vector <struct RlcPduListElement_s> newRlcPduLe;
1176 for (uint8_t j = 0; j < nLayer; j++)
1182 newRlcPduLe.push_back (newRlcEl);
1190 NS_FATAL_ERROR (
"Unable to find RlcPdcList in HARQ buffer for RNTI " << (*itMap).first);
1192 (*itRlcPdu).second.at (j).at (newDci.
m_harqProcess).push_back (newRlcEl);
1197 if ((*itBufReq).first.m_rnti > (*itMap).first)
1202 for (uint8_t j = 0; j < nLayer; j++)
1204 newDci.
m_ndi.push_back (1);
1205 newDci.
m_rv.push_back (0);
1208 newEl.
m_dci = newDci;
1232 std::map <uint16_t, pfsFlowPerf_t>::iterator it;
1236 (*it).second.lastTtiBytesTrasmitted = bytesTxed;
1237 NS_LOG_INFO (
this <<
" UE total bytes txed " << (*it).second.lastTtiBytesTrasmitted);
1255 (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTrasmitted;
1257 (*itStats).second.lastAveragedThroughput = ((1.0 - (1.0 /
m_timeWindow)) * (*itStats).second.lastAveragedThroughput) + ((1.0 /
m_timeWindow) * (double)((*itStats).second.lastTtiBytesTrasmitted / 0.001));
1258 NS_LOG_INFO (
this <<
" UE total bytes " << (*itStats).second.totalBytesTransmitted);
1259 NS_LOG_INFO (
this <<
" UE average throughput " << (*itStats).second.lastAveragedThroughput);
1260 (*itStats).second.lastTtiBytesTrasmitted = 0;
1284 for (
unsigned int i = 0; i < params.
m_cqiList.size (); i++)
1289 std::map <uint16_t,uint8_t>::iterator it;
1290 uint16_t rnti = params.
m_cqiList.at (i).m_rnti;
1295 m_p10CqiRxed.insert ( std::pair<uint16_t, uint8_t > (rnti, params.
m_cqiList.at (i).m_wbCqi.at (0)) );
1302 (*it).second = params.
m_cqiList.at (i).m_wbCqi.at (0);
1304 std::map <uint16_t,uint32_t>::iterator itTimers;
1312 std::map <uint16_t,SbMeasResult_s>::iterator it;
1313 uint16_t rnti = params.
m_cqiList.at (i).m_rnti;
1318 m_a30CqiRxed.insert ( std::pair<uint16_t, SbMeasResult_s > (rnti, params.
m_cqiList.at (i).m_sbMeasResult) );
1324 (*it).second = params.
m_cqiList.at (i).m_sbMeasResult;
1325 std::map <uint16_t,uint32_t>::iterator itTimers;
1343 std::map <uint16_t, std::vector <double> >::iterator itCqi =
m_ueCqi.find (rnti);
1357 double sinr = (*itCqi).second.at (i);
1364 double estimatedSinr = sinrSum / (double)sinrNum;
1366 (*itCqi).second.at (rb) = estimatedSinr;
1367 return (estimatedSinr);
1380 std::vector <bool> rbMap;
1381 uint16_t rbAllocatedNum = 0;
1382 std::set <uint16_t> rntiAllocated;
1383 std::vector <uint16_t> rbgAllocationMap;
1394 if (rbgAllocationMap.at (i) != 0)
1396 rbMap.at (i) =
true;
1406 std::map <uint16_t, uint8_t>::iterator itProcId;
1409 (*itProcId).second = ((*itProcId).second + 1) %
HARQ_PROC_NUM;
1412 for (uint16_t i = 0; i < params.
m_ulInfoList.size (); i++)
1421 NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1424 NS_LOG_INFO (
this <<
" UL-HARQ retx RNTI " << rnti <<
" harqId " << (uint16_t)harqId <<
" i " << i <<
" size " << params.
m_ulInfoList.size ());
1428 NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1435 NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1437 if ((*itStat).second.at (harqId) >= 3)
1439 NS_LOG_INFO (
"Max number of retransmissions reached (UL)-> drop process");
1445 if (rbMap.at (j) ==
true)
1456 rbMap.at (j) =
true;
1457 rbgAllocationMap.at (j) = dci.
m_rnti;
1465 NS_LOG_INFO (
"Cannot allocate retx due to RACH allocations for UE " << rnti);
1470 (*itStat).second.at ((*itProcId).second) = (*itStat).second.at (harqId) + 1;
1471 (*itStat).second.at (harqId) = 0;
1472 (*itHarq).second.at ((*itProcId).second) = dci;
1474 rntiAllocated.insert (dci.
m_rnti);
1483 std::map <uint16_t,uint32_t>::iterator it;
1488 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
1490 if (((*it).second > 0)&&(itRnti == rntiAllocated.end ()))
1513 int rbAllocated = 0;
1515 std::map <uint16_t, pfsFlowPerf_t>::iterator itStats;
1537 std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
1538 if ((itRnti != rntiAllocated.end ())||((*it).second == 0))
1562 uldci.
m_rnti = (*it).first;
1564 bool allocated =
false;
1565 NS_LOG_INFO (
this <<
" RB Allocated " << rbAllocated <<
" rbPerFlow " << rbPerFlow);
1570 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
1572 if (rbMap.at (j) ==
true)
1582 for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
1584 rbMap.at (j) =
true;
1586 rbgAllocationMap.at (j) = (*it).first;
1588 rbAllocated += rbPerFlow;
1619 std::map <uint16_t, std::vector <double> >::iterator itCqi =
m_ueCqi.find ((*it).first);
1629 double minSinr = (*itCqi).second.at (uldci.
m_rbStart);
1636 double sinr = (*itCqi).second.at (i);
1641 if ((*itCqi).second.at (i) < minSinr)
1643 minSinr = (*itCqi).second.at (i);
1648 double s = log2 ( 1 + (
1649 std::pow (10, minSinr / 10 ) /
1650 ( (-std::log (5.0 * 0.00005 )) / 1.5) ));
1684 std::map <uint16_t, uint8_t>::iterator itProcId;
1690 harqId = (*itProcId).second;
1696 (*itDci).second.at (harqId) = uldci;
1699 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);
1705 (*itStats).second.lastTtiBytesTrasmitted = uldci.
m_tbSize;
1709 NS_LOG_DEBUG (
this <<
" No Stats for this allocated UE");
1733 (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTrasmitted;
1735 (*itStats).second.lastAveragedThroughput = ((1.0 - (1.0 /
m_timeWindow)) * (*itStats).second.lastAveragedThroughput) + ((1.0 /
m_timeWindow) * (double)((*itStats).second.lastTtiBytesTrasmitted / 0.001));
1736 NS_LOG_INFO (
this <<
" UE total bytes " << (*itStats).second.totalBytesTransmitted);
1737 NS_LOG_INFO (
this <<
" UE average throughput " << (*itStats).second.lastAveragedThroughput);
1738 (*itStats).second.lastTtiBytesTrasmitted = 0;
1765 std::map <uint16_t,uint32_t>::iterator it;
1767 for (
unsigned int i = 0; i < params.
m_macCeList.size (); i++)
1778 uint32_t buffer = 0;
1779 for (uint8_t lcg = 0; lcg < 4; ++lcg)
1781 uint8_t bsrId = params.
m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (lcg);
1786 NS_LOG_LOGIC (
this <<
"RNTI=" << rnti <<
" buffer=" << buffer);
1791 m_ceBsrRxed.insert ( std::pair<uint16_t, uint32_t > (rnti, buffer));
1796 (*it).second = buffer;
1839 std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
1840 std::map <uint16_t, std::vector <double> >::iterator itCqi;
1841 NS_LOG_DEBUG (
this <<
" Collect PUSCH CQIs of Frame no. " << (params.
m_sfnSf >> 4) <<
" subframe no. " << (0xF & params.
m_sfnSf));
1847 for (uint32_t i = 0; i < (*itMap).second.size (); i++)
1851 itCqi =
m_ueCqi.find ((*itMap).second.at (i));
1855 std::vector <double> newCqi;
1860 newCqi.push_back (sinr);
1869 m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > ((*itMap).second.at (i), newCqi));
1876 (*itCqi).second.at (i) = sinr;
1877 NS_LOG_DEBUG (
this <<
" RNTI " << (*itMap).second.at (i) <<
" RB " << i <<
" SINR " << sinr);
1879 std::map <uint16_t, uint32_t>::iterator itTimers;
1900 rnti = vsp->GetRnti ();
1903 std::map <uint16_t, std::vector <double> >::iterator itCqi;
1908 std::vector <double> newCqi;
1912 newCqi.push_back (sinr);
1913 NS_LOG_INFO (
this <<
" RNTI " << rnti <<
" new SRS-CQI for RB " << j <<
" value " << sinr);
1916 m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > (rnti, newCqi));
1926 (*itCqi).second.at (j) = sinr;
1927 NS_LOG_INFO (
this <<
" RNTI " << rnti <<
" update SRS-CQI for RB " << j <<
" value " << sinr);
1930 std::map <uint16_t, uint32_t>::iterator itTimers;
1943 NS_FATAL_ERROR (
"PfFfMacScheduler supports only PUSCH and SRS UL-CQIs");
1956 std::map <uint16_t,uint32_t>::iterator itP10 =
m_p10CqiTimers.begin ();
1960 if ((*itP10).second == 0)
1963 std::map <uint16_t,uint8_t>::iterator itMap =
m_p10CqiRxed.find ((*itP10).first);
1965 NS_LOG_INFO (
this <<
" P10-CQI expired for user " << (*itP10).first);
1967 std::map <uint16_t,uint32_t>::iterator temp = itP10;
1979 std::map <uint16_t,uint32_t>::iterator itA30 =
m_a30CqiTimers.begin ();
1983 if ((*itA30).second == 0)
1986 std::map <uint16_t,SbMeasResult_s>::iterator itMap =
m_a30CqiRxed.find ((*itA30).first);
1988 NS_LOG_INFO (
this <<
" A30-CQI expired for user " << (*itA30).first);
1990 std::map <uint16_t,uint32_t>::iterator temp = itA30;
2009 std::map <uint16_t,uint32_t>::iterator itUl =
m_ueCqiTimers.begin ();
2013 if ((*itUl).second == 0)
2016 std::map <uint16_t, std::vector <double> >::iterator itMap =
m_ueCqi.find ((*itUl).first);
2017 NS_ASSERT_MSG (itMap !=
m_ueCqi.end (),
" Does not find CQI report for user " << (*itUl).first);
2018 NS_LOG_INFO (
this <<
" UL-CQI exired for user " << (*itUl).first);
2019 (*itMap).second.clear ();
2021 std::map <uint16_t,uint32_t>::iterator temp = itUl;
2038 std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
2043 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);
2046 if (((*it).second.m_rlcStatusPduSize > 0) && (size >= (*it).second.m_rlcStatusPduSize))
2048 (*it).second.m_rlcStatusPduSize = 0;
2050 else if (((*it).second.m_rlcRetransmissionQueueSize > 0) && (size >= (*it).second.m_rlcRetransmissionQueueSize))
2052 (*it).second.m_rlcRetransmissionQueueSize = 0;
2054 else if ((*it).second.m_rlcTransmissionQueueSize > 0)
2057 if ((*it).second.m_rlcTransmissionQueueSize <= size)
2059 (*it).second.m_rlcTransmissionQueueSize = 0;
2064 (*it).second.m_rlcTransmissionQueueSize -= size;
2070 NS_LOG_ERROR (
this <<
" Does not find DL RLC Buffer Report of UE " << rnti);
2079 std::map <uint16_t,uint32_t>::iterator it =
m_ceBsrRxed.find (rnti);
2082 NS_LOG_INFO (
this <<
" UE " << rnti <<
" size " << size <<
" BSR " << (*it).second);
2083 if ((*it).second >= size)
2085 (*it).second -= size;
2094 NS_LOG_ERROR (
this <<
" Does not find BSR report info of UE " << rnti);
2102 NS_LOG_FUNCTION (
this <<
" RNTI " << rnti <<
" txMode " << (uint16_t)txMode);