621 NS_LOG_FUNCTION(
this <<
" Frame no. " << (params.m_sfnSf >> 4) <<
" subframe no. "
622 << (0xF & params.m_sfnSf));
632 std::map<uint16_t, std::multimap<uint8_t, qos_rb_and_CQI_assigned_to_lc>>
633 allocationMapPerRntiPerLCId;
634 allocationMapPerRntiPerLCId.clear();
638 int grouping_parameter = 1000;
639 double tolerance = 1.1;
640 std::map<LteFlowId_t, int> UEtoHOL;
641 std::vector<bool> rbgMap;
642 uint16_t rbgAllocatedNum = 0;
643 std::set<uint16_t> rntiAllocated;
647 for (
auto it = rbgMap.begin(); it != rbgMap.end(); it++)
662 (*itProcId).second = ((*itProcId).second + 1) %
HARQ_PROC_NUM;
666 std::vector<bool> ulRbMap;
669 uint8_t maxContinuousUlBandwidth = 0;
670 uint8_t tmpMinBandwidth = 0;
671 uint16_t ffrRbStartOffset = 0;
672 uint16_t tmpFfrRbStartOffset = 0;
675 for (
auto it = ulRbMap.begin(); it != ulRbMap.end(); it++)
679 if (tmpMinBandwidth > maxContinuousUlBandwidth)
681 maxContinuousUlBandwidth = tmpMinBandwidth;
682 ffrRbStartOffset = tmpFfrRbStartOffset;
688 if (tmpMinBandwidth == 0)
690 tmpFfrRbStartOffset = index;
697 if (tmpMinBandwidth > maxContinuousUlBandwidth)
699 maxContinuousUlBandwidth = tmpMinBandwidth;
700 ffrRbStartOffset = tmpFfrRbStartOffset;
704 uint16_t rbStart = 0;
705 rbStart = ffrRbStartOffset;
709 (*itRach).m_estimatedSize,
710 " Default UL Grant MCS does not allow to send RACH messages");
712 newRar.
m_rnti = (*itRach).m_rnti;
719 uint16_t tbSizeBits = 0;
721 while ((tbSizeBits < (*itRach).m_estimatedSize) &&
722 (rbStart + rbLen < (ffrRbStartOffset + maxContinuousUlBandwidth)))
727 if (tbSizeBits < (*itRach).m_estimatedSize)
739 NS_LOG_INFO(
this <<
" UL grant allocated to RNTI " << (*itRach).m_rnti <<
" rbStart "
740 << rbStart <<
" rbLen " << rbLen <<
" MCS " <<
m_ulGrantMcs <<
" tbSize "
742 for (uint16_t i = rbStart; i < rbStart + rbLen; i++)
775 harqId = (*itProcId).second;
779 NS_FATAL_ERROR(
"Unable to find RNTI entry in UL DCI HARQ buffer for RNTI "
782 (*itDci).second.at(harqId) = uldci;
785 rbStart = rbStart + rbLen;
795 if (!params.m_dlInfoList.empty())
799 params.m_dlInfoList.begin(),
800 params.m_dlInfoList.end());
805 if (!params.m_dlInfoList.empty())
815 std::vector<DlInfoListElement_s> dlInfoListUntxed;
819 if (itRnti != rntiAllocated.end())
825 std::vector<bool> retx;
826 NS_LOG_INFO(
this <<
" Processing DLHARQ feedback");
831 retx.push_back(
false);
840 if (retx.at(0) || retx.at(1))
845 NS_LOG_INFO(
this <<
" HARQ retx RNTI " << rnti <<
" harqId " << (uint16_t)harqId);
854 if (dci.
m_rv.size() == 1)
866 NS_LOG_INFO(
"Maximum number of retransmissions reached -> drop process");
870 NS_LOG_ERROR(
"No info find in HARQ buffer for UE (might change eNB) "
873 (*it).second.at(harqId) = 0;
877 NS_FATAL_ERROR(
"Unable to find RlcPdcList in HARQ buffer for RNTI "
880 for (std::size_t k = 0; k < (*itRlcPdu).second.size(); k++)
882 (*itRlcPdu).second.at(k).at(harqId).clear();
888 std::vector<int> dciRbg;
891 for (
int j = 0; j < 32; j++)
901 for (std::size_t j = 0; j < dciRbg.size(); j++)
903 if (rbgMap.at(dciRbg.at(j)))
913 for (std::size_t j = 0; j < dciRbg.size(); j++)
915 rbgMap.at(dciRbg.at(j)) =
true;
916 NS_LOG_INFO(
"RBG " << dciRbg.at(j) <<
" assigned");
920 NS_LOG_INFO(
this <<
" Send retx in the same RBGs");
926 uint8_t rbgId = (dciRbg.at(dciRbg.size() - 1) + 1) % numberOfRBGs;
927 uint8_t startRbg = dciRbg.at(dciRbg.size() - 1);
928 std::vector<bool> rbgMapCopy = rbgMap;
929 while ((j < dciRbg.size()) && (startRbg != rbgId))
931 if (!rbgMapCopy.at(rbgId))
933 rbgMapCopy.at(rbgId) =
true;
934 dciRbg.at(j) = rbgId;
937 rbgId = (rbgId + 1) % numberOfRBGs;
939 if (j == dciRbg.size())
943 for (std::size_t k = 0; k < dciRbg.size(); k++)
945 rbgMask = rbgMask + (0x1 << dciRbg.at(k));
950 NS_LOG_INFO(
this <<
" Move retx in RBGs " << dciRbg.size());
956 NS_LOG_INFO(
this <<
" No resource for this retx -> buffer it");
964 NS_FATAL_ERROR(
"Unable to find RlcPdcList in HARQ buffer for RNTI " << rnti);
966 for (std::size_t j = 0; j < nLayers; j++)
970 if (j >= dci.
m_ndi.size())
973 dci.
m_ndi.push_back(0);
974 dci.
m_rv.push_back(0);
975 dci.
m_mcs.push_back(0);
978 <<
" no txed (MIMO transition)");
984 (*itHarq).second.at(harqId).m_rv.at(j)++;
985 NS_LOG_INFO(
this <<
" layer " << (uint16_t)j <<
" RV "
986 << (uint16_t)dci.
m_rv.at(j));
996 NS_LOG_INFO(
this <<
" layer " << (uint16_t)j <<
" no retx");
999 for (std::size_t k = 0; k < (*itRlcPdu).second.at(0).at(dci.
m_harqProcess).size(); k++)
1001 std::vector<RlcPduListElement_s> rlcPduListPerLc;
1002 for (std::size_t j = 0; j < nLayers; j++)
1006 if (j < dci.
m_ndi.size())
1008 NS_LOG_INFO(
" layer " << (uint16_t)j <<
" tb size "
1010 rlcPduListPerLc.push_back(
1023 .m_logicalChannelIdentity;
1025 rlcPduListPerLc.push_back(emptyElement);
1029 if (!rlcPduListPerLc.empty())
1036 (*itHarq).second.at(harqId).
m_rv = dci.
m_rv;
1041 NS_FATAL_ERROR(
"Unable to find HARQ timer for RNTI " << (uint16_t)rnti);
1043 (*itHarqTimer).second.at(harqId) = 0;
1045 rntiAllocated.insert(rnti);
1062 NS_FATAL_ERROR(
"Unable to find RlcPdcList in HARQ buffer for RNTI "
1065 for (std::size_t k = 0; k < (*itRlcPdu).second.size(); k++)
1074 if (rbgAllocatedNum == numberOfRBGs)
1086 itLogicalChannels++)
1088 auto itRnti = rntiAllocated.find(itLogicalChannels->first.m_rnti);
1089 if ((itRnti != rntiAllocated.end()) ||
1093 if (itRnti != rntiAllocated.end())
1096 << (uint16_t)(itLogicalChannels->first.m_rnti));
1101 << (uint16_t)(itLogicalChannels->first.m_rnti));
1106 auto itRlcBufferReq =
m_rlcBufferReq.find(itLogicalChannels->first);
1115 if (itRlcBufferReq->second.m_rlcRetransmissionQueueSize > 0)
1117 delay = itRlcBufferReq->second.m_rlcRetransmissionHolDelay;
1118 group = delay / grouping_parameter;
1120 else if (itRlcBufferReq->second.m_rlcTransmissionQueueSize > 0)
1122 delay = itRlcBufferReq->second.m_rlcTransmissionQueueHolDelay;
1123 group = delay / grouping_parameter;
1130 UEtoHOL.insert(std::pair<LteFlowId_t, int>(itLogicalChannels->first, delay));
1132 if (itLogicalChannels->second.m_qosBearerType ==
1135 if (map_nonGBRHOLgroupToUE.count(group) == 0)
1137 std::set<LteFlowId_t> v;
1138 v.insert(itRlcBufferReq->first);
1139 map_nonGBRHOLgroupToUE.insert(std::pair<
int, std::set<LteFlowId_t>>(group, v));
1143 map_nonGBRHOLgroupToUE.find(group)->second.insert(itRlcBufferReq->first);
1146 else if (itLogicalChannels->second.m_qosBearerType ==
1148 itLogicalChannels->second.m_qosBearerType ==
1151 if (map_GBRHOLgroupToUE.count(group) == 0)
1153 std::set<LteFlowId_t> v;
1154 v.insert(itRlcBufferReq->first);
1155 map_GBRHOLgroupToUE.insert(std::pair<
int, std::set<LteFlowId_t>>(group, v));
1159 map_GBRHOLgroupToUE.find(group)->second.insert(itRlcBufferReq->first);
1166 std::map<LteFlowId_t, int> UeToAmountOfDataToTransfer;
1168 std::map<LteFlowId_t, int> UeToAmountOfAssignedResources;
1171 std::map<uint16_t, uint8_t> sbCqiSum;
1178 auto itTxMode =
m_uesTxMode.find((*itrbr).first.m_rnti);
1181 NS_FATAL_ERROR(
"No Transmission Mode info on user " << (*itrbr).first.m_rnti);
1186 for (
int k = 0; k < numberOfRBGs; k++)
1188 for (uint8_t j = 0; j < nLayer; j++)
1196 cqiSum += (*itCqi).second.m_higherLayerSelected.at(k).m_sbCqi.at(j);
1203 NS_LOG_INFO(
"Skip this flow, CQI==0, rnti:" << (*itrbr).first.m_rnti);
1208 int amountOfDataToTransfer =
1209 8 * ((int)
m_rlcBufferReq.find(flowId)->second.m_rlcRetransmissionQueueSize +
1210 (int)
m_rlcBufferReq.find(flowId)->second.m_rlcTransmissionQueueSize);
1212 UeToAmountOfDataToTransfer.insert(
1213 std::pair<LteFlowId_t, int>(flowId, amountOfDataToTransfer));
1214 UeToAmountOfAssignedResources.insert(std::pair<LteFlowId_t, int>(flowId, 0));
1217 for (
int i = 0; i < numberOfRBGs; i++)
1220 auto itTxMode =
m_uesTxMode.find((*itrbr).first.m_rnti);
1223 NS_FATAL_ERROR(
"No Transmission Mode info on user " << (*itrbr).first.m_rnti);
1226 std::vector<uint8_t> sbCqis;
1229 sbCqis = std::vector<uint8_t>(nLayer, 1);
1233 sbCqis = (*itCqi).second.m_higherLayerSelected.at(i).m_sbCqi;
1236 uint8_t cqi1 = sbCqis.at(0);
1238 if (sbCqis.size() > 1)
1240 cqi2 = sbCqis.at(1);
1247 for (uint8_t k = 0; k < nLayer; k++)
1249 if (sbCqis.size() > k)
1251 sbCqi = sbCqis.at(k);
1263 sbCqiSum.insert(std::pair<uint16_t, uint8_t>((*itrbr).first.m_rnti, sum));
1267 std::set<int> availableRBGs;
1268 for (
int i = 0; i < numberOfRBGs; i++)
1272 availableRBGs.insert(i);
1276 auto itGBRgroups = map_GBRHOLgroupToUE.begin();
1277 auto itnonGBRgroups = map_nonGBRHOLgroupToUE.begin();
1281 while (!availableRBGs.empty())
1283 if (UeToAmountOfDataToTransfer.empty())
1285 NS_LOG_INFO(
"No UEs to be scheduled (no data or CQI==0),");
1288 std::set<LteFlowId_t> vUEs;
1291 if (itGBRgroups != map_GBRHOLgroupToUE.end())
1293 itCurrentGroup = itGBRgroups;
1296 else if (itnonGBRgroups !=
1297 map_nonGBRHOLgroupToUE
1301 itCurrentGroup = itnonGBRgroups;
1306 NS_LOG_INFO(
"Available RBGs:" << availableRBGs.size() <<
"but no users");
1310 while (!availableRBGs.empty() && !itCurrentGroup->second.empty())
1312 bool currentRBchecked =
false;
1313 int currentRB = *(availableRBGs.begin());
1314 std::map<LteFlowId_t, CQI_value> UeToCQIValue;
1315 std::map<LteFlowId_t, double> UeToCoitaMetric;
1316 std::map<LteFlowId_t, bool> UeHasReachedGBR;
1317 double maximumValueMetric = 0;
1319 UeToCQIValue.clear();
1320 UeToCoitaMetric.clear();
1324 for (
auto it = itCurrentGroup->second.begin(); it != itCurrentGroup->second.end(); it++)
1327 uint8_t cqi_value = 1;
1328 double coita_metric = 1;
1329 double coita_sum = 0;
1331 uint8_t worstCQIAmongRBGsAllocatedForThisUser = 15;
1332 int numberOfRBGAllocatedForThisUser = 0;
1346 currentRBchecked =
true;
1350 (*itStats).second.targetThroughput / (*itStats).second.lastAveragedThroughput;
1351 if (tbr_weight < 1.0)
1358 for (
auto it = availableRBGs.begin(); it != availableRBGs.end(); it++)
1363 (itRntiCQIsMap->second.m_higherLayerSelected.at(*it).m_sbCqi.at(0));
1368 if (*it == currentRB)
1374 catch (std::out_of_range&)
1378 <<
" rnti:" << flowId.
m_rnti
1379 <<
" at subband:" << currentRB);
1384 coita_metric = cqi_value / coita_sum;
1385 UeToCQIValue.insert(std::pair<LteFlowId_t, CQI_value>(flowId, cqi_value));
1386 UeToCoitaMetric.insert(std::pair<LteFlowId_t, double>(flowId, coita_metric));
1389 if (allocationMapPerRntiPerLCId.find(flowId.
m_rnti) ==
1390 allocationMapPerRntiPerLCId.end())
1392 worstCQIAmongRBGsAllocatedForThisUser = cqi_value;
1396 numberOfRBGAllocatedForThisUser =
1397 (allocationMapPerRntiPerLCId.find(flowId.
m_rnti)->second.size());
1400 allocationMapPerRntiPerLCId.find(flowId.
m_rnti)->second.begin();
1401 itRBG != allocationMapPerRntiPerLCId.find(flowId.
m_rnti)->second.end();
1411 if (cqi_value < worstCQIAmongRBGsAllocatedForThisUser)
1413 worstCQIAmongRBGsAllocatedForThisUser = cqi_value;
1417 int mcsForThisUser =
m_amc->GetMcsFromCqi(worstCQIAmongRBGsAllocatedForThisUser);
1419 m_amc->GetDlTbSizeFromMcs(mcsForThisUser,
1420 (numberOfRBGAllocatedForThisUser + 1) * rbgSize) /
1424 double achievableRate =
1425 ((
m_amc->GetDlTbSizeFromMcs(mcsForThisUser, rbgSize) / 8) / 0.001);
1426 double pf_weight = achievableRate / (*itStats).second.secondLastAveragedThroughput;
1428 UeToAmountOfAssignedResources.find(flowId)->second = 8 * tbSize;
1432 if (UeToAmountOfDataToTransfer.find(flowId)->second -
1433 UeToAmountOfAssignedResources.find(flowId)->second <
1436 UeHasReachedGBR.insert(std::pair<LteFlowId_t, bool>(flowId,
false));
1439 double bitRateWithNewRBG = 0;
1451 bitRateWithNewRBG = (1.0 /
m_timeWindow) * (
double)(tbSize * 1000);
1456 UeHasReachedGBR.insert(std::pair<LteFlowId_t, bool>(flowId,
true));
1460 UeHasReachedGBR.insert(std::pair<LteFlowId_t, bool>(flowId,
false));
1463 int hol = UEtoHOL.find(flowId)->second;
1472 metric = coita_metric * tbr_weight * hol;
1476 metric = tbr_weight * pf_weight * hol;
1483 if (metric >= maximumValueMetric)
1485 maximumValueMetric = metric;
1486 userWithMaximumMetric = flowId;
1490 if (!currentRBchecked)
1493 availableRBGs.erase(currentRB);
1501 auto itMap = allocationMapPerRntiPerLCId.find(userWithMaximumMetric.
m_rnti);
1503 if (itMap == allocationMapPerRntiPerLCId.end())
1505 std::multimap<uint8_t, qos_rb_and_CQI_assigned_to_lc> tempMap;
1507 std::pair<uint8_t, qos_rb_and_CQI_assigned_to_lc>(userWithMaximumMetric.
m_lcId,
1509 allocationMapPerRntiPerLCId.insert(
1510 std::pair<uint16_t, std::multimap<uint8_t, qos_rb_and_CQI_assigned_to_lc>>(
1511 userWithMaximumMetric.
m_rnti,
1516 itMap->second.insert(
1517 std::pair<uint8_t, qos_rb_and_CQI_assigned_to_lc>(userWithMaximumMetric.
m_lcId,
1522 availableRBGs.erase(currentRB);
1524 if (UeToAmountOfDataToTransfer.find(userWithMaximumMetric)->second <=
1525 UeToAmountOfAssignedResources.find(userWithMaximumMetric)->second * tolerance)
1528 itCurrentGroup->second.erase(userWithMaximumMetric);
1537 (*itStats).second.lastTtiBytesTransmitted = 0;
1543 auto itMap = allocationMapPerRntiPerLCId.begin();
1544 std::map<uint16_t, double> m_rnti_per_ratio;
1546 while (itMap != allocationMapPerRntiPerLCId.end())
1550 newEl.
m_rnti = (*itMap).first;
1554 std::vector<RlcPduListElement_s> newRlcPduLe;
1555 newDci.
m_rnti = (*itMap).first;
1563 uint16_t RbgPerRnti = (*itMap).second.size();
1564 double doubleRBgPerRnti = RbgPerRnti;
1565 double doubleRbgNum = numberOfRBGs;
1566 double rrRatio = doubleRBgPerRnti / doubleRbgNum;
1567 m_rnti_per_ratio.insert(std::pair<uint16_t, double>((*itMap).first, rrRatio));
1568 uint8_t worstCqi = 15;
1571 for (
auto it = (*itMap).second.begin(); it != (*itMap).second.end(); it++)
1573 if (it->second.cqi_value_for_lc < worstCqi)
1575 worstCqi = it->second.cqi_value_for_lc;
1579 newDci.
m_mcs.push_back(
m_amc->GetMcsFromCqi(worstCqi));
1580 int tbSize = (
m_amc->GetDlTbSizeFromMcs(newDci.
m_mcs.at(0), RbgPerRnti * rbgSize) /
1586 for (
auto itRBGsPerRNTI = (*itMap).second.begin(); itRBGsPerRNTI != (*itMap).second.end();
1589 rbgMask = rbgMask + (0x1 << itRBGsPerRNTI->second.resource_block_index);
1596 if (((*itBufReq).first.m_rnti == (*itMap).first) &&
1597 (((*itBufReq).second.m_rlcTransmissionQueueSize > 0) ||
1598 ((*itBufReq).second.m_rlcRetransmissionQueueSize > 0) ||
1599 ((*itBufReq).second.m_rlcStatusPduSize > 0)))
1601 std::vector<RlcPduListElement_s> newRlcPduLe;
1607 newRlcEl.
m_size = tbSize / lcActives;
1610 newRlcPduLe.push_back(newRlcEl);
1620 NS_FATAL_ERROR(
"Unable to find RlcPdcList in HARQ buffer for RNTI "
1624 (*itRlcPdu).second.at(j).at(newDci.
m_harqProcess).push_back(newRlcEl);
1629 if ((*itBufReq).first.m_rnti > (*itMap).first)
1636 newDci.
m_ndi.push_back(1);
1637 newDci.
m_rv.push_back(0);
1642 newEl.
m_dci = newDci;
1650 NS_FATAL_ERROR(
"Unable to find RNTI entry in DCI HARQ buffer for RNTI "
1670 (*it).second.lastTtiBytesTransmitted = tbSize;
1685 if (allocationMapPerRntiPerLCId.find(itStats->first) != allocationMapPerRntiPerLCId.end())
1687 (*itStats).second.secondLastAveragedThroughput =
1688 ((1.0 - (1 /
m_timeWindow)) * (*itStats).second.secondLastAveragedThroughput) +
1692 (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTransmitted;
1695 (*itStats).second.lastAveragedThroughput =
1696 ((1.0 - (1.0 /
m_timeWindow)) * (*itStats).second.lastAveragedThroughput) +
1697 ((1.0 /
m_timeWindow) * (
double)((*itStats).second.lastTtiBytesTransmitted / 0.001));
1698 NS_LOG_INFO(
this <<
" UE total bytes " << (*itStats).second.totalBytesTransmitted);
1699 NS_LOG_INFO(
this <<
" UE average throughput " << (*itStats).second.lastAveragedThroughput);
1700 (*itStats).second.lastTtiBytesTransmitted = 0;
1705 int count_allocated_resource_blocks = 0;
1706 for (
auto itMap = allocationMapPerRntiPerLCId.begin();
1707 itMap != allocationMapPerRntiPerLCId.end();
1710 count_allocated_resource_blocks += itMap->second.size();
1712 NS_LOG_INFO(
this <<
" Allocated RBs:" << count_allocated_resource_blocks);
1816 NS_LOG_FUNCTION(
this <<
" UL - Frame no. " << (params.m_sfnSf >> 4) <<
" subframe no. "
1817 << (0xF & params.m_sfnSf) <<
" size " << params.m_ulInfoList.size());
1824 std::vector<bool> rbMap;
1825 uint16_t rbAllocatedNum = 0;
1826 std::set<uint16_t> rntiAllocated;
1827 std::vector<uint16_t> rbgAllocationMap;
1838 for (
auto it = rbMap.begin(); it != rbMap.end(); it++)
1852 if (rbgAllocationMap.at(i) != 0)
1862 for (std::size_t i = 0; i < params.m_ulInfoList.size(); i++)
1867 uint16_t rnti = params.m_ulInfoList.at(i).m_rnti;
1871 NS_LOG_ERROR(
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1874 NS_LOG_INFO(
this <<
" UL-HARQ retx RNTI " << rnti <<
" harqId " << (uint16_t)harqId
1875 <<
" i " << i <<
" size " << params.m_ulInfoList.size());
1879 NS_LOG_ERROR(
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1886 NS_LOG_ERROR(
"No info find in HARQ buffer for UE (might change eNB) " << rnti);
1888 if ((*itStat).second.at(harqId) >= 3)
1890 NS_LOG_INFO(
"Max number of retransmissions reached (UL)-> drop process");
1909 rbgAllocationMap.at(j) = dci.
m_rnti;
1915 << (*itStat).second.at(harqId) + 1);
1919 NS_LOG_INFO(
"Cannot allocate retx due to RACH allocations for UE " << rnti);
1924 (*itStat).second.at((*itProcId).second) = (*itStat).second.at(harqId) + 1;
1925 (*itStat).second.at(harqId) = 0;
1926 (*itHarq).second.at((*itProcId).second) = dci;
1928 rntiAllocated.insert(dci.
m_rnti);
1932 NS_LOG_INFO(
this <<
" HARQ-ACK feedback from RNTI "
1933 << params.m_ulInfoList.at(i).m_rnti);
1938 std::map<uint16_t, uint32_t>::iterator it;
1943 auto itRnti = rntiAllocated.find((*it).first);
1945 if (((*it).second > 0) && (itRnti == rntiAllocated.end()))
1964 uint16_t tempRbPerFlow = (ffrUlBandwidth) / (nflows + rntiAllocated.size());
1965 uint16_t rbPerFlow =
1966 (minContinuousUlBandwidth < tempRbPerFlow) ? minContinuousUlBandwidth : tempRbPerFlow;
1973 int rbAllocated = 0;
1996 auto itRnti = rntiAllocated.find((*it).first);
1997 if ((itRnti != rntiAllocated.end()) || ((*it).second == 0))
2000 NS_LOG_DEBUG(
this <<
" UE already allocated in HARQ -> discarded, RNTI "
2024 uldci.
m_rnti = (*it).first;
2026 bool allocated =
false;
2027 NS_LOG_INFO(
this <<
" RB Allocated " << rbAllocated <<
" rbPerFlow " << rbPerFlow
2028 <<
" flows " << nflows);
2034 for (
int j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
2049 NS_LOG_INFO(
this <<
"RNTI: " << (*it).first <<
" RB Allocated " << rbAllocated
2050 <<
" rbPerFlow " << rbPerFlow <<
" flows " << nflows);
2053 for (
int j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
2057 rbgAllocationMap.at(j) = (*it).first;
2059 rbAllocated += rbPerFlow;
2088 auto itCqi =
m_ueCqi.find((*it).first);
2099 "CQI of RNTI = " << (*it).first <<
" has expired");
2100 double minSinr = (*itCqi).second.at(uldci.
m_rbStart);
2107 double sinr = (*itCqi).second.at(i);
2119 double s = log2(1 + (std::pow(10, minSinr / 10) / ((-std::log(5.0 * 0.00005)) / 1.5)));
2120 cqi =
m_amc->GetCqiFromSpectralEfficiency(s);
2133 rbgAllocationMap.at(i) = 0;
2164 harqId = (*itProcId).second;
2168 NS_FATAL_ERROR(
"Unable to find RNTI entry in UL DCI HARQ buffer for RNTI "
2171 (*itDci).second.at(harqId) = uldci;
2176 NS_LOG_ERROR(
"No info find in HARQ buffer for UE (might change eNB) "
2179 (*itStat).second.at(harqId) = 0;
2182 NS_LOG_INFO(
this <<
" UE Allocation RNTI " << (*it).first <<
" startPRB "
2184 <<
" CQI " << cqi <<
" MCS " << (
uint32_t)uldci.
m_mcs <<
" TBsize "
2185 << uldci.
m_tbSize <<
" RbAlloc " << rbAllocated <<
" harqId "
2186 << (uint16_t)harqId);
2192 (*itStats).second.lastTtiBytesTransmitted = uldci.
m_tbSize;
2196 NS_LOG_DEBUG(
this <<
" No Stats for this allocated UE");
2211 }
while (((*it).first !=
m_nextRntiUl) && (rbPerFlow != 0));
2217 (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTransmitted;
2220 (*itStats).second.lastAveragedThroughput =
2221 ((1.0 - (1.0 /
m_timeWindow)) * (*itStats).second.lastAveragedThroughput) +
2222 ((1.0 /
m_timeWindow) * (
double)((*itStats).second.lastTtiBytesTransmitted / 0.001));
2223 NS_LOG_INFO(
this <<
" UE total bytes " << (*itStats).second.totalBytesTransmitted);
2224 NS_LOG_INFO(
this <<
" UE average throughput " << (*itStats).second.lastAveragedThroughput);
2225 (*itStats).second.lastTtiBytesTransmitted = 0;