23 #include <ns3/pointer.h> 
   26 #include <ns3/simulator.h> 
   27 #include <ns3/lte-amc.h> 
   28 #include <ns3/tta-ff-mac-scheduler.h> 
   29 #include <ns3/lte-vendor-specific-parameters.h> 
   30 #include <ns3/boolean.h> 
  142   : m_scheduler (scheduler)
 
  217   :   m_cschedSapUser (0),
 
  221   m_amc = CreateObject <LteAmc> ();
 
  251     .AddConstructor<TtaFfMacScheduler> ()
 
  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::set <uint16_t>::iterator it;
 
  375       std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it = 
m_rlcBufferReq.begin ();
 
  376       std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator temp;
 
  411   std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it = 
m_rlcBufferReq.begin ();
 
  412   std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator temp;
 
  415       if ((*it).first.m_rnti == params.
m_rnti)
 
  441   std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
 
  449       m_rlcBufferReq.insert (std::pair <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters> (flow, params));
 
  453       (*it).second = params;
 
  478   for (
int i = 0; i < 4; i++)
 
  493   std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
 
  497       if (((*it).first.m_rnti == rnti) && (((*it).second.m_rlcTransmissionQueueSize > 0)
 
  498                                            || ((*it).second.m_rlcRetransmissionQueueSize > 0)
 
  499                                            || ((*it).second.m_rlcStatusPduSize > 0) ))
 
  503       if ((*it).first.m_rnti > rnti)
 
  526       NS_FATAL_ERROR (
"No Process Id Statusfound for this RNTI " << rnti);
 
  528   uint8_t i = (*it).second;
 
  533   while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
 
  534   if ((*itStat).second.at (i) == 0)
 
  565       NS_FATAL_ERROR (
"No Process Id Statusfound for this RNTI " << rnti);
 
  567   uint8_t i = (*it).second;
 
  572   while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
 
  573   if ((*itStat).second.at (i) == 0)
 
  576       (*itStat).second.at (i) = 1;
 
  580       NS_FATAL_ERROR (
"No HARQ process available for RNTI " << rnti << 
" check before update with HarqProcessAvailability");
 
  583   return ((*it).second);
 
  592   std::map <uint16_t, DlHarqProcessesTimer_t>::iterator itTimers;
 
  601               NS_LOG_DEBUG (
this << 
" Reset HARQ proc " << i << 
" for RNTI " << (*itTimers).first);
 
  602               std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat = 
m_dlHarqProcessesStatus.find ((*itTimers).first);
 
  605                   NS_FATAL_ERROR (
"No Process Id Status found for this RNTI " << (*itTimers).first);
 
  607               (*itStat).second.at (i) = 0;
 
  608               (*itTimers).second.at (i) = 0;
 
  612               (*itTimers).second.at (i)++;
 
  635   std::map <uint16_t, std::vector <uint16_t> > allocationMap; 
 
  636   std::vector <bool> rbgMap;  
 
  637   uint16_t rbgAllocatedNum = 0;
 
  638   std::set <uint16_t> rntiAllocated;
 
  644   uint16_t rbStart = 0;
 
  645   std::vector <struct RachListElement_s>::iterator itRach;
 
  650       newRar.
m_rnti = (*itRach).m_rnti;
 
  654       newRar.m_grant.m_rnti = newRar.m_rnti;
 
  657       uint16_t tbSizeBits = 0;
 
  664       if (tbSizeBits < (*itRach).m_estimatedSize)
 
  669       newRar.m_grant.m_rbStart = rbStart;
 
  670       newRar.m_grant.m_rbLen = rbLen;
 
  671       newRar.m_grant.m_tbSize = tbSizeBits / 8;
 
  672       newRar.m_grant.m_hopping = 
false;
 
  673       newRar.m_grant.m_tpc = 0;
 
  674       newRar.m_grant.m_cqiRequest = 
false;
 
  675       newRar.m_grant.m_ulDelay = 
false;
 
  676       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);
 
  677       for (uint16_t i = rbStart; i < rbStart + rbLen; i++)
 
  681       rbStart = rbStart + rbLen;
 
  695           NS_LOG_INFO (
this << 
" Received DL-HARQ feedback");
 
  711   std::vector <struct DlInfoListElement_s> dlInfoListUntxed;
 
  715       if (itRnti != rntiAllocated.end ())
 
  721       std::vector <bool> retx;
 
  722       NS_LOG_INFO (
this << 
" Processing DLHARQ feedback");
 
  726           retx.push_back (
false);
 
  733       if (retx.at (0) || retx.at (1))
 
  738           NS_LOG_INFO (
this << 
" HARQ retx RNTI " << rnti << 
" harqId " << (uint16_t)harqId);
 
  747           if (dci.
m_rv.size () == 1)
 
  749               rv = dci.
m_rv.at (0);
 
  753               rv = (dci.
m_rv.at (0) > dci.
m_rv.at (1) ? dci.
m_rv.at (0) : dci.
m_rv.at (1));
 
  759               NS_LOG_INFO (
"Maximum number of retransmissions reached -> drop process");
 
  765               (*it).second.at (harqId) = 0;
 
  771               for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++)
 
  773                   (*itRlcPdu).second.at (k).at (harqId).clear ();
 
  779           std::vector <int> dciRbg;
 
  782           for (
int j = 0; j < 32; j++)
 
  786                   dciRbg.push_back (j);
 
  792           for (uint8_t j = 0; j < dciRbg.size (); j++)
 
  794               if (rbgMap.at (dciRbg.at (j)) == 
true)
 
  804               for (uint8_t j = 0; j < dciRbg.size (); j++)
 
  806                   rbgMap.at (dciRbg.at (j)) = 
true;
 
  807                   NS_LOG_INFO (
"RBG " << dciRbg.at (j) << 
" assigned");
 
  811               NS_LOG_INFO (
this << 
" Send retx in the same RBGs");
 
  817               uint8_t rbgId = (dciRbg.at (dciRbg.size () - 1) + 1) % rbgNum;
 
  818               uint8_t startRbg = dciRbg.at (dciRbg.size () - 1);
 
  819               std::vector <bool> rbgMapCopy = rbgMap;
 
  820               while ((j < dciRbg.size ())&&(startRbg != rbgId))
 
  822                   if (rbgMapCopy.at (rbgId) == 
false)
 
  824                       rbgMapCopy.at (rbgId) = 
true;
 
  825                       dciRbg.at (j) = rbgId;
 
  830               if (j == dciRbg.size ())
 
  833                   uint32_t rbgMask = 0;
 
  834                   for (uint16_t k = 0; k < dciRbg.size (); k++)
 
  836                       rbgMask = rbgMask + (0x1 << dciRbg.at (k));
 
  841                   NS_LOG_INFO (
this << 
" Move retx in RBGs " << dciRbg.size ());
 
  846                   dlInfoListUntxed.push_back (params.
m_dlInfoList.at (i));
 
  847                   NS_LOG_INFO (
this << 
" No resource for this retx -> buffer it");
 
  855               NS_FATAL_ERROR (
"Unable to find RlcPdcList in HARQ buffer for RNTI " << rnti);
 
  857           for (uint8_t j = 0; j < nLayers; j++)
 
  861                   if (j >= dci.
m_ndi.size ())
 
  864                       dci.
m_ndi.push_back (0);
 
  865                       dci.
m_rv.push_back (0);
 
  866                       dci.
m_mcs.push_back (0);
 
  868                       NS_LOG_INFO (
this << 
" layer " << (uint16_t)j << 
" no txed (MIMO transition)");
 
  872                       dci.
m_ndi.at (j) = 0;
 
  874                       (*itHarq).second.at (harqId).m_rv.at (j)++;
 
  875                       NS_LOG_INFO (
this << 
" layer " << (uint16_t)j << 
" RV " << (uint16_t)dci.
m_rv.at (j));
 
  881                   dci.
m_ndi.at (j) = 0;
 
  883                   dci.
m_mcs.at (j) = 0;
 
  885                   NS_LOG_INFO (
this << 
" layer " << (uint16_t)j << 
" no retx");
 
  888           for (uint16_t k = 0; k < (*itRlcPdu).second.at (0).at (dci.
m_harqProcess).size (); k++)
 
  890               std::vector <struct RlcPduListElement_s> rlcPduListPerLc;
 
  891               for (uint8_t j = 0; j < nLayers; j++)
 
  895                       if (j < dci.
m_ndi.size ())
 
  897                           rlcPduListPerLc.push_back ((*itRlcPdu).second.at (j).at (dci.
m_harqProcess).at (k));
 
  902               if (rlcPduListPerLc.size () > 0)
 
  909           (*itHarq).second.at (harqId).
m_rv = dci.
m_rv;
 
  914               NS_FATAL_ERROR (
"Unable to find HARQ timer for RNTI " << (uint16_t)rnti);
 
  916           (*itHarqTimer).second.at (harqId) = 0;
 
  918           rntiAllocated.insert (rnti);
 
  935           for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++)
 
  946   for (
int i = 0; i < rbgNum; i++)
 
  948       NS_LOG_INFO (
this << 
" ALLOCATION for RBG " << i << 
" of " << rbgNum);
 
  949       if (rbgMap.at (i) == 
false)
 
  951           std::set <uint16_t>::iterator it;
 
  953           double rcqiMax = 0.0;
 
  956               std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it));
 
  960                   if (itRnti != rntiAllocated.end ())
 
  962                     NS_LOG_DEBUG (
this << 
" RNTI discared for HARQ tx" << (uint16_t)(*it));
 
  966                     NS_LOG_DEBUG (
this << 
" RNTI discared for HARQ id" << (uint16_t)(*it));
 
  971               std::map <uint16_t,SbMeasResult_s>::iterator itSbCqi;
 
  973               std::map <uint16_t,uint8_t>::iterator itWbCqi;
 
  976               std::map <uint16_t,uint8_t>::iterator itTxMode;
 
  984               std::vector <uint8_t> sbCqi;
 
  987                   for (uint8_t k = 0; k < nLayer; k++)
 
  994                   sbCqi = (*itSbCqi).second.m_higherLayerSelected.at (i).m_sbCqi;
 
 1000                   wbCqi = (*itWbCqi).second;
 
 1007               uint8_t cqi1 = sbCqi.at (0);
 
 1009               if (sbCqi.size () > 1)
 
 1011                   cqi2 = sbCqi.at (1);
 
 1013               if ((cqi1 > 0)||(cqi2 > 0)) 
 
 1018                       double achievableSbRate = 0.0;
 
 1019                       double achievableWbRate = 0.0;
 
 1022                       for (uint8_t k = 0; k < nLayer; k++)
 
 1024                           if (sbCqi.size () > k)
 
 1038                       double metric = achievableSbRate / achievableWbRate;
 
 1040                       if (metric > rcqiMax)
 
 1057               rbgMap.at (i) = 
true;
 
 1058               std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
 
 1059               itMap = allocationMap.find ((*itMax));
 
 1060               if (itMap == allocationMap.end ())
 
 1063                   std::vector <uint16_t> tempMap;
 
 1064                   tempMap.push_back (i);
 
 1065                   allocationMap.insert (std::pair <uint16_t, std::vector <uint16_t> > ((*itMax), tempMap));
 
 1069                   (*itMap).second.push_back (i);
 
 1071               NS_LOG_INFO (
this << 
" UE assigned " << (*itMax));
 
 1078   std::map <uint16_t, std::vector <uint16_t> >::iterator itMap = allocationMap.begin ();
 
 1079   while (itMap != allocationMap.end ())
 
 1083       newEl.
m_rnti = (*itMap).first;
 
 1086       newDci.
m_rnti = (*itMap).first;
 
 1094           lcActives = (uint16_t)65535; 
 
 1096       uint16_t RgbPerRnti = (*itMap).second.size ();
 
 1097       std::map <uint16_t,SbMeasResult_s>::iterator itCqi;
 
 1099       std::map <uint16_t,uint8_t>::iterator itTxMode;
 
 1103           NS_FATAL_ERROR (
"No Transmission Mode info on user " << (*itMap).first);
 
 1106       std::vector <uint8_t> worstCqi (2, 15);
 
 1109           for (uint16_t k = 0; k < (*itMap).second.size (); k++)
 
 1111               if ((*itCqi).second.m_higherLayerSelected.size () > (*itMap).second.at (k))
 
 1113                   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)) );
 
 1114                   for (uint8_t j = 0; j < nLayer; j++)
 
 1116                       if ((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.size () > j)
 
 1118                           if (((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (j)) < worstCqi.at (j))
 
 1120                               worstCqi.at (j) = ((*itCqi).second.m_higherLayerSelected.at ((*itMap).second.at (k)).m_sbCqi.at (j));
 
 1126                           worstCqi.at (j) = 1;
 
 1132                   for (uint8_t j = 0; j < nLayer; j++)
 
 1134                       worstCqi.at (j) = 1; 
 
 1141           for (uint8_t j = 0; j < nLayer; j++)
 
 1143               worstCqi.at (j) = 1; 
 
 1146       for (uint8_t j = 0; j < nLayer; j++)
 
 1148           NS_LOG_INFO (
this << 
" Layer " << (uint16_t)j << 
" CQI selected " << (uint16_t)worstCqi.at (j));
 
 1150       uint32_t bytesTxed = 0;
 
 1151       for (uint8_t j = 0; j < nLayer; j++)
 
 1158           bytesTxed += tbSize;
 
 1163       uint32_t rbgMask = 0;
 
 1164       for (uint16_t k = 0; k < (*itMap).second.size (); k++)
 
 1166           rbgMask = rbgMask + (0x1 << (*itMap).second.at (k));
 
 1167           NS_LOG_INFO (
this << 
" Allocated RBG " << (*itMap).second.at (k));
 
 1172       std::map <LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator itBufReq;
 
 1175           if (((*itBufReq).first.m_rnti == (*itMap).first)
 
 1176               && (((*itBufReq).second.m_rlcTransmissionQueueSize > 0)
 
 1177                   || ((*itBufReq).second.m_rlcRetransmissionQueueSize > 0)
 
 1178                   || ((*itBufReq).second.m_rlcStatusPduSize > 0) ))
 
 1180               std::vector <struct RlcPduListElement_s> newRlcPduLe;
 
 1181               for (uint8_t j = 0; j < nLayer; j++)
 
 1187                   newRlcPduLe.push_back (newRlcEl);
 
 1195                           NS_FATAL_ERROR (
"Unable to find RlcPdcList in HARQ buffer for RNTI " << (*itMap).first);
 
 1197                       (*itRlcPdu).second.at (j).at (newDci.
m_harqProcess).push_back (newRlcEl);
 
 1202           if ((*itBufReq).first.m_rnti > (*itMap).first)
 
 1207       for (uint8_t j = 0; j < nLayer; j++)
 
 1209           newDci.
m_ndi.push_back (1);
 
 1210           newDci.
m_rv.push_back (0);
 
 1213       newEl.
m_dci = newDci;
 
 1262   for (
unsigned int i = 0; i < params.
m_cqiList.size (); i++)
 
 1267           std::map <uint16_t,uint8_t>::iterator it;
 
 1268           uint16_t rnti = params.
m_cqiList.at (i).m_rnti;
 
 1273               m_p10CqiRxed.insert ( std::pair<uint16_t, uint8_t > (rnti, params.
m_cqiList.at (i).m_wbCqi.at (0)) ); 
 
 1280               (*it).second = params.
m_cqiList.at (i).m_wbCqi.at (0);
 
 1282               std::map <uint16_t,uint32_t>::iterator itTimers;
 
 1290           std::map <uint16_t,SbMeasResult_s>::iterator it;
 
 1291           uint16_t rnti = params.
m_cqiList.at (i).m_rnti;
 
 1296               m_a30CqiRxed.insert ( std::pair<uint16_t, SbMeasResult_s > (rnti, params.
m_cqiList.at (i).m_sbMeasResult) );
 
 1302               (*it).second = params.
m_cqiList.at (i).m_sbMeasResult;
 
 1303               std::map <uint16_t,uint32_t>::iterator itTimers;
 
 1321   std::map <uint16_t, std::vector <double> >::iterator itCqi = 
m_ueCqi.find (rnti);
 
 1335           double sinr = (*itCqi).second.at (i);
 
 1342       double estimatedSinr = (sinrNum > 0) ? (sinrSum / sinrNum) : DBL_MAX;
 
 1344       (*itCqi).second.at (rb) = estimatedSinr;
 
 1345       return (estimatedSinr);
 
 1358   std::vector <bool> rbMap;
 
 1359   uint16_t rbAllocatedNum = 0;
 
 1360   std::set <uint16_t> rntiAllocated;
 
 1361   std::vector <uint16_t> rbgAllocationMap;
 
 1372       if (rbgAllocationMap.at (i) != 0)
 
 1374           rbMap.at (i) = 
true;
 
 1384       std::map <uint16_t, uint8_t>::iterator itProcId;
 
 1387           (*itProcId).second = ((*itProcId).second + 1) % 
HARQ_PROC_NUM;
 
 1390       for (uint16_t i = 0; i < params.
m_ulInfoList.size (); i++)
 
 1399                   NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
 
 1402               NS_LOG_INFO (
this << 
" UL-HARQ retx RNTI " << rnti << 
" harqId " << (uint16_t)harqId << 
" i " << i << 
" size "  << params.
m_ulInfoList.size ());
 
 1406                   NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
 
 1413                   NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
 
 1415               if ((*itStat).second.at (harqId) >= 3)
 
 1417                   NS_LOG_INFO (
"Max number of retransmissions reached (UL)-> drop process");
 
 1423                   if (rbMap.at (j) == 
true)
 
 1434                       rbMap.at (j) = 
true;
 
 1435                       rbgAllocationMap.at (j) = dci.
m_rnti;
 
 1443                   NS_LOG_INFO (
"Cannot allocate retx due to RACH allocations for UE " << rnti);
 
 1448               (*itStat).second.at ((*itProcId).second) = (*itStat).second.at (harqId) + 1;
 
 1449               (*itStat).second.at (harqId) = 0;
 
 1450               (*itHarq).second.at ((*itProcId).second) = dci;
 
 1452               rntiAllocated.insert (dci.
m_rnti);
 
 1461   std::map <uint16_t,uint32_t>::iterator it;
 
 1466       std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
 
 1468       if (((*it).second > 0)&&(itRnti == rntiAllocated.end ()))
 
 1491   int rbAllocated = 0;
 
 1514       std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
 
 1515       if ((itRnti != rntiAllocated.end ())||((*it).second == 0))
 
 1518           NS_LOG_DEBUG (
this << 
" UE already allocated in HARQ -> discared, RNTI " << (*it).first);
 
 1540       uldci.
m_rnti = (*it).first;
 
 1542       bool allocated = 
false;
 
 1543       NS_LOG_INFO (
this << 
" RB Allocated " << rbAllocated << 
" rbPerFlow " << rbPerFlow << 
" flows " << nflows);
 
 1548           for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
 
 1550               if (rbMap.at (j) == 
true)
 
 1560               for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
 
 1562                   rbMap.at (j) = 
true;
 
 1564                   rbgAllocationMap.at (j) = (*it).first;
 
 1566               rbAllocated += rbPerFlow;
 
 1597       std::map <uint16_t, std::vector <double> >::iterator itCqi = 
m_ueCqi.find ((*it).first);
 
 1607           double minSinr = (*itCqi).second.at (uldci.
m_rbStart);
 
 1614               double sinr = (*itCqi).second.at (i);
 
 1619               if ((*itCqi).second.at (i) < minSinr)
 
 1621                   minSinr = (*itCqi).second.at (i);
 
 1626           double s = log2 ( 1 + (
 
 1627                                  std::pow (10, minSinr / 10 )  /
 
 1628                                  ( (-std::log (5.0 * 0.00005 )) / 1.5) ));
 
 1642                   rbgAllocationMap.at (i) = 0;
 
 1668           std::map <uint16_t, uint8_t>::iterator itProcId;
 
 1674           harqId = (*itProcId).second;
 
 1680           (*itDci).second.at (harqId) = uldci;
 
 1683       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);
 
 1727   std::map <uint16_t,uint32_t>::iterator it;
 
 1729   for (
unsigned int i = 0; i < params.
m_macCeList.size (); i++)
 
 1740           uint32_t buffer = 0;
 
 1741           for (uint8_t lcg = 0; lcg < 4; ++lcg)
 
 1743               uint8_t bsrId = params.
m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (lcg);
 
 1748           NS_LOG_LOGIC (
this << 
"RNTI=" << rnti << 
" buffer=" << buffer);
 
 1753               m_ceBsrRxed.insert ( std::pair<uint16_t, uint32_t > (rnti, buffer));
 
 1758               (*it).second = buffer;
 
 1801         std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
 
 1802         std::map <uint16_t, std::vector <double> >::iterator itCqi;
 
 1803         NS_LOG_DEBUG (
this << 
" Collect PUSCH CQIs of Frame no. " << (params.
m_sfnSf >> 4) << 
" subframe no. " << (0xF & params.
m_sfnSf));
 
 1809         for (uint32_t i = 0; i < (*itMap).second.size (); i++)
 
 1813             itCqi = 
m_ueCqi.find ((*itMap).second.at (i));
 
 1817                 std::vector <double> newCqi;
 
 1822                         newCqi.push_back (sinr);
 
 1831                 m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > ((*itMap).second.at (i), newCqi));
 
 1838                 (*itCqi).second.at (i) = sinr;
 
 1841                 std::map <uint16_t, uint32_t>::iterator itTimers;
 
 1862                 rnti = vsp->GetRnti ();
 
 1865         std::map <uint16_t, std::vector <double> >::iterator itCqi;
 
 1870             std::vector <double> newCqi;
 
 1874                 newCqi.push_back (sinr);
 
 1875                 NS_LOG_INFO (
this << 
" RNTI " << rnti << 
" new SRS-CQI for RB  " << j << 
" value " << sinr);
 
 1878             m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > (rnti, newCqi));
 
 1888                 (*itCqi).second.at (j) = sinr;
 
 1889                 NS_LOG_INFO (
this << 
" RNTI " << rnti << 
" update SRS-CQI for RB  " << j << 
" value " << sinr);
 
 1892             std::map <uint16_t, uint32_t>::iterator itTimers;
 
 1905         NS_FATAL_ERROR (
"TtaFfMacScheduler supports only PUSCH and SRS UL-CQIs");
 
 1918   std::map <uint16_t,uint32_t>::iterator itP10 = 
m_p10CqiTimers.begin ();
 
 1922       if ((*itP10).second == 0)
 
 1925           std::map <uint16_t,uint8_t>::iterator itMap = 
m_p10CqiRxed.find ((*itP10).first);
 
 1927           NS_LOG_INFO (
this << 
" P10-CQI expired for user " << (*itP10).first);
 
 1929           std::map <uint16_t,uint32_t>::iterator temp = itP10;
 
 1941   std::map <uint16_t,uint32_t>::iterator itA30 = 
m_a30CqiTimers.begin ();
 
 1945       if ((*itA30).second == 0)
 
 1948           std::map <uint16_t,SbMeasResult_s>::iterator itMap = 
m_a30CqiRxed.find ((*itA30).first);
 
 1950           NS_LOG_INFO (
this << 
" A30-CQI expired for user " << (*itA30).first);
 
 1952           std::map <uint16_t,uint32_t>::iterator temp = itA30;
 
 1971   std::map <uint16_t,uint32_t>::iterator itUl = 
m_ueCqiTimers.begin ();
 
 1975       if ((*itUl).second == 0)
 
 1978           std::map <uint16_t, std::vector <double> >::iterator itMap = 
m_ueCqi.find ((*itUl).first);
 
 1979           NS_ASSERT_MSG (itMap != 
m_ueCqi.end (), 
" Does not find CQI report for user " << (*itUl).first);
 
 1980           NS_LOG_INFO (
this << 
" UL-CQI exired for user " << (*itUl).first);
 
 1981           (*itMap).second.clear ();
 
 1983           std::map <uint16_t,uint32_t>::iterator temp = itUl;
 
 2000   std::map<LteFlowId_t, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
 
 2005       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);
 
 2008       if (((*it).second.m_rlcStatusPduSize > 0) && (size >= (*it).second.m_rlcStatusPduSize))
 
 2010            (*it).second.m_rlcStatusPduSize = 0;
 
 2012       else if (((*it).second.m_rlcRetransmissionQueueSize > 0) && (size >= (*it).second.m_rlcRetransmissionQueueSize))
 
 2014           (*it).second.m_rlcRetransmissionQueueSize = 0;
 
 2016       else if ((*it).second.m_rlcTransmissionQueueSize > 0)
 
 2018           uint32_t rlcOverhead;
 
 2033           if ((*it).second.m_rlcTransmissionQueueSize <= size - rlcOverhead)
 
 2035               (*it).second.m_rlcTransmissionQueueSize = 0;
 
 2039               (*it).second.m_rlcTransmissionQueueSize -= size - rlcOverhead;
 
 2045       NS_LOG_ERROR (
this << 
" Does not find DL RLC Buffer Report of UE " << rnti);
 
 2054   std::map <uint16_t,uint32_t>::iterator it = 
m_ceBsrRxed.find (rnti);
 
 2057       NS_LOG_INFO (
this << 
" UE " << rnti << 
" size " << size << 
" BSR " << (*it).second);
 
 2058       if ((*it).second >= size)
 
 2060           (*it).second -= size;
 
 2069       NS_LOG_ERROR (
this << 
" Does not find BSR report info of UE " << rnti);
 
 2077   NS_LOG_FUNCTION (
this << 
" RNTI " << rnti << 
" txMode " << (uint16_t)txMode);