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> ();
 
  256     .AddAttribute (
"CqiTimerThreshold",
 
  257                    "The number of TTIs a CQI is valid (default 1000 - 1 sec.)",
 
  260                    MakeUintegerChecker<uint32_t> ())
 
  261     .AddAttribute (
"HarqEnabled",
 
  262                    "Activate/Deactivate the HARQ [by default is active].",
 
  266     .AddAttribute (
"UlGrantMcs",
 
  267                    "The MCS of the UL grant, must be [0..15] (default 0)",
 
  270                    MakeUintegerChecker<uint8_t> ())
 
  337       dlHarqPrcStatus.resize (8,0);
 
  340       dlHarqProcessesTimer.resize (8,0);
 
  343       dlHarqdci.resize (8);
 
  346       dlHarqRlcPdu.resize (2);
 
  347       dlHarqRlcPdu.at (0).resize (8);
 
  348       dlHarqRlcPdu.at (1).resize (8);
 
  352       ulHarqPrcStatus.resize (8,0);
 
  355       ulHarqdci.resize (8);
 
  379      std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it = 
m_rlcBufferReq.begin ();
 
  410   std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it = 
m_rlcBufferReq.begin ();
 
  413       if ((*it).m_rnti == params.
m_rnti)
 
  415           NS_LOG_INFO (
this << 
" Erase RNTI " << (*it).m_rnti << 
" LC " << (uint16_t)(*it).m_logicalChannelIdentity);
 
  442   std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it = 
m_rlcBufferReq.begin ();
 
  490   for (
int i = 0; i < 4; i++)
 
  492       if (dlbandwidth < Type0AllocationRbg[i])
 
  521       NS_FATAL_ERROR (
"No Process Id Statusfound for this RNTI " << rnti);
 
  523   uint8_t i = (*it).second;
 
  528   while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
 
  529   if ((*itStat).second.at (i) == 0)
 
  560       NS_FATAL_ERROR (
"No Process Id Statusfound for this RNTI " << rnti);
 
  562   uint8_t i = (*it).second;
 
  567   while ( ((*itStat).second.at (i) != 0)&&(i != (*it).second));
 
  568   if ((*itStat).second.at (i) == 0)
 
  571       (*itStat).second.at (i) = 1;
 
  578   return ((*it).second);
 
  587   std::map <uint16_t, DlHarqProcessesTimer_t>::iterator itTimers;
 
  596               NS_LOG_INFO (
this << 
" Reset HARQ proc " << i << 
" for RNTI " << (*itTimers).first);
 
  597               std::map <uint16_t, DlHarqProcessesStatus_t>::iterator itStat = 
m_dlHarqProcessesStatus.find ((*itTimers).first);
 
  600                   NS_FATAL_ERROR (
"No Process Id Status found for this RNTI " << (*itTimers).first);
 
  602               (*itStat).second.at (i) = 0;
 
  603               (*itTimers).second.at (i) = 0;
 
  607               (*itTimers).second.at (i)++;
 
  628   std::vector <bool> rbgMap;
 
  629   uint16_t rbgAllocatedNum = 0;
 
  630   std::set <uint16_t> rntiAllocated;
 
  634   std::map <uint16_t, uint8_t>::iterator itProcId;
 
  637       (*itProcId).second = ((*itProcId).second + 1) % 
HARQ_PROC_NUM;
 
  642   uint16_t rbStart = 0;
 
  643   std::vector <struct RachListElement_s>::iterator itRach;
 
  648       newRar.
m_rnti = (*itRach).m_rnti;
 
  652       newRar.m_grant.m_rnti = newRar.m_rnti;
 
  655       uint16_t tbSizeBits = 0;
 
  662       if (tbSizeBits < (*itRach).m_estimatedSize)
 
  667       newRar.m_grant.m_rbStart = rbStart;
 
  668       newRar.m_grant.m_rbLen = rbLen;
 
  669       newRar.m_grant.m_tbSize = tbSizeBits / 8;
 
  670       newRar.m_grant.m_hopping = 
false;
 
  671       newRar.m_grant.m_tpc = 0;
 
  672       newRar.m_grant.m_cqiRequest = 
false;
 
  673       newRar.m_grant.m_ulDelay = 
false;
 
  674       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);
 
  675       for (uint16_t i = rbStart; i < rbStart + rbLen; i++)
 
  684           uldci.
m_rnti = newRar.m_rnti;
 
  703           std::map <uint16_t, uint8_t>::iterator itProcId;
 
  709           harqId = (*itProcId).second;
 
  715           (*itDci).second.at (harqId) = uldci;
 
  718       rbStart = rbStart + rbLen;
 
  730           NS_LOG_INFO (
this << 
" Received DL-HARQ feedback");
 
  746   std::vector <struct DlInfoListElement_s> dlInfoListUntxed;
 
  750       if (itRnti != rntiAllocated.end ())
 
  756       std::vector <bool> retx;
 
  757       NS_LOG_INFO (
this << 
" Processing DLHARQ feedback");
 
  761           retx.push_back (
false);
 
  768       if (retx.at (0) || retx.at (1))
 
  773           NS_LOG_INFO (
this << 
" HARQ retx RNTI " << rnti << 
" harqId " << (uint16_t)harqId);
 
  782           if (dci.
m_rv.size () == 1)
 
  784               rv = dci.
m_rv.at (0);
 
  788               rv = (dci.
m_rv.at (0) > dci.
m_rv.at (1) ? dci.
m_rv.at (0) : dci.
m_rv.at (1));
 
  794               NS_LOG_INFO (
"Max number of retransmissions reached -> drop process");
 
  800               (*it).second.at (harqId) = 0;
 
  806               for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++)
 
  808                   (*itRlcPdu).second.at (k).at (harqId).clear ();
 
  814           std::vector <int> dciRbg;
 
  817           for (
int j = 0; j < 32; j++)
 
  821                   dciRbg.push_back (j);
 
  827           for (uint8_t j = 0; j < dciRbg.size (); j++)
 
  829               if (rbgMap.at (dciRbg.at (j)) == 
true)
 
  839               for (uint8_t j = 0; j < dciRbg.size (); j++)
 
  841                   rbgMap.at (dciRbg.at (j)) = 
true;
 
  842                   NS_LOG_INFO (
"RBG " << dciRbg.at (j) << 
" assigned");
 
  846               NS_LOG_INFO (
this << 
" Send retx in the same RBGs");
 
  852               uint8_t rbgId = (dciRbg.at (dciRbg.size () - 1) + 1) % rbgNum;
 
  853               uint8_t startRbg = dciRbg.at (dciRbg.size () - 1);
 
  854               std::vector <bool> rbgMapCopy = rbgMap;
 
  855               while ((j < dciRbg.size ())&&(startRbg != rbgId))
 
  857                   if (rbgMapCopy.at (rbgId) == 
false)
 
  859                       rbgMapCopy.at (rbgId) = 
true;
 
  860                       dciRbg.at (j) = rbgId;
 
  863                   rbgId = (rbgId + 1) % rbgNum;
 
  865               if (j == dciRbg.size ())
 
  868                   uint32_t rbgMask = 0;
 
  869                   for (uint16_t k = 0; k < dciRbg.size (); k++)
 
  871                       rbgMask = rbgMask + (0x1 << dciRbg.at (k));
 
  872                       NS_LOG_INFO (
this << 
" New allocated RBG " << dciRbg.at (k));
 
  882                   NS_LOG_INFO (
this << 
" No resource for this retx -> buffer it");
 
  890               NS_FATAL_ERROR (
"Unable to find RlcPdcList in HARQ buffer for RNTI " << rnti);
 
  892           for (uint8_t j = 0; j < nLayers; j++)
 
  896                   if (j >= dci.
m_ndi.size ())
 
  899                       dci.
m_ndi.push_back (0);
 
  900                       dci.
m_rv.push_back (0);
 
  901                       dci.
m_mcs.push_back (0);
 
  903                       NS_LOG_INFO (
this << 
" layer " << (uint16_t)j << 
" no txed (MIMO transition)");
 
  908                       dci.
m_ndi.at (j) = 0;
 
  910                       (*itHarq).second.at (harqId).m_rv.at (j)++;
 
  911                       NS_LOG_INFO (
this << 
" layer " << (uint16_t)j << 
" RV " << (uint16_t)dci.
m_rv.at (j));
 
  917                   dci.
m_ndi.at (j) = 0;
 
  919                   dci.
m_mcs.at (j) = 0;
 
  921                   NS_LOG_INFO (
this << 
" layer " << (uint16_t)j << 
" no retx");
 
  925           for (uint16_t k = 0; k < (*itRlcPdu).second.at (0).at (dci.
m_harqProcess).size (); k++)
 
  927               std::vector <struct RlcPduListElement_s> rlcPduListPerLc;
 
  928               for (uint8_t j = 0; j < nLayers; j++)
 
  932                       if (j < dci.
m_ndi.size ())
 
  934                           rlcPduListPerLc.push_back ((*itRlcPdu).second.at (j).at (dci.
m_harqProcess).at (k));
 
  939               if (rlcPduListPerLc.size () > 0)
 
  946           (*itHarq).second.at (harqId).
m_rv = dci.
m_rv;
 
  951               NS_FATAL_ERROR (
"Unable to find HARQ timer for RNTI " << (uint16_t)rnti);
 
  953           (*itHarqTimer).second.at (harqId) = 0;
 
  955           rntiAllocated.insert (rnti);
 
  972           for (uint16_t k = 0; k < (*itRlcPdu).second.size (); k++)
 
  981   if (rbgAllocatedNum == rbgNum)
 
  992   std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
 
  996   std::map <uint16_t,uint8_t> lcActivesPerRnti; 
 
  997   std::map <uint16_t,uint8_t>::iterator itLcRnti;
 
 1001       std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).m_rnti);
 
 1002       if ( (((*it).m_rlcTransmissionQueueSize > 0)
 
 1003             || ((*it).m_rlcRetransmissionQueueSize > 0)
 
 1004             || ((*it).m_rlcStatusPduSize > 0))
 
 1005            && (itRnti == rntiAllocated.end ())  
 
 1009           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);
 
 1010           std::map <uint16_t,uint8_t>::iterator itCqi = 
m_p10CqiRxed.find ((*it).m_rnti);
 
 1014               cqi = (*itCqi).second;
 
 1024               itLcRnti = lcActivesPerRnti.find ((*it).m_rnti);
 
 1025               if (itLcRnti != lcActivesPerRnti.end ())
 
 1027                   (*itLcRnti).second++;
 
 1031                   lcActivesPerRnti.insert (std::pair<uint16_t, uint8_t > ((*it).m_rnti, 1));
 
 1050   int rbgPerTb = (nTbs > 0) ? ((rbgNum - rbgAllocatedNum) / nTbs) : INT_MAX;
 
 1051   NS_LOG_INFO (
this << 
" Flows to be transmitted " << nflows << 
" rbgPerTb " << rbgPerTb);
 
 1056   int rbgAllocated = 0;
 
 1080   std::map <uint16_t,uint8_t>::iterator itTxMode;
 
 1083       itLcRnti = lcActivesPerRnti.find ((*it).m_rnti);
 
 1084       std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).m_rnti);
 
 1085       if ((itLcRnti == lcActivesPerRnti.end ())||(itRnti != rntiAllocated.end ()))
 
 1088           uint16_t rntiDiscared = (*it).m_rnti;
 
 1091               if ((*it).m_rnti != rntiDiscared)
 
 1107           NS_FATAL_ERROR (
"No Transmission Mode info on user " << (*it).m_rnti);
 
 1110       int lcNum = (*itLcRnti).second;
 
 1113       newEl.
m_rnti = (*it).m_rnti;
 
 1116       newDci.
m_rnti = (*it).m_rnti;
 
 1121       for (uint8_t i = 0; i < nLayer; i++)
 
 1125               newDci.
m_mcs.push_back (0); 
 
 1129               newDci.
m_mcs.push_back ( 
m_amc->GetMcsFromCqi ((*itCqi).second) );
 
 1132       int tbSize = (
m_amc->GetTbSizeFromMcs (newDci.
m_mcs.at (0), rbgPerTb * rbgSize) / 8);
 
 1133       uint16_t rlcPduSize = tbSize / lcNum;
 
 1134       while ((*it).m_rnti == newEl.
m_rnti)
 
 1136           if ( ((*it).m_rlcTransmissionQueueSize > 0)
 
 1137                || ((*it).m_rlcRetransmissionQueueSize > 0)
 
 1138                || ((*it).m_rlcStatusPduSize > 0) )
 
 1140               std::vector <struct RlcPduListElement_s> newRlcPduLe;
 
 1141               for (uint8_t j = 0; j < nLayer; j++)
 
 1146                   newRlcEl.
m_size = rlcPduSize;
 
 1148                   newRlcPduLe.push_back (newRlcEl);
 
 1156                           NS_FATAL_ERROR (
"Unable to find RlcPdcList in HARQ buffer for RNTI " << (*it).m_rnti);
 
 1158                       (*itRlcPdu).second.at (j).at (newDci.
m_harqProcess).push_back (newRlcEl);
 
 1173       uint32_t rbgMask = 0;
 
 1175       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);
 
 1177       while (i < rbgPerTb)
 
 1179           if (rbgMap.at (rbgAllocated) == 
false)
 
 1181               rbgMask = rbgMask + (0x1 << rbgAllocated);
 
 1184               rbgMap.at (rbgAllocated) = 
true;
 
 1191       for (
int i = 0; i < nLayer; i++)
 
 1194           newDci.
m_ndi.push_back (1);
 
 1195           newDci.
m_rv.push_back (0);
 
 1200       newEl.
m_dci = newDci;
 
 1221       if (rbgAllocatedNum == rbgNum)
 
 1250   std::map <uint16_t,uint8_t>::iterator it;
 
 1251   for (
unsigned int i = 0; i < params.
m_cqiList.size (); i++)
 
 1256           std::map <uint16_t,uint8_t>::iterator it;
 
 1257           uint16_t rnti = params.
m_cqiList.at (i).m_rnti;
 
 1262               m_p10CqiRxed.insert ( std::pair<uint16_t, uint8_t > (rnti, params.
m_cqiList.at (i).m_wbCqi.at (0)) ); 
 
 1269               (*it).second = params.
m_cqiList.at (i).m_wbCqi.at (0);
 
 1271               std::map <uint16_t,uint32_t>::iterator itTimers;
 
 1299   std::vector <bool> rbMap;
 
 1300   uint16_t rbAllocatedNum = 0;
 
 1301   std::set <uint16_t> rntiAllocated;
 
 1302   std::vector <uint16_t> rbgAllocationMap;
 
 1313       if (rbgAllocationMap.at (i) != 0)
 
 1315           rbMap.at (i) = 
true;
 
 1323       for (uint16_t i = 0; i < params.
m_ulInfoList.size (); i++)
 
 1332                   NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
 
 1335               NS_LOG_INFO (
this << 
" UL-HARQ retx RNTI " << rnti << 
" harqId " << (uint16_t)harqId);
 
 1339                   NS_LOG_ERROR (
"No info find in UL-HARQ buffer for UE (might change eNB) " << rnti);
 
 1345                   NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
 
 1347               if ((*itStat).second.at (harqId) > 3)
 
 1349                   NS_LOG_INFO (
"Max number of retransmissions reached (UL)-> drop process");
 
 1355                   if (rbMap.at (j) == 
true)
 
 1366                       rbMap.at (j) = 
true;
 
 1367                       rbgAllocationMap.at (j) = dci.
m_rnti;
 
 1375                   NS_LOG_INFO (
"Cannot allocate retx due to RACH allocations for UE " << rnti);
 
 1380               (*itStat).second.at ((*itProcId).second) = (*itStat).second.at (harqId) + 1;
 
 1381               (*itStat).second.at (harqId) = 0;
 
 1382               (*itHarq).second.at ((*itProcId).second) = dci;
 
 1384               rntiAllocated.insert (dci.
m_rnti);
 
 1389   std::map <uint16_t,uint32_t>::iterator it;
 
 1394       std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
 
 1396       NS_LOG_INFO (
this << 
" UE " << (*it).first << 
" queue " << (*it).second);
 
 1397       if (((*it).second > 0)&&(itRnti == rntiAllocated.end ()))
 
 1420   uint16_t rbAllocated = 0;
 
 1441   NS_LOG_INFO (
this << 
" NFlows " << nflows << 
" RB per Flow " << rbPerFlow);
 
 1444       std::set <uint16_t>::iterator itRnti = rntiAllocated.find ((*it).first);
 
 1445       if ((itRnti != rntiAllocated.end ())||((*it).second == 0))
 
 1467       NS_LOG_INFO (
this << 
" try to allocate " << (*it).first);
 
 1469       uldci.
m_rnti = (*it).first;
 
 1471       bool allocated = 
false;
 
 1472       NS_LOG_INFO (
this << 
" RB Allocated " << rbAllocated << 
" rbPerFlow " << rbPerFlow << 
" flows " << nflows);
 
 1477           for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
 
 1479               if (rbMap.at (j) == 
true)
 
 1489               for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
 
 1491                   rbMap.at (j) = 
true;
 
 1493                   rbgAllocationMap.at (j) = (*it).first;
 
 1496               rbAllocated += rbPerFlow;
 
 1524       std::map <uint16_t, std::vector <double> >::iterator itCqi = 
m_ueCqi.find ((*it).first);
 
 1530           NS_LOG_INFO (
this << 
" UE does not have ULCQI " << (*it).first );
 
 1535           double minSinr = (*itCqi).second.at (uldci.
m_rbStart);
 
 1538               if ((*itCqi).second.at (i) < minSinr)
 
 1540                   minSinr = (*itCqi).second.at (i);
 
 1544           double s = log2 ( 1 + (
 
 1545                                  std::pow (10, minSinr / 10 )  /
 
 1546                                  ( (-std::log (5.0 * 0.00005 )) / 1.5) ));
 
 1549           cqi = 
m_amc->GetCqiFromSpectralEfficiency (s);
 
 1562                   rbgAllocationMap.at (i) = 0;
 
 1588           std::map <uint16_t, uint8_t>::iterator itProcId;
 
 1594           harqId = (*itProcId).second;
 
 1600           (*itDci).second.at (harqId) = uldci;
 
 1605               NS_LOG_ERROR (
"No info find in HARQ buffer for UE (might change eNB) " << uldci.
m_rnti);
 
 1607           (*itStat).second.at (harqId) = 0;
 
 1610       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);
 
 1652   std::map <uint16_t,uint32_t>::iterator it;
 
 1654   for (
unsigned int i = 0; i < params.
m_macCeList.size (); i++)
 
 1665           uint32_t buffer = 0;
 
 1666           for (uint8_t lcg = 0; lcg < 4; ++lcg)
 
 1668               uint8_t bsrId = params.
m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (lcg);
 
 1677               m_ceBsrRxed.insert ( std::pair<uint16_t, uint32_t > (rnti, buffer));
 
 1678               NS_LOG_INFO (
this << 
" Insert RNTI " << rnti << 
" queue " << buffer);
 
 1683               (*it).second = buffer;
 
 1684               NS_LOG_INFO (
this << 
" Update RNTI " << rnti << 
" queue " << buffer);
 
 1726         std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
 
 1727         std::map <uint16_t, std::vector <double> >::iterator itCqi;
 
 1734         for (uint32_t i = 0; i < (*itMap).second.size (); i++)
 
 1738             itCqi = 
m_ueCqi.find ((*itMap).second.at (i));
 
 1742                 std::vector <double> newCqi;
 
 1747                         newCqi.push_back (sinr);
 
 1752                         newCqi.push_back (30.0);
 
 1756                 m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > ((*itMap).second.at (i), newCqi));
 
 1763                 (*itCqi).second.at (i) = sinr;
 
 1765                 std::map <uint16_t, uint32_t>::iterator itTimers;
 
 1786                 rnti = vsp->GetRnti ();
 
 1789         std::map <uint16_t, std::vector <double> >::iterator itCqi;
 
 1794             std::vector <double> newCqi;
 
 1798                 newCqi.push_back (sinr);
 
 1799                 NS_LOG_INFO (
this << 
" RNTI " << rnti << 
" new SRS-CQI for RB  " << j << 
" value " << sinr);
 
 1802             m_ueCqi.insert (std::pair <uint16_t, std::vector <double> > (rnti, newCqi));
 
 1812                 (*itCqi).second.at (j) = sinr;
 
 1813                 NS_LOG_INFO (
this << 
" RNTI " << rnti << 
" update SRS-CQI for RB  " << j << 
" value " << sinr);
 
 1816             std::map <uint16_t, uint32_t>::iterator itTimers;
 
 1829         NS_FATAL_ERROR (
"PfFfMacScheduler supports only PUSCH and SRS UL-CQIs");
 
 1844   std::map <uint16_t,uint32_t>::iterator itP10 = 
m_p10CqiTimers.begin ();
 
 1848       if ((*itP10).second == 0)
 
 1851           std::map <uint16_t,uint8_t>::iterator itMap = 
m_p10CqiRxed.find ((*itP10).first);
 
 1853           NS_LOG_INFO (
this << 
" P10-CQI exired for user " << (*itP10).first);
 
 1855           std::map <uint16_t,uint32_t>::iterator temp = itP10;
 
 1874   std::map <uint16_t,uint32_t>::iterator itUl = 
m_ueCqiTimers.begin ();
 
 1878       if ((*itUl).second == 0)
 
 1881           std::map <uint16_t, std::vector <double> >::iterator itMap = 
m_ueCqi.find ((*itUl).first);
 
 1882           NS_ASSERT_MSG (itMap != 
m_ueCqi.end (), 
" Does not find CQI report for user " << (*itUl).first);
 
 1883           NS_LOG_INFO (
this << 
" UL-CQI exired for user " << (*itUl).first);
 
 1884           (*itMap).second.clear ();
 
 1886           std::map <uint16_t,uint32_t>::iterator temp = itUl;
 
 1904   std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
 
 1907       if (((*it).m_rnti == rnti) && ((*it).m_logicalChannelIdentity == lcid))
 
 1909           NS_LOG_INFO (
this << 
" UE " << rnti << 
" LC " << (uint16_t)lcid << 
" txqueue " << (*it).m_rlcTransmissionQueueSize << 
" retxqueue " << (*it).m_rlcRetransmissionQueueSize << 
" status " << (*it).m_rlcStatusPduSize << 
" decrease " << size);
 
 1912            if (((*it).m_rlcStatusPduSize > 0) && (size >= (*it).m_rlcStatusPduSize))
 
 1914                 (*it).m_rlcStatusPduSize = 0;
 
 1916             else if (((*it).m_rlcRetransmissionQueueSize > 0) && (size >= (*it).m_rlcRetransmissionQueueSize))
 
 1918                 (*it).m_rlcRetransmissionQueueSize = 0;
 
 1920             else if ((*it).m_rlcTransmissionQueueSize > 0)
 
 1922                 uint32_t rlcOverhead;
 
 1937                 if ((*it).m_rlcTransmissionQueueSize <= size - rlcOverhead)
 
 1939                     (*it).m_rlcTransmissionQueueSize = 0;
 
 1943                     (*it).m_rlcTransmissionQueueSize -= size - rlcOverhead;
 
 1956   std::map <uint16_t,uint32_t>::iterator it = 
m_ceBsrRxed.find (rnti);
 
 1959       NS_LOG_INFO (
this << 
" Update RLC BSR UE " << rnti << 
" size " << size << 
" BSR " << (*it).second);
 
 1960       if ((*it).second >= size)
 
 1962           (*it).second -= size;
 
 1971       NS_LOG_ERROR (
this << 
" Does not find BSR report info of UE " << rnti);
 
 1980   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. 
 
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
 
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
 
AttributeValue implementation for Boolean. 
 
virtual FfMacSchedSapProvider * GetFfMacSchedSapProvider()
 
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system. 
 
std::map< uint16_t, uint32_t > m_ueCqiTimers
 
Parameters of the CSCHED_UE_CONFIG_CNF primitive. 
 
Parameters of the CSCHED_UE_RELEASE_REQ primitive. 
 
virtual void SchedDlPagingBufferReq(const struct SchedDlPagingBufferReqParameters ¶ms)
 
static TypeId GetTypeId(void)
 
enum ns3::UlCqi_s::Type_e m_type
 
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
 
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)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
 
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name. 
 
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)
set the user part of the FfMacSchedSap that this Scheduler will interact with. 
 
std::vector< struct UlDciListElement_s > m_dciList
 
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO. 
 
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate. 
 
See section 4.3.10 buildRARListElement. 
 
virtual void SchedUlCqiInfoReq(const struct SchedUlCqiInfoReqParameters ¶ms)
 
Parameters of the CSCHED_UE_CONFIG_UPDATE_IND primitive. 
 
FfMacCschedSapProvider * m_cschedSapProvider
 
Parameters of the CSCHED_LC_RELEASE_REQ primitive. 
 
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
 
Parameters of the SCHED_DL_TRIGGER_REQ primitive. 
 
uint8_t m_logicalChannelIdentity
 
virtual ~RrFfMacScheduler()
Destructor. 
 
friend class RrSchedulerMemberSchedSapProvider
 
uint8_t UpdateHarqProcessId(uint16_t rnti)
Update and return a new process Id for the RNTI specified. 
 
void DoSchedDlPagingBufferReq(const struct FfMacSchedSapProvider::SchedDlPagingBufferReqParameters ¶ms)
 
static const int Type0AllocationRbg[4]
 
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
 
Parameters of the SCHED_DL_MAC_BUFFER_REQ primitive. 
 
virtual void CschedUeReleaseReq(const struct CschedUeReleaseReqParameters ¶ms)
 
Parameters of the SCHED_DL_PAGING_BUFFER_REQ primitive. 
 
std::map< uint16_t, uint8_t > m_p10CqiRxed
 
virtual void CschedUeConfigUpdateInd(const struct CschedUeConfigUpdateIndParameters ¶ms)=0
 
std::vector< struct VendorSpecificListElement_s > m_vendorSpecificList
 
virtual LteFfrSapUser * GetLteFfrSapUser()
 
FfMacCschedSapProvider::CschedCellConfigReqParameters m_cschedCellConfig
 
RrSchedulerMemberSchedSapProvider()
 
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the MAC Scheduler ins...
 
Parameters of the SCHED_UL_TRIGGER_REQ primitive. 
 
Hold an unsigned integer type. 
 
std::map< uint16_t, DlHarqProcessesStatus_t > m_dlHarqProcessesStatus
 
static uint8_t TxMode2LayerNum(uint8_t txMode)
 
LteFfrSapUser * m_ffrSapUser
 
std::vector< uint8_t > m_ndi
 
virtual void SetFfMacCschedSapUser(FfMacCschedSapUser *s)
set the user part of the FfMacCschedSap that this Scheduler will interact with. 
 
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)
Use NS_LOG to output a message of level LOG_LOGIC. 
 
Parameters of the SCHED_UL_NOISE_INTERFERENCE_REQ primitive. 
 
uint8_t m_logicalChannelIdentity
 
std::vector< struct CqiListElement_s > m_cqiList
 
std::vector< struct DlInfoListElement_s > m_dlInfoList
 
virtual void SetLteFfrSapProvider(LteFfrSapProvider *s)
Set the Provider part of the LteFfrSap that this Scheduler will interact with. 
 
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)
 
Parameters of the API primitives. 
 
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
 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
 
bool m_harqOn
m_harqOn when false inhibit te HARQ mechanisms (by default active) 
 
int GetRbgSize(int dlbandwidth)
 
std::list< FfMacSchedSapProvider::SchedDlRlcBufferReqParameters > m_rlcBufferReq
 
virtual void SchedUlNoiseInterferenceReq(const struct SchedUlNoiseInterferenceReqParameters ¶ms)
 
Ptr< const AttributeChecker > MakeBooleanChecker(void)
 
virtual void CschedUeConfigReq(const struct CschedUeConfigReqParameters ¶ms)
 
std::map< uint16_t, std::vector< double > > m_ueCqi
 
std::vector< DlDciListElement_s > DlHarqProcessesDciBuffer_t
 
Parameters of the CSCHED_LC_CONFIG_REQ primitive. 
 
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
 
LteFfrSapProvider * m_ffrSapProvider
 
void DoCschedLcReleaseReq(const struct FfMacCschedSapProvider::CschedLcReleaseReqParameters ¶ms)
 
virtual FfMacCschedSapProvider * GetFfMacCschedSapProvider()
 
This abstract base class identifies the interface by means of which the helper object can plug on the...
 
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
 
uint8_t m_nrOfPdcchOfdmSymbols
 
Parameters of the SCHED_DL_CQI_INFO_REQ primitive. 
 
std::vector< struct MacCeListElement_s > m_macCeList
 
Parameters of the API primitives. 
 
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
 
Parameters of the SCHED_UL_CQI_INFO_REQ primitive. 
 
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
 
Parameters of the API primitives. 
 
RrSchedulerMemberCschedSapProvider()
 
Parameters of the SCHED_UL_MAC_CTRL_INFO_REQ primitive. 
 
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG. 
 
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)
 
Parameters of the SCHED_UL_SR_INFO_REQ primitive. 
 
uint16_t m_rlcStatusPduSize
 
void DoSchedDlCqiInfoReq(const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters ¶ms)
 
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR. 
 
void TransmissionModeConfigurationUpdate(uint16_t rnti, uint8_t txMode)
 
Parameters of the SCHED_DL_RACH_INFO_REQ primitive. 
 
Parameters of the SCHED_UL_CONFIG_IND primitive. 
 
void DoSchedDlMacBufferReq(const struct FfMacSchedSapProvider::SchedDlMacBufferReqParameters ¶ms)
 
uint16_t m_rlcTransmissionQueueHolDelay
 
Parameters of the CSCHED_UE_CONFIG_REQ primitive. 
 
virtual void DoDispose(void)
Destructor implementation. 
 
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)
 
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
 
a unique identifier for an interface. 
 
TypeId SetParent(TypeId tid)
Set the parent TypeId. 
 
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.