src/lte/helper/radio-bearer-stats-calculator.cc
author Nicola Baldo <nbaldo@cttc.es>
Fri, 31 May 2013 15:54:42 +0200
changeset 9819 383faf43ae39
parent 9619 82a76cadf1ee
child 10410 4d4eb8097fa3
permissions -rw-r--r--
fixed Bug 1630 - spurious RX packets in DlRlcStats
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
     1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
     2
/*
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
     3
 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
     4
 *
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
     7
 * published by the Free Software Foundation;
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
     8
 *
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    12
 * GNU General Public License for more details.
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    13
 *
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    17
 *
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    18
 * Author: Jaume Nin <jnin@cttc.es>
9614
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
    19
 *         Nicola Baldo <nbaldo@cttc.es>
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    20
 */
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    21
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
    22
#include "radio-bearer-stats-calculator.h"
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    23
#include "ns3/string.h"
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    24
#include "ns3/nstime.h"
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    25
#include <ns3/log.h>
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
    26
#include <vector>
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
    27
#include <algorithm>
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    28
8491
97a454b21dc8 Fix bug in updating epoch times
Jaume Nin
parents: 8461
diff changeset
    29
namespace ns3
97a454b21dc8 Fix bug in updating epoch times
Jaume Nin
parents: 8461
diff changeset
    30
{
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    31
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
    32
NS_LOG_COMPONENT_DEFINE ("RadioBearerStatsCalculator");
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    33
8491
97a454b21dc8 Fix bug in updating epoch times
Jaume Nin
parents: 8461
diff changeset
    34
NS_OBJECT_ENSURE_REGISTERED ( RadioBearerStatsCalculator);
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    35
8697
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
    36
RadioBearerStatsCalculator::RadioBearerStatsCalculator ()
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
    37
  : m_firstWrite (true),
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
    38
    m_pendingOutput (false), 
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
    39
    m_protocolType ("RLC")
8540
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    40
{
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    41
  NS_LOG_FUNCTION (this);
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    42
}
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    43
8697
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
    44
RadioBearerStatsCalculator::RadioBearerStatsCalculator (std::string protocolType)
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
    45
  : m_firstWrite (true),
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
    46
    m_pendingOutput (false)
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    47
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
    48
  NS_LOG_FUNCTION (this);
8697
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
    49
  m_protocolType = protocolType;
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    50
}
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    51
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
    52
RadioBearerStatsCalculator::~RadioBearerStatsCalculator ()
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    53
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
    54
  NS_LOG_FUNCTION (this);
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    55
}
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    56
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    57
TypeId
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
    58
RadioBearerStatsCalculator::GetTypeId (void)
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    59
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
    60
  static TypeId tid =
8540
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    61
    TypeId ("ns3::RadioBearerStatsCalculator")
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    62
    .SetParent<LteStatsCalculator> ().AddConstructor<RadioBearerStatsCalculator> ()
9614
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
    63
    .AddAttribute ("StartTime", "Start time of the on going epoch.", 
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
    64
                   TimeValue (Seconds (0.)),
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
    65
                   MakeTimeAccessor (&RadioBearerStatsCalculator::SetStartTime,
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
    66
                                     &RadioBearerStatsCalculator::GetStartTime), 
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
    67
                   MakeTimeChecker ())
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
    68
    .AddAttribute ("EpochDuration", "Epoch duration.", 
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
    69
                   TimeValue (Seconds (0.25)), 
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
    70
                   MakeTimeAccessor (&RadioBearerStatsCalculator::GetEpoch,
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
    71
                                     &RadioBearerStatsCalculator::SetEpoch), 
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
    72
                   MakeTimeChecker ())
8540
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    73
    .AddAttribute ("DlRlcOutputFilename",
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    74
                   "Name of the file where the downlink results will be saved.",
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    75
                   StringValue ("DlRlcStats.txt"),
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    76
                   MakeStringAccessor (&LteStatsCalculator::SetDlOutputFilename),
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    77
                   MakeStringChecker ())
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    78
    .AddAttribute ("UlRlcOutputFilename",
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    79
                   "Name of the file where the uplink results will be saved.",
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    80
                   StringValue ("UlRlcStats.txt"),
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    81
                   MakeStringAccessor (&LteStatsCalculator::SetUlOutputFilename),
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    82
                   MakeStringChecker ())
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    83
    .AddAttribute ("DlPdcpOutputFilename",
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    84
                   "Name of the file where the downlink results will be saved.",
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    85
                   StringValue ("DlPdcpStats.txt"),
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    86
                   MakeStringAccessor (&RadioBearerStatsCalculator::SetDlPdcpOutputFilename),
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    87
                   MakeStringChecker ())
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    88
    .AddAttribute ("UlPdcpOutputFilename",
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    89
                   "Name of the file where the uplink results will be saved.",
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    90
                   StringValue ("UlPdcpStats.txt"),
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    91
                   MakeStringAccessor (&RadioBearerStatsCalculator::SetUlPdcpOutputFilename),
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    92
                   MakeStringChecker ())
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
    93
  ;
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    94
  return tid;
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    95
}
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    96
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
    97
void
8697
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
    98
RadioBearerStatsCalculator::DoDispose ()
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
    99
{
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
   100
  NS_LOG_FUNCTION (this);
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
   101
  if (m_pendingOutput)
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
   102
    {
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
   103
      ShowResults ();
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
   104
    }
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
   105
}
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
   106
9614
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   107
void 
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   108
RadioBearerStatsCalculator::SetStartTime (Time t)
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   109
{
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   110
  m_startTime = t;
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   111
  RescheduleEndEpoch ();
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   112
}
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   113
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   114
Time 
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   115
RadioBearerStatsCalculator::GetStartTime () const
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   116
{
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   117
  return m_startTime;
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   118
}
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   119
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   120
void 
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   121
RadioBearerStatsCalculator::SetEpoch (Time e)
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   122
{
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   123
  m_epochDuration = e;
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   124
  RescheduleEndEpoch ();
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   125
}
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   126
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   127
Time 
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   128
RadioBearerStatsCalculator::GetEpoch () const
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   129
{
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   130
  return m_epochDuration;  
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   131
}
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   132
8697
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
   133
void
9382
a058179c3d9d Fix JIRA LENA-284, cellId was not being reported in some callbacks and in some situations cellId was being reported 0, now fixed and reporting always correct cellId
Jaume Nin
parents: 8697
diff changeset
   134
RadioBearerStatsCalculator::UlTxPdu (uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize)
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   135
{
9619
82a76cadf1ee better log statements in RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 9614
diff changeset
   136
  NS_LOG_FUNCTION (this << "UlTxPDU" << cellId << imsi << rnti << (uint32_t) lcid << packetSize);
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   137
  ImsiLcidPair_t p (imsi, lcid);
9819
383faf43ae39 fixed Bug 1630 - spurious RX packets in DlRlcStats
Nicola Baldo <nbaldo@cttc.es>
parents: 9619
diff changeset
   138
  if (Simulator::Now () >= m_startTime)
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   139
    {
9382
a058179c3d9d Fix JIRA LENA-284, cellId was not being reported in some callbacks and in some situations cellId was being reported 0, now fixed and reporting always correct cellId
Jaume Nin
parents: 8697
diff changeset
   140
      m_ulCellId[p] = cellId;
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   141
      m_flowId[p] = LteFlowId_t (rnti, lcid);
8055
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   142
      m_ulTxPackets[p]++;
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   143
      m_ulTxData[p] += packetSize;
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   144
    }
8697
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
   145
  m_pendingOutput = true;
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   146
}
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   147
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   148
void
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   149
RadioBearerStatsCalculator::DlTxPdu (uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize)
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   150
{
9619
82a76cadf1ee better log statements in RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 9614
diff changeset
   151
  NS_LOG_FUNCTION (this << "DlTxPDU" << cellId << imsi << rnti << (uint32_t) lcid << packetSize);
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   152
  ImsiLcidPair_t p (imsi, lcid);
9819
383faf43ae39 fixed Bug 1630 - spurious RX packets in DlRlcStats
Nicola Baldo <nbaldo@cttc.es>
parents: 9619
diff changeset
   153
  if (Simulator::Now () >= m_startTime)
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   154
    {
8491
97a454b21dc8 Fix bug in updating epoch times
Jaume Nin
parents: 8461
diff changeset
   155
      m_dlCellId[p] = cellId;
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   156
      m_flowId[p] = LteFlowId_t (rnti, lcid);
8055
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   157
      m_dlTxPackets[p]++;
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   158
      m_dlTxData[p] += packetSize;
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   159
    }
8697
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
   160
  m_pendingOutput = true;
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   161
}
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   162
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   163
void
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   164
RadioBearerStatsCalculator::UlRxPdu (uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize,
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   165
                                     uint64_t delay)
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   166
{
9619
82a76cadf1ee better log statements in RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 9614
diff changeset
   167
  NS_LOG_FUNCTION (this << "UlRxPDU" << cellId << imsi << rnti << (uint32_t) lcid << packetSize << delay);
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   168
  ImsiLcidPair_t p (imsi, lcid);
9819
383faf43ae39 fixed Bug 1630 - spurious RX packets in DlRlcStats
Nicola Baldo <nbaldo@cttc.es>
parents: 9619
diff changeset
   169
  if (Simulator::Now () >= m_startTime)
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   170
    {
8491
97a454b21dc8 Fix bug in updating epoch times
Jaume Nin
parents: 8461
diff changeset
   171
      m_ulCellId[p] = cellId;
8055
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   172
      m_ulRxPackets[p]++;
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   173
      m_ulRxData[p] += packetSize;
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   174
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   175
      Uint64StatsMap::iterator it = m_ulDelay.find (p);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   176
      if (it == m_ulDelay.end ())
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   177
        {
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   178
          NS_LOG_DEBUG (this << " Creating UL stats calculators for IMSI " << p.m_imsi << " and LCID " << (uint32_t) p.m_lcId);
8055
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   179
          m_ulDelay[p] = CreateObject<MinMaxAvgTotalCalculator<uint64_t> > ();
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   180
          m_ulPduSize[p] = CreateObject<MinMaxAvgTotalCalculator<uint32_t> > ();
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   181
        }
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   182
      m_ulDelay[p]->Update (delay);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   183
      m_ulPduSize[p]->Update (packetSize);
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   184
    }
8697
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
   185
  m_pendingOutput = true;
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   186
}
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   187
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   188
void
9382
a058179c3d9d Fix JIRA LENA-284, cellId was not being reported in some callbacks and in some situations cellId was being reported 0, now fixed and reporting always correct cellId
Jaume Nin
parents: 8697
diff changeset
   189
RadioBearerStatsCalculator::DlRxPdu (uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay)
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   190
{
9619
82a76cadf1ee better log statements in RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 9614
diff changeset
   191
  NS_LOG_FUNCTION (this << "DlRxPDU" << cellId << imsi << rnti << (uint32_t) lcid << packetSize << delay);
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   192
  ImsiLcidPair_t p (imsi, lcid);
9819
383faf43ae39 fixed Bug 1630 - spurious RX packets in DlRlcStats
Nicola Baldo <nbaldo@cttc.es>
parents: 9619
diff changeset
   193
  if (Simulator::Now () >= m_startTime)
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   194
    {
9382
a058179c3d9d Fix JIRA LENA-284, cellId was not being reported in some callbacks and in some situations cellId was being reported 0, now fixed and reporting always correct cellId
Jaume Nin
parents: 8697
diff changeset
   195
      m_dlCellId[p] = cellId;
8055
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   196
      m_dlRxPackets[p]++;
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   197
      m_dlRxData[p] += packetSize;
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   198
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   199
      Uint64StatsMap::iterator it = m_dlDelay.find (p);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   200
      if (it == m_dlDelay.end ())
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   201
        {
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   202
          NS_LOG_DEBUG (this << " Creating DL stats calculators for IMSI " << p.m_imsi << " and LCID " << (uint32_t) p.m_lcId);
8055
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   203
          m_dlDelay[p] = CreateObject<MinMaxAvgTotalCalculator<uint64_t> > ();
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   204
          m_dlPduSize[p] = CreateObject<MinMaxAvgTotalCalculator<uint32_t> > ();
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   205
        }
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   206
      m_dlDelay[p]->Update (delay);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   207
      m_dlPduSize[p]->Update (packetSize);
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   208
    }
8697
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
   209
  m_pendingOutput = true;
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   210
}
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   211
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   212
void
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
   213
RadioBearerStatsCalculator::ShowResults (void)
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   214
{
7916
931ab6dd9ffb write Rlc Status into a file
mrequena
parents: 7905
diff changeset
   215
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   216
  NS_LOG_FUNCTION (this << GetUlOutputFilename ().c_str () << GetDlOutputFilename ().c_str ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   217
  NS_LOG_INFO ("Write Rlc Stats in " << GetUlOutputFilename ().c_str () << " and in " << GetDlOutputFilename ().c_str ());
8149
810e24692db8 run check-style on src/lte/
Nicola Baldo <nbaldo@cttc.es>
parents: 8139
diff changeset
   218
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   219
  std::ofstream ulOutFile;
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   220
  std::ofstream dlOutFile;
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   221
8160
3acc5e72aa88 Added CellId output to RlcStats file
jnin
parents: 8149
diff changeset
   222
  if (m_firstWrite == true)
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   223
    {
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   224
      ulOutFile.open (GetUlOutputFilename ().c_str ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   225
      if (!ulOutFile.is_open ())
8149
810e24692db8 run check-style on src/lte/
Nicola Baldo <nbaldo@cttc.es>
parents: 8139
diff changeset
   226
        {
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   227
          NS_LOG_ERROR ("Can't open file " << GetUlOutputFilename ().c_str ());
8149
810e24692db8 run check-style on src/lte/
Nicola Baldo <nbaldo@cttc.es>
parents: 8139
diff changeset
   228
          return;
810e24692db8 run check-style on src/lte/
Nicola Baldo <nbaldo@cttc.es>
parents: 8139
diff changeset
   229
        }
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   230
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   231
      dlOutFile.open (GetDlOutputFilename ().c_str ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   232
      if (!dlOutFile.is_open ())
8149
810e24692db8 run check-style on src/lte/
Nicola Baldo <nbaldo@cttc.es>
parents: 8139
diff changeset
   233
        {
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   234
          NS_LOG_ERROR ("Can't open file " << GetDlOutputFilename ().c_str ());
8149
810e24692db8 run check-style on src/lte/
Nicola Baldo <nbaldo@cttc.es>
parents: 8139
diff changeset
   235
          return;
810e24692db8 run check-style on src/lte/
Nicola Baldo <nbaldo@cttc.es>
parents: 8139
diff changeset
   236
        }
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   237
      m_firstWrite = false;
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   238
      ulOutFile << "% start\tend\tCellId\tIMSI\tRNTI\tLCID\tnTxPDUs\tTxBytes\tnRxPDUs\tRxBytes\t";
7957
76943b3e9d60 Made RLC output readeable to humans
jnin
parents: 7954
diff changeset
   239
      ulOutFile << "delay\tstdDev\tmin\tmax\t";
76943b3e9d60 Made RLC output readeable to humans
jnin
parents: 7954
diff changeset
   240
      ulOutFile << "PduSize\tstdDev\tmin\tmax";
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   241
      ulOutFile << std::endl;
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   242
      dlOutFile << "% start\tend\tCellId\tIMSI\tRNTI\tLCID\tnTxPDUs\tTxBytes\tnRxPDUs\tRxBytes\t";
7957
76943b3e9d60 Made RLC output readeable to humans
jnin
parents: 7954
diff changeset
   243
      dlOutFile << "delay\tstdDev\tmin\tmax\t";
76943b3e9d60 Made RLC output readeable to humans
jnin
parents: 7954
diff changeset
   244
      dlOutFile << "PduSize\tstdDev\tmin\tmax";
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   245
      dlOutFile << std::endl;
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   246
    }
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   247
  else
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   248
    {
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   249
      ulOutFile.open (GetUlOutputFilename ().c_str (), std::ios_base::app);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   250
      if (!ulOutFile.is_open ())
8149
810e24692db8 run check-style on src/lte/
Nicola Baldo <nbaldo@cttc.es>
parents: 8139
diff changeset
   251
        {
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   252
          NS_LOG_ERROR ("Can't open file " << GetUlOutputFilename ().c_str ());
8149
810e24692db8 run check-style on src/lte/
Nicola Baldo <nbaldo@cttc.es>
parents: 8139
diff changeset
   253
          return;
810e24692db8 run check-style on src/lte/
Nicola Baldo <nbaldo@cttc.es>
parents: 8139
diff changeset
   254
        }
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   255
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   256
      dlOutFile.open (GetDlOutputFilename ().c_str (), std::ios_base::app);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   257
      if (!dlOutFile.is_open ())
8149
810e24692db8 run check-style on src/lte/
Nicola Baldo <nbaldo@cttc.es>
parents: 8139
diff changeset
   258
        {
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   259
          NS_LOG_ERROR ("Can't open file " << GetDlOutputFilename ().c_str ());
8149
810e24692db8 run check-style on src/lte/
Nicola Baldo <nbaldo@cttc.es>
parents: 8139
diff changeset
   260
          return;
810e24692db8 run check-style on src/lte/
Nicola Baldo <nbaldo@cttc.es>
parents: 8139
diff changeset
   261
        }
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   262
    }
7916
931ab6dd9ffb write Rlc Status into a file
mrequena
parents: 7905
diff changeset
   263
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   264
  WriteUlResults (ulOutFile);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   265
  WriteDlResults (dlOutFile);
8697
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
   266
  m_pendingOutput = false;
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   267
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   268
}
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   269
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   270
void
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
   271
RadioBearerStatsCalculator::WriteUlResults (std::ofstream& outFile)
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   272
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   273
  NS_LOG_FUNCTION (this);
8403
9aa1e4eb642d improved logging in rlc-stats-calculator.cc
Nicola Baldo <nbaldo@cttc.es>
parents: 8266
diff changeset
   274
8055
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   275
  // Get the unique IMSI / LCID list
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   276
8491
97a454b21dc8 Fix bug in updating epoch times
Jaume Nin
parents: 8461
diff changeset
   277
  std::vector < ImsiLcidPair_t > pairVector;
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   278
  for (Uint32Map::iterator it = m_ulTxPackets.begin (); it != m_ulTxPackets.end (); ++it)
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   279
    {
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   280
      if (find (pairVector.begin (), pairVector.end (), (*it).first) == pairVector.end ())
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   281
        {
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   282
          pairVector.push_back ((*it).first);
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   283
        }
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   284
    }
7916
931ab6dd9ffb write Rlc Status into a file
mrequena
parents: 7905
diff changeset
   285
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   286
  Time endTime = m_startTime + m_epochDuration;
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   287
  for (std::vector<ImsiLcidPair_t>::iterator it = pairVector.begin (); it != pairVector.end (); ++it)
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   288
    {
8266
3a30a2b5c94c Refactoring of the statistics classes to avoid continious calls to the attribute system.
jaumenin
parents: 8261
diff changeset
   289
      ImsiLcidPair_t p = *it;
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   290
      outFile << m_startTime.GetNanoSeconds () / 1.0e9 << "\t";
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   291
      outFile << endTime.GetNanoSeconds () / 1.0e9 << "\t";
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   292
      outFile << GetUlCellId (p.m_imsi, p.m_lcId) << "\t";
8160
3acc5e72aa88 Added CellId output to RlcStats file
jnin
parents: 8149
diff changeset
   293
      outFile << p.m_imsi << "\t";
3acc5e72aa88 Added CellId output to RlcStats file
jnin
parents: 8149
diff changeset
   294
      outFile << m_flowId[p].m_rnti << "\t";
3acc5e72aa88 Added CellId output to RlcStats file
jnin
parents: 8149
diff changeset
   295
      outFile << (uint32_t) m_flowId[p].m_lcId << "\t";
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   296
      outFile << GetUlTxPackets (p.m_imsi, p.m_lcId) << "\t";
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   297
      outFile << GetUlTxData (p.m_imsi, p.m_lcId) << "\t";
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   298
      outFile << GetUlRxPackets (p.m_imsi, p.m_lcId) << "\t";
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   299
      outFile << GetUlRxData (p.m_imsi, p.m_lcId) << "\t";
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   300
      std::vector<double> stats = GetUlDelayStats (p.m_imsi, p.m_lcId);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   301
      for (std::vector<double>::iterator it = stats.begin (); it != stats.end (); ++it)
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   302
        {
7957
76943b3e9d60 Made RLC output readeable to humans
jnin
parents: 7954
diff changeset
   303
          outFile << (*it) * 1e-9 << "\t";
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   304
        }
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   305
      stats = GetUlPduSizeStats (p.m_imsi, p.m_lcId);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   306
      for (std::vector<double>::iterator it = stats.begin (); it != stats.end (); ++it)
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   307
        {
7957
76943b3e9d60 Made RLC output readeable to humans
jnin
parents: 7954
diff changeset
   308
          outFile << (*it) << "\t";
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   309
        }
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   310
      outFile << std::endl;
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   311
    }
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   312
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   313
  outFile.close ();
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   314
}
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   315
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   316
void
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
   317
RadioBearerStatsCalculator::WriteDlResults (std::ofstream& outFile)
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   318
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   319
  NS_LOG_FUNCTION (this);
8403
9aa1e4eb642d improved logging in rlc-stats-calculator.cc
Nicola Baldo <nbaldo@cttc.es>
parents: 8266
diff changeset
   320
8007
845888b95c15 Added IMSI output to RLC outpu
jnin
parents: 7971
diff changeset
   321
  // Get the unique IMSI list
8491
97a454b21dc8 Fix bug in updating epoch times
Jaume Nin
parents: 8461
diff changeset
   322
  std::vector < ImsiLcidPair_t > pairVector;
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   323
  for (Uint32Map::iterator it = m_dlTxPackets.begin (); it != m_dlTxPackets.end (); ++it)
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   324
    {
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   325
      if (find (pairVector.begin (), pairVector.end (), (*it).first) == pairVector.end ())
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   326
        {
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   327
          pairVector.push_back ((*it).first);
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   328
        }
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   329
    }
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   330
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   331
  Time endTime = m_startTime + m_epochDuration;
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   332
  for (std::vector<ImsiLcidPair_t>::iterator pair = pairVector.begin (); pair != pairVector.end (); ++pair)
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   333
    {
8266
3a30a2b5c94c Refactoring of the statistics classes to avoid continious calls to the attribute system.
jaumenin
parents: 8261
diff changeset
   334
      ImsiLcidPair_t p = *pair;
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   335
      outFile << m_startTime.GetNanoSeconds () / 1.0e9 << "\t";
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   336
      outFile << endTime.GetNanoSeconds () / 1.0e9 << "\t";
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   337
      outFile << GetDlCellId (p.m_imsi, p.m_lcId) << "\t";
8160
3acc5e72aa88 Added CellId output to RlcStats file
jnin
parents: 8149
diff changeset
   338
      outFile << p.m_imsi << "\t";
3acc5e72aa88 Added CellId output to RlcStats file
jnin
parents: 8149
diff changeset
   339
      outFile << m_flowId[p].m_rnti << "\t";
3acc5e72aa88 Added CellId output to RlcStats file
jnin
parents: 8149
diff changeset
   340
      outFile << (uint32_t) m_flowId[p].m_lcId << "\t";
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   341
      outFile << GetDlTxPackets (p.m_imsi, p.m_lcId) << "\t";
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   342
      outFile << GetDlTxData (p.m_imsi, p.m_lcId) << "\t";
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   343
      outFile << GetDlRxPackets (p.m_imsi, p.m_lcId) << "\t";
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   344
      outFile << GetDlRxData (p.m_imsi, p.m_lcId) << "\t";
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   345
      std::vector<double> stats = GetDlDelayStats (p.m_imsi, p.m_lcId);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   346
      for (std::vector<double>::iterator it = stats.begin (); it != stats.end (); ++it)
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   347
        {
7957
76943b3e9d60 Made RLC output readeable to humans
jnin
parents: 7954
diff changeset
   348
          outFile << (*it) * 1e-9 << "\t";
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   349
        }
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   350
      stats = GetDlPduSizeStats (p.m_imsi, p.m_lcId);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   351
      for (std::vector<double>::iterator it = stats.begin (); it != stats.end (); ++it)
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   352
        {
7957
76943b3e9d60 Made RLC output readeable to humans
jnin
parents: 7954
diff changeset
   353
          outFile << (*it) << "\t";
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   354
        }
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   355
      outFile << std::endl;
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   356
    }
8007
845888b95c15 Added IMSI output to RLC outpu
jnin
parents: 7971
diff changeset
   357
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   358
  outFile.close ();
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   359
}
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   360
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   361
void
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
   362
RadioBearerStatsCalculator::ResetResults (void)
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   363
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   364
  NS_LOG_FUNCTION (this);
8403
9aa1e4eb642d improved logging in rlc-stats-calculator.cc
Nicola Baldo <nbaldo@cttc.es>
parents: 8266
diff changeset
   365
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   366
  m_ulTxPackets.erase (m_ulTxPackets.begin (), m_ulTxPackets.end ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   367
  m_ulRxPackets.erase (m_ulRxPackets.begin (), m_ulRxPackets.end ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   368
  m_ulRxData.erase (m_ulRxData.begin (), m_ulRxData.end ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   369
  m_ulTxData.erase (m_ulTxData.begin (), m_ulTxData.end ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   370
  m_ulDelay.erase (m_ulDelay.begin (), m_ulDelay.end ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   371
  m_ulPduSize.erase (m_ulPduSize.begin (), m_ulPduSize.end ());
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   372
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   373
  m_dlTxPackets.erase (m_dlTxPackets.begin (), m_dlTxPackets.end ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   374
  m_dlRxPackets.erase (m_dlRxPackets.begin (), m_dlRxPackets.end ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   375
  m_dlRxData.erase (m_dlRxData.begin (), m_dlRxData.end ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   376
  m_dlTxData.erase (m_dlTxData.begin (), m_dlTxData.end ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   377
  m_dlDelay.erase (m_dlDelay.begin (), m_dlDelay.end ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   378
  m_dlPduSize.erase (m_dlPduSize.begin (), m_dlPduSize.end ());
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   379
}
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   380
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   381
void
9614
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   382
RadioBearerStatsCalculator::RescheduleEndEpoch (void)
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   383
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   384
  NS_LOG_FUNCTION (this);
9614
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   385
  m_endEpochEvent.Cancel ();
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   386
  NS_ASSERT (Simulator::Now ().GetMilliSeconds () == 0); // below event time assumes this
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   387
  m_endEpochEvent = Simulator::Schedule (m_startTime + m_epochDuration, &RadioBearerStatsCalculator::EndEpoch, this);
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   388
}
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   389
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   390
void
9614
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   391
RadioBearerStatsCalculator::EndEpoch (void)
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   392
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   393
  NS_LOG_FUNCTION (this);
9614
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   394
  ShowResults ();
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   395
  ResetResults ();
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   396
  m_startTime += m_epochDuration;
c1df336c06f8 RadioBearerStatsCalculator: handle end epoch via scheduled event
Nicola Baldo <nbaldo@cttc.es>
parents: 9382
diff changeset
   397
  m_endEpochEvent = Simulator::Schedule (m_epochDuration, &RadioBearerStatsCalculator::EndEpoch, this);
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   398
}
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   399
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   400
uint32_t
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
   401
RadioBearerStatsCalculator::GetUlTxPackets (uint64_t imsi, uint8_t lcid)
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   402
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   403
  NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   404
  ImsiLcidPair_t p (imsi, lcid);
8055
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   405
  return m_ulTxPackets[p];
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   406
}
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   407
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   408
uint32_t
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
   409
RadioBearerStatsCalculator::GetUlRxPackets (uint64_t imsi, uint8_t lcid)
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   410
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   411
  NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   412
  ImsiLcidPair_t p (imsi, lcid);
8055
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   413
  return m_ulRxPackets[p];
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   414
}
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   415
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   416
uint64_t
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
   417
RadioBearerStatsCalculator::GetUlTxData (uint64_t imsi, uint8_t lcid)
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   418
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   419
  NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   420
  ImsiLcidPair_t p (imsi, lcid);
8055
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   421
  return m_ulTxData[p];
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   422
}
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   423
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   424
uint64_t
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
   425
RadioBearerStatsCalculator::GetUlRxData (uint64_t imsi, uint8_t lcid)
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   426
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   427
  NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   428
  ImsiLcidPair_t p (imsi, lcid);
8055
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   429
  return m_ulRxData[p];
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   430
}
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   431
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   432
double
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
   433
RadioBearerStatsCalculator::GetUlDelay (uint64_t imsi, uint8_t lcid)
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   434
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   435
  NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   436
  ImsiLcidPair_t p (imsi, lcid);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   437
  Uint64StatsMap::iterator it = m_ulDelay.find (p);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   438
  if (it == m_ulDelay.end ())
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   439
    {
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   440
      NS_LOG_ERROR ("UL delay for " << imsi << " - " << (uint16_t) lcid << " not found");
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   441
      return 0;
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   442
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   443
    }
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   444
  return m_ulDelay[p]->getMean ();
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   445
}
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   446
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   447
std::vector<double>
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
   448
RadioBearerStatsCalculator::GetUlDelayStats (uint64_t imsi, uint8_t lcid)
7941
c92f27568aef Fixed throughput calculation
jnin
parents: 7940
diff changeset
   449
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   450
  NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   451
  ImsiLcidPair_t p (imsi, lcid);
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   452
  std::vector<double> stats;
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   453
  Uint64StatsMap::iterator it = m_ulDelay.find (p);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   454
  if (it == m_ulDelay.end ())
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   455
    {
8650
9e372de3b581 zero stats when no PDU received
iptech@cttc.cat
parents: 8540
diff changeset
   456
      stats.push_back (0.0);
9e372de3b581 zero stats when no PDU received
iptech@cttc.cat
parents: 8540
diff changeset
   457
      stats.push_back (0.0);
9e372de3b581 zero stats when no PDU received
iptech@cttc.cat
parents: 8540
diff changeset
   458
      stats.push_back (0.0);
9e372de3b581 zero stats when no PDU received
iptech@cttc.cat
parents: 8540
diff changeset
   459
      stats.push_back (0.0);
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   460
      return stats;
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   461
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   462
    }
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   463
  stats.push_back (m_ulDelay[p]->getMean ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   464
  stats.push_back (m_ulDelay[p]->getStddev ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   465
  stats.push_back (m_ulDelay[p]->getMin ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   466
  stats.push_back (m_ulDelay[p]->getMax ());
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   467
  return stats;
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   468
}
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   469
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   470
std::vector<double>
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
   471
RadioBearerStatsCalculator::GetUlPduSizeStats (uint64_t imsi, uint8_t lcid)
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   472
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   473
  NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   474
  ImsiLcidPair_t p (imsi, lcid);
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   475
  std::vector<double> stats;
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   476
  Uint32StatsMap::iterator it = m_ulPduSize.find (p);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   477
  if (it == m_ulPduSize.end ())
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   478
    {
8650
9e372de3b581 zero stats when no PDU received
iptech@cttc.cat
parents: 8540
diff changeset
   479
      stats.push_back (0.0);
9e372de3b581 zero stats when no PDU received
iptech@cttc.cat
parents: 8540
diff changeset
   480
      stats.push_back (0.0);
9e372de3b581 zero stats when no PDU received
iptech@cttc.cat
parents: 8540
diff changeset
   481
      stats.push_back (0.0);
9e372de3b581 zero stats when no PDU received
iptech@cttc.cat
parents: 8540
diff changeset
   482
      stats.push_back (0.0);
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   483
      return stats;
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   484
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   485
    }
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   486
  stats.push_back (m_ulPduSize[p]->getMean ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   487
  stats.push_back (m_ulPduSize[p]->getStddev ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   488
  stats.push_back (m_ulPduSize[p]->getMin ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   489
  stats.push_back (m_ulPduSize[p]->getMax ());
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   490
  return stats;
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   491
}
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   492
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   493
uint32_t
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
   494
RadioBearerStatsCalculator::GetDlTxPackets (uint64_t imsi, uint8_t lcid)
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   495
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   496
  NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   497
  ImsiLcidPair_t p (imsi, lcid);
8055
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   498
  return m_dlTxPackets[p];
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   499
}
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   500
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   501
uint32_t
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
   502
RadioBearerStatsCalculator::GetDlRxPackets (uint64_t imsi, uint8_t lcid)
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   503
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   504
  NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   505
  ImsiLcidPair_t p (imsi, lcid);
8055
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   506
  return m_dlRxPackets[p];
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   507
}
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   508
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   509
uint64_t
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
   510
RadioBearerStatsCalculator::GetDlTxData (uint64_t imsi, uint8_t lcid)
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   511
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   512
  NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   513
  ImsiLcidPair_t p (imsi, lcid);
8055
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   514
  return m_dlTxData[p];
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   515
}
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   516
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   517
uint64_t
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
   518
RadioBearerStatsCalculator::GetDlRxData (uint64_t imsi, uint8_t lcid)
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   519
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   520
  NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   521
  ImsiLcidPair_t p (imsi, lcid);
8055
235d5e4ff8b0 Added Doxygen documentation to RlcStats
jnin
parents: 8034
diff changeset
   522
  return m_dlRxData[p];
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   523
}
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   524
8160
3acc5e72aa88 Added CellId output to RlcStats file
jnin
parents: 8149
diff changeset
   525
uint32_t
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
   526
RadioBearerStatsCalculator::GetUlCellId (uint64_t imsi, uint8_t lcid)
8160
3acc5e72aa88 Added CellId output to RlcStats file
jnin
parents: 8149
diff changeset
   527
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   528
  NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   529
  ImsiLcidPair_t p (imsi, lcid);
8160
3acc5e72aa88 Added CellId output to RlcStats file
jnin
parents: 8149
diff changeset
   530
  return m_ulCellId[p];
3acc5e72aa88 Added CellId output to RlcStats file
jnin
parents: 8149
diff changeset
   531
}
3acc5e72aa88 Added CellId output to RlcStats file
jnin
parents: 8149
diff changeset
   532
3acc5e72aa88 Added CellId output to RlcStats file
jnin
parents: 8149
diff changeset
   533
uint32_t
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
   534
RadioBearerStatsCalculator::GetDlCellId (uint64_t imsi, uint8_t lcid)
8160
3acc5e72aa88 Added CellId output to RlcStats file
jnin
parents: 8149
diff changeset
   535
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   536
  NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   537
  ImsiLcidPair_t p (imsi, lcid);
8160
3acc5e72aa88 Added CellId output to RlcStats file
jnin
parents: 8149
diff changeset
   538
  return m_dlCellId[p];
3acc5e72aa88 Added CellId output to RlcStats file
jnin
parents: 8149
diff changeset
   539
}
3acc5e72aa88 Added CellId output to RlcStats file
jnin
parents: 8149
diff changeset
   540
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   541
double
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
   542
RadioBearerStatsCalculator::GetDlDelay (uint64_t imsi, uint8_t lcid)
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   543
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   544
  NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   545
  ImsiLcidPair_t p (imsi, lcid);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   546
  Uint64StatsMap::iterator it = m_dlDelay.find (p);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   547
  if (it == m_dlDelay.end ())
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   548
    {
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   549
      NS_LOG_ERROR ("DL delay for " << imsi << " not found");
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   550
      return 0;
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   551
    }
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   552
  return m_dlDelay[p]->getMean ();
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   553
}
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   554
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   555
std::vector<double>
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
   556
RadioBearerStatsCalculator::GetDlDelayStats (uint64_t imsi, uint8_t lcid)
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   557
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   558
  NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   559
  ImsiLcidPair_t p (imsi, lcid);
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   560
  std::vector<double> stats;
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   561
  Uint64StatsMap::iterator it = m_dlDelay.find (p);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   562
  if (it == m_dlDelay.end ())
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   563
    {
8650
9e372de3b581 zero stats when no PDU received
iptech@cttc.cat
parents: 8540
diff changeset
   564
      stats.push_back (0.0);
9e372de3b581 zero stats when no PDU received
iptech@cttc.cat
parents: 8540
diff changeset
   565
      stats.push_back (0.0);
9e372de3b581 zero stats when no PDU received
iptech@cttc.cat
parents: 8540
diff changeset
   566
      stats.push_back (0.0);
9e372de3b581 zero stats when no PDU received
iptech@cttc.cat
parents: 8540
diff changeset
   567
      stats.push_back (0.0);
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   568
      return stats;
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   569
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   570
    }
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   571
  stats.push_back (m_dlDelay[p]->getMean ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   572
  stats.push_back (m_dlDelay[p]->getStddev ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   573
  stats.push_back (m_dlDelay[p]->getMin ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   574
  stats.push_back (m_dlDelay[p]->getMax ());
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   575
  return stats;
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   576
}
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   577
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   578
std::vector<double>
8461
71ddd85a693b RlcStatsCalculator --> RadioBearerStatsCalculator
Nicola Baldo <nbaldo@cttc.es>
parents: 8403
diff changeset
   579
RadioBearerStatsCalculator::GetDlPduSizeStats (uint64_t imsi, uint8_t lcid)
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   580
{
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   581
  NS_LOG_FUNCTION (this << imsi << (uint16_t) lcid);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   582
  ImsiLcidPair_t p (imsi, lcid);
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   583
  std::vector<double> stats;
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   584
  Uint32StatsMap::iterator it = m_dlPduSize.find (p);
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   585
  if (it == m_dlPduSize.end ())
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   586
    {
8650
9e372de3b581 zero stats when no PDU received
iptech@cttc.cat
parents: 8540
diff changeset
   587
      stats.push_back (0.0);
9e372de3b581 zero stats when no PDU received
iptech@cttc.cat
parents: 8540
diff changeset
   588
      stats.push_back (0.0);
9e372de3b581 zero stats when no PDU received
iptech@cttc.cat
parents: 8540
diff changeset
   589
      stats.push_back (0.0);
9e372de3b581 zero stats when no PDU received
iptech@cttc.cat
parents: 8540
diff changeset
   590
      stats.push_back (0.0);
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   591
      return stats;
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   592
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   593
    }
8494
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   594
  stats.push_back (m_dlPduSize[p]->getMean ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   595
  stats.push_back (m_dlPduSize[p]->getStddev ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   596
  stats.push_back (m_dlPduSize[p]->getMin ());
00f009a467e3 Code style fix
Jaume Nin
parents: 8491
diff changeset
   597
  stats.push_back (m_dlPduSize[p]->getMax ());
7954
80e46addfeee Added DL and UL RLC performance
jnin
parents: 7941
diff changeset
   598
  return stats;
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   599
}
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   600
8540
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   601
std::string
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   602
RadioBearerStatsCalculator::GetUlOutputFilename (void)
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   603
{
8697
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
   604
  if (m_protocolType == "RLC")
8540
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   605
    {
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   606
      return LteStatsCalculator::GetUlOutputFilename ();
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   607
    }
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   608
  else
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   609
    {
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   610
      return GetUlPdcpOutputFilename ();
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   611
    }
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   612
}
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   613
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   614
std::string
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   615
RadioBearerStatsCalculator::GetDlOutputFilename (void)
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   616
{
8697
9e9c590a80ea don't generate bearer stats files when stats are inactive
Nicola Baldo <nbaldo@cttc.es>
parents: 8650
diff changeset
   617
  if (m_protocolType == "RLC")
8540
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   618
    {
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   619
      return LteStatsCalculator::GetDlOutputFilename ();
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   620
    }
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   621
  else
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   622
    {
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   623
      return GetDlPdcpOutputFilename ();
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   624
    }
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   625
}
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   626
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   627
void
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   628
RadioBearerStatsCalculator::SetUlPdcpOutputFilename (std::string outputFilename)
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   629
{
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   630
  m_ulPdcpOutputFilename = outputFilename;
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   631
}
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   632
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   633
std::string
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   634
RadioBearerStatsCalculator::GetUlPdcpOutputFilename (void)
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   635
{
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   636
  return m_ulPdcpOutputFilename;
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   637
}
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   638
void
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   639
RadioBearerStatsCalculator::SetDlPdcpOutputFilename (std::string outputFilename)
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   640
{
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   641
  m_dlPdcpOutputFilename = outputFilename;
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   642
}
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   643
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   644
std::string
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   645
RadioBearerStatsCalculator::GetDlPdcpOutputFilename (void)
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   646
{
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   647
  return m_dlPdcpOutputFilename;
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   648
}
5e6afc302fb2 Moved all output filenames to attributes
Jaume Nin
parents: 8494
diff changeset
   649
7905
80557b09aa7f Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
diff changeset
   650
} // namespace ns3