A Discrete-Event Network Simulator
API
mac-stats-calculator.h
Go to the documentation of this file.
1/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Jaume Nin <jnin@cttc.es>
19 * Modified by: Danilo Abrignani <danilo.abrignani@unibo.it> (Carrier Aggregation - GSoC 2015)
20 * Biljana Bojovic <biljana.bojovic@cttc.es> (Carrier Aggregation)
21 */
22
23#ifndef MAC_STATS_CALCULATOR_H_
24#define MAC_STATS_CALCULATOR_H_
25
26#include "ns3/lte-stats-calculator.h"
27#include "ns3/nstime.h"
28#include "ns3/uinteger.h"
29#include <string>
30#include <fstream>
31#include "ns3/lte-enb-mac.h"
32
33namespace ns3 {
34
49{
50public:
55
59 virtual ~MacStatsCalculator ();
60
61 // Inherited from ns3::Object
66 static TypeId GetTypeId (void);
67
73 void SetUlOutputFilename (std::string outputFilename);
74
79 std::string GetUlOutputFilename (void);
80
86 void SetDlOutputFilename (std::string outputFilename);
87
92 std::string GetDlOutputFilename (void);
93
109 void DlScheduling (uint16_t cellId, uint64_t imsi, DlSchedulingCallbackInfo dlSchedulingCallbackInfo);
110
122 void UlScheduling (uint16_t cellId, uint64_t imsi,uint32_t frameNo, uint32_t subframeNo,
123 uint16_t rnti, uint8_t mcsTb, uint16_t sizeTb, uint8_t componentCarrierId);
124
125
133 static void DlSchedulingCallback (Ptr<MacStatsCalculator> macStats, std::string path, DlSchedulingCallbackInfo dlSchedulingCallbackInfo);
134
147 static void UlSchedulingCallback (Ptr<MacStatsCalculator> macStats, std::string path,
148 uint32_t frameNo, uint32_t subframeNo, uint16_t rnti,
149 uint8_t mcs, uint16_t size, uint8_t componentCarrierId);
150
151
152private:
160
168
172 std::ofstream m_dlOutFile;
173
177 std::ofstream m_ulOutFile;
178};
179
180} // namespace ns3
181
182#endif /* MAC_STATS_CALCULATOR_H_ */
Base class for ***StatsCalculator classes.
Takes care of storing the information generated at MAC layer.
std::string GetDlOutputFilename(void)
Get the name of the file where the downlink statistics will be stored.
std::ofstream m_dlOutFile
Downlink output trace file.
void UlScheduling(uint16_t cellId, uint64_t imsi, uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcsTb, uint16_t sizeTb, uint8_t componentCarrierId)
Notifies the stats calculator that an uplink scheduling has occurred.
bool m_dlFirstWrite
When writing DL MAC statistics first time to file, columns description is added.
static void DlSchedulingCallback(Ptr< MacStatsCalculator > macStats, std::string path, DlSchedulingCallbackInfo dlSchedulingCallbackInfo)
Trace sink for the ns3::LteEnbMac::DlScheduling trace source.
void SetDlOutputFilename(std::string outputFilename)
Set the name of the file where the downlink statistics will be stored.
std::ofstream m_ulOutFile
Uplink output trace file.
std::string GetUlOutputFilename(void)
Get the name of the file where the uplink statistics will be stored.
static void UlSchedulingCallback(Ptr< MacStatsCalculator > macStats, std::string path, uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcs, uint16_t size, uint8_t componentCarrierId)
Trace sink for the ns3::LteEnbMac::UlScheduling trace source.
virtual ~MacStatsCalculator()
Destructor.
void DlScheduling(uint16_t cellId, uint64_t imsi, DlSchedulingCallbackInfo dlSchedulingCallbackInfo)
Notifies the stats calculator that an downlink scheduling has occurred.
void SetUlOutputFilename(std::string outputFilename)
Set the name of the file where the uplink statistics will be stored.
bool m_ulFirstWrite
When writing UL MAC statistics first time to file, columns description is added.
static TypeId GetTypeId(void)
Register this type.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
DlSchedulingCallbackInfo structure.
Definition: lte-common.h:240