|
728 |
{ |
728 |
{ |
729 |
NS_LOG_FUNCTION (this); |
729 |
NS_LOG_FUNCTION (this); |
730 |
|
730 |
|
731 |
|
|
|
732 |
// apply transmission mode gain |
731 |
// apply transmission mode gain |
733 |
NS_ASSERT (m_transmissionMode < m_txModeGain.size ()); |
732 |
NS_ASSERT (m_transmissionMode < m_txModeGain.size ()); |
734 |
SpectrumValue newSinr = sinr; |
733 |
SpectrumValue newSinr = sinr; |
|
742 |
{ |
741 |
{ |
743 |
cqi = m_amc->CreateCqiFeedbacks (newSinr, m_dlBandwidth); |
742 |
cqi = m_amc->CreateCqiFeedbacks (newSinr, m_dlBandwidth); |
744 |
|
743 |
|
745 |
int nLayer = TransmissionModesLayers::TxMode2LayerNum (m_transmissionMode); |
744 |
uint8_t nLayer = TransmissionModesLayers::TxMode2LayerNum (m_transmissionMode); |
746 |
int nbSubChannels = cqi.size (); |
745 |
std::size_t nbSubChannels = cqi.size (); |
747 |
double cqiSum = 0.0; |
746 |
double cqiSum = 0.0; |
748 |
int activeSubChannels = 0; |
747 |
uint32_t activeSubChannels = 0; |
749 |
// average the CQIs of the different RBs |
748 |
// average the CQIs of the different RBs |
750 |
for (int i = 0; i < nbSubChannels; i++) |
749 |
for (uint32_t i = 0; i < nbSubChannels; i++) |
751 |
{ |
750 |
{ |
752 |
if (cqi.at (i) != -1) |
751 |
if (cqi.at (i) != -1) |
753 |
{ |
752 |
{ |
|
761 |
dlcqi.m_cqiType = CqiListElement_s::P10; // Peridic CQI using PUCCH wideband |
760 |
dlcqi.m_cqiType = CqiListElement_s::P10; // Peridic CQI using PUCCH wideband |
762 |
NS_ASSERT_MSG (nLayer > 0, " nLayer negative"); |
761 |
NS_ASSERT_MSG (nLayer > 0, " nLayer negative"); |
763 |
NS_ASSERT_MSG (nLayer < 3, " nLayer limit is 2s"); |
762 |
NS_ASSERT_MSG (nLayer < 3, " nLayer limit is 2s"); |
764 |
for (int i = 0; i < nLayer; i++) |
763 |
for (uint8_t i = 0; i < nLayer; i++) |
765 |
{ |
764 |
{ |
766 |
if (activeSubChannels > 0) |
765 |
if (activeSubChannels > 0) |
767 |
{ |
766 |
{ |
|
780 |
else if (Simulator::Now () > m_a30CqiLast + m_a30CqiPeriocity) |
779 |
else if (Simulator::Now () > m_a30CqiLast + m_a30CqiPeriocity) |
781 |
{ |
780 |
{ |
782 |
cqi = m_amc->CreateCqiFeedbacks (newSinr, GetRbgSize ()); |
781 |
cqi = m_amc->CreateCqiFeedbacks (newSinr, GetRbgSize ()); |
783 |
int nLayer = TransmissionModesLayers::TxMode2LayerNum (m_transmissionMode); |
782 |
uint8_t nLayer = TransmissionModesLayers::TxMode2LayerNum (m_transmissionMode); |
784 |
int nbSubChannels = cqi.size (); |
783 |
std::size_t nbSubChannels = cqi.size (); |
785 |
int rbgSize = GetRbgSize (); |
784 |
uint8_t rbgSize = GetRbgSize (); |
786 |
double cqiSum = 0.0; |
785 |
double cqiSum = 0.0; |
787 |
int cqiNum = 0; |
786 |
uint8_t cqiNum = 0; |
788 |
SbMeasResult_s rbgMeas; |
787 |
SbMeasResult_s rbgMeas; |
789 |
//NS_LOG_DEBUG (this << " Create A30 CQI feedback, RBG " << rbgSize << " cqiNum " << nbSubChannels << " band " << (uint16_t)m_dlBandwidth); |
788 |
//NS_LOG_DEBUG (this << " Create A30 CQI feedback, RBG " << (uint16_t) rbgSize << " cqiNum " << nbSubChannels << " band " << (uint16_t)m_dlBandwidth); |
790 |
for (int i = 0; i < nbSubChannels; i++) |
789 |
for (uint32_t i = 0; i < nbSubChannels; i++) |
791 |
{ |
790 |
{ |
792 |
if (cqi.at (i) != -1) |
791 |
if (cqi.at (i) != -1) |
793 |
{ |
792 |
{ |
|
801 |
//NS_LOG_DEBUG (this << " RBG CQI " << (uint16_t) cqiSum / rbgSize); |
800 |
//NS_LOG_DEBUG (this << " RBG CQI " << (uint16_t) cqiSum / rbgSize); |
802 |
HigherLayerSelected_s hlCqi; |
801 |
HigherLayerSelected_s hlCqi; |
803 |
hlCqi.m_sbPmi = 0; // not yet used |
802 |
hlCqi.m_sbPmi = 0; // not yet used |
804 |
for (int i = 0; i < nLayer; i++) |
803 |
for (uint8_t i = 0; i < nLayer; i++) |
805 |
{ |
804 |
{ |
806 |
hlCqi.m_sbCqi.push_back ((uint16_t) cqiSum / rbgSize); |
805 |
hlCqi.m_sbCqi.push_back ((uint16_t) cqiSum / rbgSize); |
807 |
} |
806 |
} |