--- a/src/lte/model/rr-ff-mac-scheduler.cc Thu Nov 08 15:57:05 2012 +0100
+++ b/src/lte/model/rr-ff-mac-scheduler.cc Thu Nov 08 16:51:47 2012 +0100
@@ -1205,7 +1205,7 @@
}
continue;
}
- if (rbAllocated + rbPerFlow > m_cschedCellConfig.m_ulBandwidth)
+ if (rbAllocated + rbPerFlow - 1 > m_cschedCellConfig.m_ulBandwidth)
{
// limit to physical resources last resource assignment
rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated;
@@ -1215,7 +1215,7 @@
uldci.m_rnti = (*it).first;
uldci.m_rbLen = rbPerFlow;
bool allocated = false;
- while ((!allocated)&&(rbAllocated < m_cschedCellConfig.m_ulBandwidth))
+ while ((!allocated)&&((rbAllocated + rbPerFlow - 1) < m_cschedCellConfig.m_ulBandwidth))
{
// check availability
bool free = true;
@@ -1243,6 +1243,11 @@
break;
}
rbAllocated++;
+ if (rbAllocated + rbPerFlow - 1 > m_cschedCellConfig.m_ulBandwidth)
+ {
+ // limit to physical resources last resource assignment
+ rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated;
+ }
}
if (!allocated)
{