22 #include <ns3/pointer.h> 
   28 #include <ns3/lte-amc.h> 
   29 #include <ns3/rr-ff-mac-scheduler.h> 
   30 #include <ns3/simulator.h> 
   31 #include <ns3/lte-common.h> 
   32 #include <ns3/lte-vendor-specific-parameters.h> 
   33 #include <ns3/boolean.h> 
  144   : m_scheduler (scheduler)
 
  219   :   m_cschedSapUser (0),
 
  224   m_amc = CreateObject <LteAmc> ();
 
  254     .AddConstructor<RrFfMacScheduler> ()
 
  255     .AddAttribute (
"CqiTimerThreshold",
 
  256                    "The number of TTIs a CQI is valid (default 1000 - 1 sec.)",
 
  259                    MakeUintegerChecker<uint32_t> ())
 
  260     .AddAttribute (
"HarqEnabled",
 
  261                    "Activate/Deactivate the HARQ [by default is active].",
 
  264                    MakeBooleanChecker ())
 
  265     .AddAttribute (
"UlGrantMcs",
 
  266                    "The MCS of the UL grant, must be [0..15] (default 0)",
 
  269                    MakeUintegerChecker<uint8_t> ())
 
  324       dlHarqPrcStatus.resize (8,0);
 
  327       dlHarqProcessesTimer.resize (8,0);
 
  330       dlHarqdci.resize (8);
 
  333       dlHarqRlcPdu.resize (2);
 
  334       dlHarqRlcPdu.at (0).resize (8);
 
  335       dlHarqRlcPdu.at (1).resize (8);
 
  339       ulHarqPrcStatus.resize (8,0);
 
  342       ulHarqdci.resize (8);
 
  366      std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it = 
m_rlcBufferReq.begin ();
 
  397   std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it = 
m_rlcBufferReq.begin ();
 
  400       if ((*it).m_rnti == params.
m_rnti)
 
  402           NS_LOG_INFO (
this << 
" Erase RNTI " << (*it).m_rnti << 
" LC " << (uint16_t)(*it).m_logicalChannelIdentity);
 
  429   std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it = 
m_rlcBufferReq.begin ();
 
  477   for (
int i = 0; i < 4; i++)
 
  508       NS_FATAL_ERROR (
"No Process Id Statusfound for this RNTI " << rnti);
 
  510   uint8_t i = (*it).second;
 
  515   while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
 
  516   if ((*itStat).second.at (i) == 0)
 
  547       NS_FATAL_ERROR (
"No Process Id Statusfound for this RNTI " << rnti);
 
  549   uint8_t i = (*it).second;
 
  554   while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
 
  555   if ((*itStat).second.at (i) == 0)
 
  558       (*itStat).second.at (i) = 1;
 
  565   return ((*it).second);
 
  574   std::map <uint16_t, DlHarqProcessesTimer_t>::iterator itTimers;
 
  583               NS_LOG_INFO (
this << 
" Reset HARQ proc " << i << 
" for RNTI " << (*itTimers).first);
 
  584               std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat = 
m_dlHarqProcessesStatus.find ((*itTimers).first);
 
  587                   NS_FATAL_ERROR (
"No Process Id Status found for this RNTI " << (*itTimers).first);
 
  589               (*itStat).second.at (i) = 0;
 
  590               (*itTimers).second.at (i) = 0;
 
  594               (*itTimers).second.at (i)++;
 
  615   std::vector <bool> rbgMap;
 
  616   uint16_t rbgAllocatedNum = 0;
 
  617   std::set <uint16_t> rntiAllocated;
 
  622   uint16_t rbStart = 0;
 
  623   std::vector <struct RachListElement_s>::iterator itRach;
 
  628       newRar.
m_rnti = (*itRach).m_rnti;
 
  632       newRar.m_grant.m_rnti = newRar.m_rnti;
 
  635       uint16_t tbSizeBits = 0;
 
  642       if (tbSizeBits < (*itRach).m_estimatedSize)
 
  647       newRar.m_grant.m_rbStart = rbStart;
 
  648       newRar.m_grant.m_rbLen = rbLen;
 
  649       newRar.m_grant.m_tbSize = tbSizeBits / 8;
 
  650       newRar.m_grant.m_hopping = 
false;
 
  651       newRar.m_grant.m_tpc = 0;
 
  652       newRar.m_grant.m_cqiRequest = 
false;
 
  653       newRar.m_grant.m_ulDelay = 
false;
 
  654       NS_LOG_INFO (
this << 
" UL grant allocated to RNTI " << (*itRach).m_rnti << 
" rbStart " << rbStart << 
" rbLen " << rbLen << 
" MCS " << (uint16_t) 
m_ulGrantMcs << 
" tbSize " << newRar.m_grant.m_tbSize);
 
  655       for (uint16_t i = rbStart; i < rbStart + rbLen; i++)
 
  659       rbStart = rbStart + rbLen;
 
  672           NS_LOG_INFO (
this << 
" Received DL-HARQ feedback");
 
  688   std::vector <struct DlInfoListElement_s> dlInfoListUntxed;
 
  692       if (itRnti != rntiAllocated.end ())
 
  698       std::vector <bool> retx;
 
  699       NS_LOG_INFO (
this << 
" Processing DLHARQ feedback");
 
  703           retx.push_back (
false);
 
  710       if (retx.at (0) || retx.at (1))
 
  715           NS_LOG_INFO (
this << 
" HARQ retx RNTI " << rnti << 
" harqId " << (uint16_t)harqId);
 
  724           if (dci.
m_rv.size () == 1)
 
  726               rv = dci.
m_rv.at (0);
 
  730               rv = (dci.
m_rv.at (0) > dci.
m_rv.at (1) ? dci.
m_rv.at (0) : dci.
m_rv.at (1));
 
  736               NS_LOG_INFO (
"Max number of retransmissions reached -> drop process");
 
  742               (*it).second.at (harqId) = 0;
 
  748               for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++)
 
  750                   (*itRlcPdu).second.at (k).at (harqId).clear ();
 
  756           std::vector <int> dciRbg;
 
  759           for (
int j = 0; j < 32; j++)
 
  763                   dciRbg.push_back (j);
 
  769           for (uint8_t j = 0; j < dciRbg.size (); j++)
 
  771               if (rbgMap.at (dciRbg.at (j)) == 
true)
 
  781               for (uint8_t j = 0; j < dciRbg.size (); j++)
 
  783                   rbgMap.at (dciRbg.at (j)) = 
true;
 
  784                   NS_LOG_INFO (
"RBG " << dciRbg.at (j) << 
" assigned");
 
  788               NS_LOG_INFO (
this << 
" Send retx in the same RBGs");
 
  794               uint8_t rbgId = (dciRbg.at (dciRbg.size () - 1) + 1) % rbgNum;
 
  795               uint8_t startRbg = dciRbg.at (dciRbg.size () - 1);
 
  796               std::vector <bool> rbgMapCopy = rbgMap;
 
  797               while ((j < dciRbg.size ())&&(startRbg != rbgId))
 
  799                   if (rbgMapCopy.at (rbgId) == 
false)
 
  801                       rbgMapCopy.at (rbgId) = 
true;
 
  802                       dciRbg.at (j) = rbgId;
 
  807               if (j == dciRbg.size ())
 
  810                   uint32_t rbgMask = 0;
 
  811                   for (uint16_t k = 0; k < dciRbg.size (); k++)
 
  813                       rbgMask = rbgMask + (0x1 << dciRbg.at (k));
 
  814                       NS_LOG_INFO (
this << 
" New allocated RBG " << dciRbg.at (k));
 
  823                   dlInfoListUntxed.push_back (params.
m_dlInfoList.at (i));
 
  824                   NS_LOG_INFO (
this << 
" No resource for this retx -> buffer it");
 
  832               NS_FATAL_ERROR (
"Unable to find RlcPdcList in HARQ buffer for RNTI " << rnti);
 
  834           for (uint8_t j = 0; j < nLayers; j++)
 
  838                   if (j >= dci.
m_ndi.size ())
 
  841                       dci.
m_ndi.push_back (0);
 
  842                       dci.
m_rv.push_back (0);
 
  843                       dci.
m_mcs.push_back (0);
 
  845                       NS_LOG_INFO (
this << 
" layer " << (uint16_t)j << 
" no txed (MIMO transition)");
 
  850                       dci.
m_ndi.at (j) = 0;
 
  852                       (*itHarq).second.at (harqId).m_rv.at (j)++;
 
  853                       NS_LOG_INFO (
this << 
" layer " << (uint16_t)j << 
" RV " << (uint16_t)dci.
m_rv.at (j));
 
  859                   dci.
m_ndi.at (j) = 0;
 
  861                   dci.
m_mcs.at (j) = 0;
 
  863                   NS_LOG_INFO (
this << 
" layer " << (uint16_t)j << 
" no retx");
 
  867           for (uint16_t k = 0; k < (*itRlcPdu).second.at (0).at (dci.
m_harqProcess).size (); k++)
 
  869               std::vector <struct RlcPduListElement_s> rlcPduListPerLc;
 
  870               for (uint8_t j = 0; j < nLayers; j++)
 
  874                       if (j < dci.
m_ndi.size ())
 
  876                           rlcPduListPerLc.push_back ((*itRlcPdu).second.at (j).at (dci.
m_harqProcess).at (k));
 
  881               if (rlcPduListPerLc.size () > 0)
 
  888           (*itHarq).second.at (harqId).
m_rv = dci.
m_rv;
 
  893               NS_FATAL_ERROR (
"Unable to find HARQ timer for RNTI " << (uint16_t)rnti);
 
  895           (*itHarqTimer).second.at (harqId) = 0;
 
  897           rntiAllocated.insert (rnti);
 
  914           for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++)
 
  924   std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
 
  928   std::map <uint16_t,uint8_t> lcActivesPerRnti; 
 
  929   std::map <uint16_t,uint8_t>::iterator itLcRnti;
 
  933       std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).m_rnti);
 
  934       if ( (((*it).m_rlcTransmissionQueueSize > 0)
 
  935             || ((*it).m_rlcRetransmissionQueueSize > 0)
 
  936             || ((*it).m_rlcStatusPduSize > 0))
 
  937            && (itRnti == rntiAllocated.end ())  
 
  941           NS_LOG_LOGIC (
this << 
" User " << (*it).m_rnti << 
" LC " << (uint16_t)(*it).m_logicalChannelIdentity << 
" is active, status  " << (*it).m_rlcStatusPduSize << 
" retx " << (*it).m_rlcRetransmissionQueueSize << 
" tx " << (*it).m_rlcTransmissionQueueSize);
 
  942           std::map <uint16_t,uint8_t>::iterator itCqi = 
m_p10CqiRxed.find ((*it).m_rnti);
 
  946               cqi = (*itCqi).second;
 
  956               itLcRnti = lcActivesPerRnti.find ((*it).m_rnti);
 
  957               if (itLcRnti != lcActivesPerRnti.end ())
 
  959                   (*itLcRnti).second++;
 
  963                   lcActivesPerRnti.insert (std::pair<uint16_t, uint8_t > ((*it).m_rnti, 1));
 
  982   int rbgPerTb = (nTbs > 0) ? ((rbgNum - rbgAllocatedNum) / nTbs) : INT_MAX;
 
  983   NS_LOG_INFO (
this << 
" Flows to be transmitted " << nflows << 
" rbgPerTb " << rbgPerTb);
 
  988   int rbgAllocated = 0;
 
 1012   std::map <uint16_t,uint8_t>::iterator itTxMode;
 
 1015       itLcRnti = lcActivesPerRnti.find ((*it).m_rnti);
 
 1016       std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).m_rnti);
 
 1017       if ((itLcRnti == lcActivesPerRnti.end ())||(itRnti != rntiAllocated.end ()))
 
 1020           uint16_t rntiDiscared = (*it).m_rnti;
 
 1023               if ((*it).m_rnti != rntiDiscared)
 
 1039           NS_FATAL_ERROR (
"No Transmission Mode info on user " << (*it).m_rnti);
 
 1042       int lcNum = (*itLcRnti).second;
 
 1045       newEl.
m_rnti = (*it).m_rnti;
 
 1048       newDci.
m_rnti = (*it).m_rnti;
 
 1053       for (uint8_t i = 0; i < nLayer; i++)
 
 1057               newDci.
m_mcs.push_back (0); 
 
 1061               newDci.
m_mcs.push_back ( 
m_amc->GetMcsFromCqi ((*itCqi).second) );
 
 1064       int tbSize = (
m_amc->GetTbSizeFromMcs (newDci.
m_mcs.at (0), rbgPerTb * rbgSize) / 8);
 
 1065       uint16_t rlcPduSize = tbSize / lcNum;
 
 1066       while ((*it).m_rnti == newEl.
m_rnti)
 
 1068           if ( ((*it).m_rlcTransmissionQueueSize > 0)
 
 1069                || ((*it).m_rlcRetransmissionQueueSize > 0)
 
 1070                || ((*it).m_rlcStatusPduSize > 0) )
 
 1072               std::vector <struct RlcPduListElement_s> newRlcPduLe;
 
 1073               for (uint8_t j = 0; j < nLayer; j++)
 
 1078                   newRlcEl.
m_size = rlcPduSize;
 
 1080                   newRlcPduLe.push_back (newRlcEl);
 
 1088                           NS_FATAL_ERROR (
"Unable to find RlcPdcList in HARQ buffer for RNTI " << (*it).m_rnti);
 
 1090                       (*itRlcPdu).second.at (j).at (newDci.
m_harqProcess).push_back (newRlcEl);
 
 1105       uint32_t rbgMask = 0;
 
 1107       NS_LOG_INFO (
this << 
" DL - Allocate user " << newEl.
m_rnti << 
" LCs " << (uint16_t)(*itLcRnti).second << 
" bytes " << tbSize << 
" mcs " << (uint16_t) newDci.
m_mcs.at (0) << 
" harqId " << (uint16_t)newDci.
m_harqProcess <<  
" layers " << nLayer);
 
 1109       while (i < rbgPerTb)
 
 1111           if (rbgMap.at (rbgAllocated) == 
false)
 
 1113               rbgMask = rbgMask + (0x1 << rbgAllocated);
 
 1116               rbgMap.at (rbgAllocated) = 
true;
 
 1123       for (
int i = 0; i < nLayer; i++)
 
 1126           newDci.
m_ndi.push_back (1);
 
 1127           newDci.
m_rv.push_back (0);
 
 1129       newEl.
m_dci = newDci;
 
 1150       if (rbgAllocatedNum == rbgNum)
 
 1179   std::map <uint16_t,uint8_t>::iterator it;
 
 1180   for (
unsigned int i = 0; i < params.
m_cqiList.size (); i++)
 
 1185           std::map <uint16_t,uint8_t>::iterator it;
 
 1186           uint16_t rnti = params.
m_cqiList.at (i).m_rnti;
 
 1191               m_p10CqiRxed.insert ( std::pair<uint16_t, uint8_t > (rnti, params.
m_cqiList.at (i).m_wbCqi.at (0)) ); 
 
 1198               (*it).second = params.
m_cqiList.at (i).m_wbCqi.at (0);
 
 1200               std::map <uint16_t,uint32_t>::iterator itTimers;
 
 1228   std::vector <bool> rbMap;
 
 1229   uint16_t rbAllocatedNum = 0;
 
 1230   std::set <uint16_t> rntiAllocated;
 
 1231   std::vector <uint16_t> rbgAllocationMap;
 
 1242       if (rbgAllocationMap.at (i) != 0)
 
 1244           rbMap.at (i) = 
true;
 
 1253       std::map <uint16_t, uint8_t>::iterator itProcId;
 
 1256           (*itProcId).second = ((*itProcId).second + 1) % 
HARQ_PROC_NUM;
 
 1258       for (uint16_t i = 0; i < params.
m_ulInfoList.size (); i++)
 
 1267                   NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
 
 1270               NS_LOG_INFO (
this << 
" UL-HARQ retx RNTI " << rnti << 
" harqId " << (uint16_t)harqId);
 
 1274                   NS_LOG_ERROR (
"No info find in UL-HARQ buffer for UE (might change eNB) " << rnti);
 
 1280                   NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
 
 1282               if ((*itStat).second.at (harqId) > 3)
 
 1284                   NS_LOG_INFO (
"Max number of retransmissions reached (UL)-> drop process");
 
 1290                   if (rbMap.at (j) == 
true)
 
 1301                       rbMap.at (j) = 
true;
 
 1302                       rbgAllocationMap.at (j) = dci.
m_rnti;
 
 1310                   NS_LOG_INFO (
"Cannot allocate retx due to RACH allocations for UE " << rnti);
 
 1315               (*itStat).second.at ((*itProcId).second) = (*itStat).second.at (harqId) + 1;
 
 1316               (*itStat).second.at (harqId) = 0;
 
 1317               (*itHarq).second.at ((*itProcId).second) = dci;
 
 1319               rntiAllocated.insert (dci.
m_rnti);
 
 1324   std::map <uint16_t,uint32_t>::iterator it;
 
 1329       std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
 
 1331       NS_LOG_INFO (
this << 
" UE " << (*it).first << 
" queue " << (*it).second);
 
 1332       if (((*it).second > 0)&&(itRnti == rntiAllocated.end ()))
 
 1354   uint16_t rbAllocated = 0;
 
 1375   NS_LOG_INFO (
this << 
" NFlows " << nflows << 
" RB per Flow " << rbPerFlow);
 
 1378       std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
 
 1379       if ((itRnti != rntiAllocated.end ())||((*it).second == 0))
 
 1401       NS_LOG_INFO (
this << 
" try to allocate " << (*it).first);
 
 1403       uldci.
m_rnti = (*it).first;
 
 1405       bool allocated = 
false;
 
 1406       NS_LOG_INFO (
this << 
" RB Allocated " << rbAllocated << 
" rbPerFlow " << rbPerFlow << 
" flows " << nflows);
 
 1411           for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
 
 1413               if (rbMap.at (j) == 
true)
 
 1423               for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
 
 1425                   rbMap.at (j) = 
true;
 
 1427                   rbgAllocationMap.at (j) = (*it).first;
 
 1430               rbAllocated += rbPerFlow;
 
 1458       std::map <uint16_t, std::vector <double> >::iterator itCqi = 
m_ueCqi.find ((*it).first);
 
 1464           NS_LOG_INFO (
this << 
" UE does not have ULCQI " << (*it).first );
 
 1469           double minSinr = (*itCqi).second.at (uldci.
m_rbStart);
 
 1472               if ((*itCqi).second.at (i) < minSinr)
 
 1474                   minSinr = (*itCqi).second.at (i);
 
 1478           double s = log2 ( 1 + (
 
 1479                                  std::pow (10, minSinr / 10 )  /
 
 1480                                  ( (-std::log (5.0 * 0.00005 )) / 1.5) ));
 
 1483           cqi = 
m_amc->GetCqiFromSpectralEfficiency (s);
 
 1496                   rbgAllocationMap.at (i) = 0;
 
 1522           std::map <uint16_t, uint8_t>::iterator itProcId;
 
 1528           harqId = (*itProcId).second;
 
 1534           (*itDci).second.at (harqId) = uldci;
 
 1536       NS_LOG_INFO (
this << 
" UL Allocation - UE " << (*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 << 
" harqId " << (uint16_t)harqId);
 
 1578   std::map <uint16_t,uint32_t>::iterator it;
 
 1580   for (
unsigned int i = 0; i < params.
m_macCeList.size (); i++)
 
 1591           uint32_t buffer = 0;
 
 1592           for (uint8_t lcg = 0; lcg < 4; ++lcg)
 
 1594               uint8_t bsrId = params.
m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (lcg);
 
 1603               m_ceBsrRxed.insert ( std::pair<uint16_t, uint32_t > (rnti, buffer));
 
 1604               NS_LOG_INFO (
this << 
" Insert RNTI " << rnti << 
" queue " << buffer);
 
 1609               (*it).second = buffer;
 
 1610               NS_LOG_INFO (
this << 
" Update RNTI " << rnti << 
" queue " << buffer);
 
 1652         std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
 
 1653         std::map <uint16_t, std::vector <double> >::iterator itCqi;
 
 1660         for (uint32_t i = 0; i < (*itMap).second.size (); i++)
 
 1664             itCqi = 
m_ueCqi.find ((*itMap).second.at (i));
 
 1668                 std::vector <double> newCqi;
 
 1673                         newCqi.push_back (sinr);
 
 1678                         newCqi.push_back (30.0);
 
 1682                 m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > ((*itMap).second.at (i), newCqi));
 
 1689                 (*itCqi).second.at (i) = sinr;
 
 1691                 std::map <uint16_t, uint32_t>::iterator itTimers;
 
 1712                 rnti = vsp->GetRnti ();
 
 1715         std::map <uint16_t, std::vector <double> >::iterator itCqi;
 
 1720             std::vector <double> newCqi;
 
 1724                 newCqi.push_back (sinr);
 
 1725                 NS_LOG_INFO (
this << 
" RNTI " << rnti << 
" new SRS-CQI for RB  " << j << 
" value " << sinr);
 
 1728             m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > (rnti, newCqi));
 
 1738                 (*itCqi).second.at (j) = sinr;
 
 1739                 NS_LOG_INFO (
this << 
" RNTI " << rnti << 
" update SRS-CQI for RB  " << j << 
" value " << sinr);
 
 1742             std::map <uint16_t, uint32_t>::iterator itTimers;
 
 1755         NS_FATAL_ERROR (
"PfFfMacScheduler supports only PUSCH and SRS UL-CQIs");
 
 1770   std::map <uint16_t,uint32_t>::iterator itP10 = 
m_p10CqiTimers.begin ();
 
 1774       if ((*itP10).second == 0)
 
 1777           std::map <uint16_t,uint8_t>::iterator itMap = 
m_p10CqiRxed.find ((*itP10).first);
 
 1779           NS_LOG_INFO (
this << 
" P10-CQI exired for user " << (*itP10).first);
 
 1781           std::map <uint16_t,uint32_t>::iterator temp = itP10;
 
 1800   std::map <uint16_t,uint32_t>::iterator itUl = 
m_ueCqiTimers.begin ();
 
 1804       if ((*itUl).second == 0)
 
 1807           std::map <uint16_t, std::vector <double> >::iterator itMap = 
m_ueCqi.find ((*itUl).first);
 
 1808           NS_ASSERT_MSG (itMap != 
m_ueCqi.end (), 
" Does not find CQI report for user " << (*itUl).first);
 
 1809           NS_LOG_INFO (
this << 
" UL-CQI exired for user " << (*itUl).first);
 
 1810           (*itMap).second.clear ();
 
 1812           std::map <uint16_t,uint32_t>::iterator temp = itUl;
 
 1830   std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
 
 1833       if (((*it).m_rnti == rnti) && ((*it).m_logicalChannelIdentity == lcid))
 
 1835           NS_LOG_INFO (
this << 
" UE " << rnti << 
" LC " << (uint16_t)lcid << 
" txqueue " << (*it).m_rlcTransmissionQueueSize << 
" retxqueue " << (*it).m_rlcRetransmissionQueueSize << 
" status " << (*it).m_rlcStatusPduSize << 
" decrease " << size);
 
 1838            if (((*it).m_rlcStatusPduSize > 0) && (size >= (*it).m_rlcStatusPduSize))
 
 1840                 (*it).m_rlcStatusPduSize = 0;
 
 1842             else if (((*it).m_rlcRetransmissionQueueSize > 0) && (size >= (*it).m_rlcRetransmissionQueueSize))
 
 1844                 (*it).m_rlcRetransmissionQueueSize = 0;
 
 1846             else if ((*it).m_rlcTransmissionQueueSize > 0)
 
 1848                 uint32_t rlcOverhead;
 
 1863                 if ((*it).m_rlcTransmissionQueueSize <= size - rlcOverhead)
 
 1865                     (*it).m_rlcTransmissionQueueSize = 0;
 
 1869                     (*it).m_rlcTransmissionQueueSize -= size - rlcOverhead;
 
 1882   std::map <uint16_t,uint32_t>::iterator it = 
m_ceBsrRxed.find (rnti);
 
 1885       NS_LOG_INFO (
this << 
" Update RLC BSR UE " << rnti << 
" size " << size << 
" BSR " << (*it).second);
 
 1886       if ((*it).second >= size)
 
 1888           (*it).second -= size;
 
 1897       NS_LOG_ERROR (
this << 
" Does not find BSR report info of UE " << rnti);
 
 1906   NS_LOG_FUNCTION (
this << 
" RNTI " << rnti << 
" txMode " << (uint16_t)txMode);
 
std::vector< struct UlInfoListElement_s > m_ulInfoList
 
See section 4.3.1 dlDciListElement. 
 
void RefreshUlCqiMaps(void)
 
virtual void SchedUlMacCtrlInfoReq(const struct SchedUlMacCtrlInfoReqParameters ¶ms)
 
friend class RrSchedulerMemberCschedSapProvider
 
smart pointer class similar to boost::intrusive_ptr 
 
#define NS_LOG_FUNCTION(parameters)
 
virtual FfMacSchedSapProvider * GetFfMacSchedSapProvider()
 
std::map< uint16_t, uint32_t > m_ueCqiTimers
 
virtual void SchedDlPagingBufferReq(const struct SchedDlPagingBufferReqParameters ¶ms)
 
static TypeId GetTypeId(void)
 
enum ns3::UlCqi_s::Type_e m_type
 
std::vector< UlDciListElement_s > UlHarqProcessesDciBuffer_t
 
std::vector< uint16_t > m_sinr
 
void RefreshDlCqiMaps(void)
 
std::vector< uint8_t > DlHarqProcessesTimer_t
 
#define NS_ASSERT(condition)
 
void DoCschedCellConfigReq(const struct FfMacCschedSapProvider::CschedCellConfigReqParameters ¶ms)
 
std::vector< uint8_t > m_mcs
 
virtual void SchedDlCqiInfoReq(const struct SchedDlCqiInfoReqParameters ¶ms)
 
See section 4.3.2 ulDciListElement. 
 
static bool SortRlcBufferReq(FfMacSchedSapProvider::SchedDlRlcBufferReqParameters i, FfMacSchedSapProvider::SchedDlRlcBufferReqParameters j)
 
virtual void SetFfMacSchedSapUser(FfMacSchedSapUser *s)
 
std::vector< struct UlDciListElement_s > m_dciList
 
See section 4.3.10 buildRARListElement. 
 
virtual void SchedUlCqiInfoReq(const struct SchedUlCqiInfoReqParameters ¶ms)
 
FfMacCschedSapProvider * m_cschedSapProvider
 
void DoCschedLcConfigReq(const struct FfMacCschedSapProvider::CschedLcConfigReqParameters ¶ms)
 
void DoCschedUeConfigReq(const struct FfMacCschedSapProvider::CschedUeConfigReqParameters ¶ms)
 
uint32_t m_rlcRetransmissionQueueSize
 
void DoSchedDlRachInfoReq(const struct FfMacSchedSapProvider::SchedDlRachInfoReqParameters ¶ms)
 
std::vector< std::vector< struct RlcPduListElement_s > > m_rlcPduList
 
uint8_t m_transmissionMode
 
FfMacSchedSapUser * m_schedSapUser
 
uint8_t m_logicalChannelIdentity
 
virtual ~RrFfMacScheduler()
 
friend class RrSchedulerMemberSchedSapProvider
 
#define NS_FATAL_ERROR(msg)
fatal error handling 
 
uint8_t UpdateHarqProcessId(uint16_t rnti)
Update and return a new process Id for the RNTI specified. 
 
void DoSchedDlPagingBufferReq(const struct FfMacSchedSapProvider::SchedDlPagingBufferReqParameters ¶ms)
 
RrFfMacScheduler * m_scheduler
 
std::map< uint16_t, uint8_t > m_ulHarqCurrentProcessId
 
std::map< uint16_t, DlHarqRlcPduListBuffer_t > m_dlHarqProcessesRlcPduListBuffer
 
std::vector< RlcPduList_t > DlHarqRlcPduListBuffer_t
 
NS_LOG_COMPONENT_DEFINE("RrFfMacScheduler")
 
virtual void CschedUeReleaseReq(const struct CschedUeReleaseReqParameters ¶ms)
 
std::map< uint16_t, uint8_t > m_p10CqiRxed
 
virtual void CschedUeConfigUpdateInd(const struct CschedUeConfigUpdateIndParameters ¶ms)=0
 
std::vector< struct VendorSpecificListElement_s > m_vendorSpecificList
 
FfMacCschedSapProvider::CschedCellConfigReqParameters m_cschedCellConfig
 
RrSchedulerMemberSchedSapProvider()
 
Hold an unsigned integer type. 
 
std::map< uint16_t, DlHarqProcessesStatus_t > m_dlHarqProcessesStatus
 
static uint8_t TxMode2LayerNum(uint8_t txMode)
 
NS_OBJECT_ENSURE_REGISTERED(AntennaModel)
 
std::vector< uint8_t > m_ndi
 
virtual void SetFfMacCschedSapUser(FfMacCschedSapUser *s)
 
std::map< uint16_t, std::vector< uint16_t > > m_allocationMaps
 
FfMacCschedSapUser * m_cschedSapUser
 
void DoSchedDlRlcBufferReq(const struct FfMacSchedSapProvider::SchedDlRlcBufferReqParameters ¶ms)
 
std::map< uint16_t, UlHarqProcessesDciBuffer_t > m_ulHarqProcessesDciBuffer
 
std::map< uint16_t, uint32_t > m_p10CqiTimers
 
uint8_t HarqProcessAvailability(uint16_t rnti)
Return the availability of free process for the RNTI specified. 
 
void DoSchedUlCqiInfoReq(const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ¶ms)
 
virtual void CschedUeConfigCnf(const struct CschedUeConfigCnfParameters ¶ms)=0
 
std::vector< uint8_t > m_logicalChannelIdentity
 
#define NS_LOG_LOGIC(msg)
 
uint8_t m_logicalChannelIdentity
 
std::vector< struct CqiListElement_s > m_cqiList
 
std::vector< struct DlInfoListElement_s > m_dlInfoList
 
void RefreshHarqProcesses()
Refresh HARQ processes according to the timers. 
 
void DoSchedUlSrInfoReq(const struct FfMacSchedSapProvider::SchedUlSrInfoReqParameters ¶ms)
 
virtual void SchedDlConfigInd(const struct SchedDlConfigIndParameters ¶ms)=0
 
void UpdateUlRlcBufferInfo(uint16_t rnti, uint16_t size)
 
int8_t m_pdcchPowerOffset
 
void DoSchedUlMacCtrlInfoReq(const struct FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters ¶ms)
 
std::vector< uint16_t > m_tbsSize
 
See section 4.3.9 rlcPDU_ListElement. 
 
RrFfMacScheduler * m_scheduler
 
int GetRbgSize(int dlbandwidth)
 
std::list< FfMacSchedSapProvider::SchedDlRlcBufferReqParameters > m_rlcBufferReq
 
virtual void SchedUlNoiseInterferenceReq(const struct SchedUlNoiseInterferenceReqParameters ¶ms)
 
virtual void CschedUeConfigReq(const struct CschedUeConfigReqParameters ¶ms)
 
std::map< uint16_t, std::vector< double > > m_ueCqi
 
std::vector< DlDciListElement_s > DlHarqProcessesDciBuffer_t
 
virtual void SchedDlRlcBufferReq(const struct SchedDlRlcBufferReqParameters ¶ms)
 
void DoSchedUlNoiseInterferenceReq(const struct FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters ¶ms)
 
std::vector< uint8_t > m_rv
 
virtual void SchedUlConfigInd(const struct SchedUlConfigIndParameters ¶ms)=0
 
std::map< uint16_t, UlHarqProcessesStatus_t > m_ulHarqProcessesStatus
 
virtual void SchedDlTriggerReq(const struct SchedDlTriggerReqParameters ¶ms)
 
UlCqiFilter_t m_ulCqiFilter
 
void DoCschedLcReleaseReq(const struct FfMacCschedSapProvider::CschedLcReleaseReqParameters ¶ms)
 
virtual FfMacCschedSapProvider * GetFfMacCschedSapProvider()
 
#define NS_ASSERT_MSG(condition, message)
 
uint8_t m_nrOfPdcchOfdmSymbols
 
std::vector< struct MacCeListElement_s > m_macCeList
 
std::vector< struct RachListElement_s > m_rachList
 
static double fpS11dot3toDouble(uint16_t val)
 
virtual void SchedUlSrInfoReq(const struct SchedUlSrInfoReqParameters ¶ms)
 
FfMacSchedSapProvider * m_schedSapProvider
 
Implements the SCHED SAP and CSCHED SAP for a Round Robin scheduler. 
 
std::vector< uint8_t > UlHarqProcessesStatus_t
 
RrFfMacScheduler()
Constructor. 
 
std::vector< uint8_t > DlHarqProcessesStatus_t
 
virtual void SchedDlMacBufferReq(const struct SchedDlMacBufferReqParameters ¶ms)
 
static uint32_t BsrId2BufferSize(uint8_t val)
 
virtual void CschedLcReleaseReq(const struct CschedLcReleaseReqParameters ¶ms)
 
std::map< uint16_t, DlHarqProcessesDciBuffer_t > m_dlHarqProcessesDciBuffer
 
uint8_t m_transmissionMode
 
std::vector< struct RachListElement_s > m_rachList
 
void UpdateDlRlcBufferInfo(uint16_t rnti, uint8_t lcid, uint16_t size)
 
std::map< uint16_t, DlHarqProcessesTimer_t > m_dlHarqProcessesTimer
 
std::map< uint16_t, uint8_t > m_dlHarqCurrentProcessId
 
int Type0AllocationRbg[4]
 
RrSchedulerMemberCschedSapProvider()
 
#define NS_LOG_DEBUG(msg)
 
void DoSchedDlTriggerReq(const struct FfMacSchedSapProvider::SchedDlTriggerReqParameters ¶ms)
 
void DoCschedUeReleaseReq(const struct FfMacCschedSapProvider::CschedUeReleaseReqParameters ¶ms)
 
uint32_t m_cqiTimersThreshold
 
virtual void SchedUlTriggerReq(const struct SchedUlTriggerReqParameters ¶ms)
 
uint16_t m_rlcStatusPduSize
 
void DoSchedDlCqiInfoReq(const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters ¶ms)
 
#define NS_LOG_ERROR(msg)
 
void TransmissionModeConfigurationUpdate(uint16_t rnti, uint8_t txMode)
 
void DoSchedDlMacBufferReq(const struct FfMacSchedSapProvider::SchedDlMacBufferReqParameters ¶ms)
 
uint16_t m_rlcTransmissionQueueHolDelay
 
virtual void DoDispose(void)
 
std::vector< DlInfoListElement_s > m_dlInfoListBuffered
 
std::map< uint16_t, uint32_t > m_ceBsrRxed
 
struct DlDciListElement_s m_dci
 
std::vector< struct BuildRarListElement_s > m_buildRarList
 
std::vector< uint16_t > m_rachAllocationMap
 
virtual void SchedDlRachInfoReq(const struct SchedDlRachInfoReqParameters ¶ms)
 
a unique identifier for an interface. 
 
TypeId SetParent(TypeId tid)
 
virtual void CschedLcConfigReq(const struct CschedLcConfigReqParameters ¶ms)
 
std::map< uint16_t, uint8_t > m_uesTxMode
 
virtual void CschedCellConfigReq(const struct CschedCellConfigReqParameters ¶ms)
CSCHED_CELL_CONFIG_REQ. 
 
std::vector< struct BuildDataListElement_s > m_buildDataList
 
void DoSchedUlTriggerReq(const struct FfMacSchedSapProvider::SchedUlTriggerReqParameters ¶ms)
 
uint8_t m_ueTxAntennaSelection
 
See section 4.3.8 builDataListElement.