Initialize some metric parameters in GSoC 2012 LTE NS-3 MAC schedulers
This commit is contained in:
@@ -502,7 +502,7 @@ FdTbfqFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::S
|
||||
// select UE with largest metric
|
||||
std::map <uint16_t, fdtbfqsFlowPerf_t>::iterator it;
|
||||
std::map <uint16_t, fdtbfqsFlowPerf_t>::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++)
|
||||
{
|
||||
|
||||
@@ -485,7 +485,7 @@ PssFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::Sche
|
||||
std::vector <std::pair<double,uint16_t> > 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 <uint16_t, pssFlowPerf_t>::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)
|
||||
|
||||
@@ -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 <uint16_t> tempMap;
|
||||
for (int i = 0; i < rbgNum; i++)
|
||||
{
|
||||
for (int i = 0; i < rbgNum; i++)
|
||||
{
|
||||
tempMap.push_back (i);
|
||||
}
|
||||
}
|
||||
allocationMap.insert (std::pair <uint16_t, std::vector <uint16_t> > ((*itMax), tempMap));
|
||||
}
|
||||
|
||||
@@ -520,7 +520,7 @@ TdMtFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::Sch
|
||||
|
||||
uint16_t lcActives = LcActivePerFlow ((*itMap).first);
|
||||
std::map <uint16_t,uint8_t>::iterator itCqi;
|
||||
itCqi = m_p10CqiRxed.find((*itMap).first);
|
||||
itCqi = m_p10CqiRxed.find((*itMap).first);
|
||||
std::map <uint16_t,uint8_t>::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);
|
||||
}
|
||||
|
||||
@@ -495,7 +495,7 @@ TdTbfqFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::S
|
||||
// select UE with largest metric
|
||||
std::map <uint16_t, tdtbfqsFlowPerf_t>::iterator it;
|
||||
std::map <uint16_t, tdtbfqsFlowPerf_t>::iterator itMax = m_flowStatsDl.end ();
|
||||
double metricMax;
|
||||
double metricMax = 0.0;
|
||||
bool firstRnti = true;
|
||||
for (it = m_flowStatsDl.begin (); it != m_flowStatsDl.end (); it++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user