|
|
| 524 |
NS_LOG_DEBUG ("UL DATA Power allocation :"); |
524 |
NS_LOG_DEBUG ("UL DATA Power allocation :"); |
| 525 |
Values::const_iterator it; |
525 |
Values::const_iterator it; |
| 526 |
uint32_t i = 0; |
526 |
uint32_t i = 0; |
|
|
527 |
uint32_t numActiveRbs = 0; |
| 528 |
|
| 529 |
// At the moment I could not find a better way to find total number |
| 530 |
// of active RBs. This method is independent of the bandwidth |
| 531 |
// configuration done in a test scenario, thus, it requires |
| 532 |
// minimum change to the script. |
| 527 |
for (it = spectrumValue->ConstValuesBegin (); it != spectrumValue->ConstValuesEnd (); it++) |
533 |
for (it = spectrumValue->ConstValuesBegin (); it != spectrumValue->ConstValuesEnd (); it++) |
| 528 |
{ |
534 |
{ |
| 529 |
double power = (*it) * (m_ulBandwidth * 180000); |
535 |
// Count the RB as active if it is part of |
|
|
536 |
// the expected UL RBs and has Power Spectral Density (PSD) > 0 |
| 537 |
if (m_expectedUlRb[numActiveRbs] == true && (*it) > 0) |
| 538 |
{ |
| 539 |
numActiveRbs++; |
| 540 |
} |
| 541 |
} |
| 542 |
NS_LOG_DEBUG ("Total number of active RBs = " << numActiveRbs); |
| 543 |
|
| 544 |
// The uplink power control and the uplink PSD |
| 545 |
// calculation only consider active resource block. |
| 546 |
for (it = spectrumValue->ConstValuesBegin (); it != spectrumValue->ConstValuesEnd (); it++) |
| 547 |
{ |
| 548 |
double power = (*it) * (numActiveRbs * 180000); |
| 530 |
NS_LOG_DEBUG ("RB " << i << " POWER: " << power << " expectedUlPower: " << m_expectedUlPower); |
549 |
NS_LOG_DEBUG ("RB " << i << " POWER: " << power << " expectedUlPower: " << m_expectedUlPower); |
| 531 |
if (m_expectedUlRb[i] == false && power > 0) |
550 |
if (m_expectedUlRb[i] == false && power > 0) |
| 532 |
{ |
551 |
{ |