diff --git a/src/lte/model/fdtbfq-ff-mac-scheduler.cc b/src/lte/model/fdtbfq-ff-mac-scheduler.cc index 0f26d46a7..fe54c523f 100644 --- a/src/lte/model/fdtbfq-ff-mac-scheduler.cc +++ b/src/lte/model/fdtbfq-ff-mac-scheduler.cc @@ -502,7 +502,7 @@ FdTbfqFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::S // select UE with largest metric std::map ::iterator it; std::map ::iterator itMax = m_flowStatsDl.end (); - double metricMax; + double metricMax = 0.0; bool firstRnti = true; for (it = m_flowStatsDl.begin (); it != m_flowStatsDl.end (); it++) { @@ -729,7 +729,7 @@ FdTbfqFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::S } } - bytesTxedTmp = bytesTxed; + bytesTxedTmp = bytesTxed; bytesTxed = 0; for (uint8_t j = 0; j < nLayer; j++) { diff --git a/src/lte/model/pss-ff-mac-scheduler.cc b/src/lte/model/pss-ff-mac-scheduler.cc index e1078b480..7d73db805 100644 --- a/src/lte/model/pss-ff-mac-scheduler.cc +++ b/src/lte/model/pss-ff-mac-scheduler.cc @@ -485,7 +485,7 @@ PssFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::Sche std::vector > ueSet2; for (it = ueSet.begin (); it != ueSet.end (); it++) { - double metric; + double metric = 0.0; if ((*it).second.lastAveragedThroughput < (*it).second.targetThroughput ) { // calculate TD BET metric @@ -700,7 +700,7 @@ PssFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::Sche } } // end if cqi - double metric; + double metric = 0.0; if (colMetric != 0) metric= weight * colMetric; else @@ -796,7 +796,7 @@ PssFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::Sche schMetric = achievableRate / (*it).second.secondLastAveragedThroughput; } // end if cqi - double metric; + double metric = 0.0; metric= weight * schMetric; if (metric > metricMax ) @@ -971,9 +971,9 @@ PssFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::Sche std::map ::iterator itUeScheduleted = tdUeSet.end(); itUeScheduleted = tdUeSet.find((*itStats).first); if (itUeScheduleted != tdUeSet.end()) - { - (*itStats).second.secondLastAveragedThroughput = ((1.0 - (1 / m_timeWindow)) * (*itStats).second.secondLastAveragedThroughput) + ((1 / m_timeWindow) * (double)((*itStats).second.lastTtiBytesTransmitted / 0.001)); - } + { + (*itStats).second.secondLastAveragedThroughput = ((1.0 - (1 / m_timeWindow)) * (*itStats).second.secondLastAveragedThroughput) + ((1 / m_timeWindow) * (double)((*itStats).second.lastTtiBytesTransmitted / 0.001)); + } (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTransmitted; // update average throughput (see eq. 12.3 of Sec 12.3.1.2 of LTE – The UMTS Long Term Evolution, Ed Wiley) diff --git a/src/lte/model/tdmt-ff-mac-scheduler.cc b/src/lte/model/tdmt-ff-mac-scheduler.cc index 09f0d3985..fe4420758 100644 --- a/src/lte/model/tdmt-ff-mac-scheduler.cc +++ b/src/lte/model/tdmt-ff-mac-scheduler.cc @@ -454,18 +454,18 @@ TdMtFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::Sch NS_FATAL_ERROR ("No Transmission Mode info on user " << (*it)); } int nLayer = TransmissionModesLayers::TxMode2LayerNum ((*itTxMode).second); - uint8_t wbCqi = 0; - if (itCqi == m_p10CqiRxed.end()) - { - wbCqi = 1; // start with lowest value - } + uint8_t wbCqi = 0; + if (itCqi == m_p10CqiRxed.end()) + { + wbCqi = 1; // start with lowest value + } else { - wbCqi = (*itCqi).second; + wbCqi = (*itCqi).second; } - if (wbCqi > 0) - { + if (wbCqi > 0) + { if (LcActivePerFlow (*it) > 0) { // this UE has data to transmit @@ -477,13 +477,13 @@ TdMtFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::Sch achievableRate += ((m_amc->GetTbSizeFromMcs (mcs, rbgSize) / 8) / 0.001); // = TB size / TTI } - double metric = achievableRate; + double metric = achievableRate; - if (metric > metricMax) - { - metricMax = metric; - itMax = it; - } + if (metric > metricMax) + { + metricMax = metric; + itMax = it; + } } } // end of wbCqi } // end for m_flowStatsDl @@ -491,16 +491,16 @@ TdMtFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::Sch if (itMax == m_flowStatsDl.end ()) { // no UE available for downlink - return; + return; } else { // assign all RBGs to this UE std::vector tempMap; - for (int i = 0; i < rbgNum; i++) - { + for (int i = 0; i < rbgNum; i++) + { tempMap.push_back (i); - } + } allocationMap.insert (std::pair > ((*itMax), tempMap)); } @@ -520,7 +520,7 @@ TdMtFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::Sch uint16_t lcActives = LcActivePerFlow ((*itMap).first); std::map ::iterator itCqi; - itCqi = m_p10CqiRxed.find((*itMap).first); + itCqi = m_p10CqiRxed.find((*itMap).first); std::map ::iterator itTxMode; itTxMode = m_uesTxMode.find ((*itMap).first); if (itTxMode == m_uesTxMode.end ()) @@ -538,7 +538,7 @@ TdMtFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::Sch { newDci.m_mcs.push_back ( m_amc->GetMcsFromCqi ((*itCqi).second) ); } - // allocate all RBGs to this UE + // allocate all RBGs to this UE int tbSize = (m_amc->GetTbSizeFromMcs (newDci.m_mcs.at (j), rbgNum * rbgSize) / 8); // (size of TB in bytes according to table 7.1.7.2.1-1 of 36.213) newDci.m_tbsSize.push_back (tbSize); } diff --git a/src/lte/model/tdtbfq-ff-mac-scheduler.cc b/src/lte/model/tdtbfq-ff-mac-scheduler.cc index 8e2f2f57b..99c6c1b25 100644 --- a/src/lte/model/tdtbfq-ff-mac-scheduler.cc +++ b/src/lte/model/tdtbfq-ff-mac-scheduler.cc @@ -495,7 +495,7 @@ TdTbfqFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::S // select UE with largest metric std::map ::iterator it; std::map ::iterator itMax = m_flowStatsDl.end (); - double metricMax; + double metricMax = 0.0; bool firstRnti = true; for (it = m_flowStatsDl.begin (); it != m_flowStatsDl.end (); it++) {