diff --git a/src/lte/helper/rlc-stats-calculator.cc b/src/lte/helper/rlc-stats-calculator.cc index 6509717d2..d05013ea0 100644 --- a/src/lte/helper/rlc-stats-calculator.cc +++ b/src/lte/helper/rlc-stats-calculator.cc @@ -66,16 +66,16 @@ RlcStatsCalculator::SetOutputFilename (std::string outputFilename) void RlcStatsCalculator::TxPdu (uint16_t rnti, uint8_t lcid, uint32_t packetSize) { - NS_LOG_FUNCTION (this << " TxPDU " << rnti << (uint32_t) lcid << packetSize); + NS_LOG_FUNCTION (this << "TxPDU" << rnti << (uint32_t) lcid << packetSize); RntiLcidPair pair = RntiLcidPair(rnti, lcid); - uint32Map::iterator it = m_txPackets.find (pair); + m_txPackets[pair]++; } void RlcStatsCalculator::RxPdu (uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay) { - NS_LOG_FUNCTION (this << " RxPDU " << rnti << (uint32_t) lcid << packetSize << delay); + NS_LOG_FUNCTION (this << "RxPDU" << rnti << (uint32_t) lcid << packetSize << delay); RntiLcidPair pair = RntiLcidPair(rnti, lcid); m_rxPackets [pair]++; @@ -175,6 +175,7 @@ double RlcStatsCalculator::GetThroughput (RntiLcidPair p) { // TODO: Fix throughput calculation with the correct time + // NOTE: At this moment, Simulator::Now() is not available anymore //return (double) m_rxData[p] / Simulator::Now().GetSeconds(); return 0; } diff --git a/src/lte/helper/rlc-stats-calculator.h b/src/lte/helper/rlc-stats-calculator.h index 0e01f7dcc..3528738c8 100644 --- a/src/lte/helper/rlc-stats-calculator.h +++ b/src/lte/helper/rlc-stats-calculator.h @@ -43,20 +43,21 @@ struct RntiLcidPair friend bool operator == (const RntiLcidPair &a, const RntiLcidPair &b) { - return (a.lcid == b.lcid) && (a.rnti == b.rnti); + return ( (a.rnti == b.rnti) && (a.lcid == b.lcid) ); } friend bool operator < (const RntiLcidPair &a, const RntiLcidPair &b) { - return (a.lcid < b.lcid) || (a.rnti < b.rnti); + return ( (a.rnti < b.rnti) || ( (a.rnti == b.rnti) && (a.lcid < b.lcid) ) ); } }; typedef std::map uint32Map; typedef std::map uint64Map; typedef std::map > > uint64StatsMap; -typedef std::pair uint32Pair; -typedef std::pair uint64Pair; -typedef std::pair > > uint64StatsPair; +// TODO: Really useful? Maybe to remove +// typedef std::pair uint32Pair; +// typedef std::pair uint64Pair; +// typedef std::pair > > uint64StatsPair; class RlcStatsCalculator : public Object {