22 #include <ns3/lte-harq-phy.h> 
   24 #include <ns3/assert.h> 
   33 LteHarqPhy::LteHarqPhy ()
 
   36   std::vector <HarqProcessInfoList_t> dlHarqLayer0;
 
   37   dlHarqLayer0.resize (8);
 
   38   std::vector <HarqProcessInfoList_t> dlHarqLayer1;
 
   39   dlHarqLayer1.resize (8);
 
   40   m_miDlHarqProcessesInfoMap.push_back (dlHarqLayer0);
 
   41   m_miDlHarqProcessesInfoMap.push_back (dlHarqLayer1);
 
   45 LteHarqPhy::~LteHarqPhy ()
 
   47   m_miDlHarqProcessesInfoMap.clear ();
 
   48   m_miUlHarqProcessesInfoMap.clear ();
 
   53 LteHarqPhy::SubframeIndication (uint32_t frameNo, uint32_t subframeNo)
 
   58   std::map <uint16_t, std::vector <HarqProcessInfoList_t> >:: iterator it;
 
   59   for (it = m_miUlHarqProcessesInfoMap.begin (); it != m_miUlHarqProcessesInfoMap.end (); it++)
 
   61       (*it).second.erase ((*it).second.begin ());
 
   62       HarqProcessInfoList_t h;
 
   63       (*it).second.push_back (h);      
 
   73   HarqProcessInfoList_t list = m_miDlHarqProcessesInfoMap.at (layer).at (harqProcId);
 
   75   for (uint8_t i = 0; i < list.size (); i++)
 
   77       mi += list.at (i).m_mi;
 
   86   return (m_miDlHarqProcessesInfoMap.at (layer).at (harqProcId));   
 
   95   std::map <uint16_t, std::vector <HarqProcessInfoList_t> >::iterator it;
 
   96   it = m_miUlHarqProcessesInfoMap.find (rnti);
 
   97   NS_ASSERT_MSG (it!=m_miUlHarqProcessesInfoMap.end (), 
" Does not find MI for RNTI");
 
   98   HarqProcessInfoList_t list = (*it).second.at (0);
 
  100   for (uint8_t i = 0; i < list.size (); i++)
 
  102       mi += list.at (i).m_mi;
 
  107 HarqProcessInfoList_t
 
  111   std::map <uint16_t, std::vector <HarqProcessInfoList_t> >::iterator it;
 
  112   it = m_miUlHarqProcessesInfoMap.find (rnti);
 
  113   if (it==m_miUlHarqProcessesInfoMap.end ())
 
  116       std::vector <HarqProcessInfoList_t> harqList;
 
  118       m_miUlHarqProcessesInfoMap.insert (std::pair <uint16_t, std::vector <HarqProcessInfoList_t> > (rnti, harqList));
 
  119       return (harqList.at (harqProcId));
 
  123       return ((*it).second.at (harqProcId));
 
  133   if (m_miDlHarqProcessesInfoMap.at (layer).at (
id).size () == 3)  
 
  140   el.m_infoBits = infoBytes * 8;
 
  141   el.m_codeBits = codeBytes * 8;
 
  142   m_miDlHarqProcessesInfoMap.at (layer).at (
id).push_back (el);
 
  150   for (uint8_t i = 0; i < m_miDlHarqProcessesInfoMap.size (); i++)
 
  152       m_miDlHarqProcessesInfoMap.at (i).at (
id).clear ();
 
  162   std::map <uint16_t, std::vector <HarqProcessInfoList_t> >::iterator it;
 
  163   it = m_miUlHarqProcessesInfoMap.find (rnti);
 
  164   if (it==m_miUlHarqProcessesInfoMap.end ())
 
  167       std::vector <HarqProcessInfoList_t> harqList;
 
  171       el.m_infoBits = infoBytes * 8;
 
  172       el.m_codeBits = codeBytes * 8;
 
  173       harqList.at (7).push_back (el);
 
  174       m_miUlHarqProcessesInfoMap.insert (std::pair <uint16_t, std::vector <HarqProcessInfoList_t> > (rnti, harqList));
 
  178       if ((*it).second.at (7).size () == 3) 
 
  185       el.m_infoBits = infoBytes * 8;
 
  186       el.m_codeBits = codeBytes * 8;
 
  187       (*it).second.at (7).push_back (el);
 
  195   std::map <uint16_t, std::vector <HarqProcessInfoList_t> >::iterator it;
 
  196   it = m_miUlHarqProcessesInfoMap.find (rnti);
 
  197   if (it==m_miUlHarqProcessesInfoMap.end ())
 
  200       std::vector <HarqProcessInfoList_t> harqList;
 
  202       m_miUlHarqProcessesInfoMap.insert (std::pair <uint16_t, std::vector <HarqProcessInfoList_t> > (rnti, harqList));
 
  206       (*it).second.at (
id).clear ();
 
#define NS_LOG_FUNCTION(parameters)
HarqProcessInfoList_t GetHarqProcessInfoDl(uint8_t harqProcId, uint8_t layer)
Return the info of the HARQ procId in case of retranmissions for DL (asynchronous) ...
#define NS_LOG_COMPONENT_DEFINE(name)
double GetAccumulatedMiDl(uint8_t harqProcId, uint8_t layer)
Return the cumulated MI of the HARQ procId in case of retranmissions for DL (asynchronous) ...
void UpdateUlHarqProcessStatus(uint16_t rnti, double mi, uint16_t infoBytes, uint16_t codeBytes)
Update the MI value associated to the decodification of an HARQ process for DL (asynchronous) ...
void UpdateDlHarqProcessStatus(uint8_t id, uint8_t layer, double mi, uint16_t infoBytes, uint16_t codeBytes)
Update the Info associated to the decodification of an HARQ process for DL (asynchronous) ...
#define NS_ASSERT_MSG(condition, message)
void ResetUlHarqProcessStatus(uint16_t rnti, uint8_t id)
Reset the info associated to the decodification of an HARQ process for DL (asynchronous) ...
double GetAccumulatedMiUl(uint16_t rnti)
Return the cumulated MI of the HARQ procId in case of retranmissions for UL (synchronous) ...
void ResetDlHarqProcessStatus(uint8_t id)
Reset the info associated to the decodification of an HARQ process for DL (asynchronous) ...
HarqProcessInfoList_t GetHarqProcessInfoUl(uint16_t rnti, uint8_t harqProcId)
Return the info of the HARQ procId in case of retranmissions for UL (asynchronous) ...