A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
phy-tx-stats-calculator.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Jaume Nin <jnin@cttc.es>
18
* modified by: Marco Miozzo <mmiozzo@cttc.es>
19
* Convert MacStatsCalculator in PhyTxStatsCalculator
20
*/
21
22
#ifndef PHY_TX_STATS_CALCULATOR_H_
23
#define PHY_TX_STATS_CALCULATOR_H_
24
25
#include "
lte-stats-calculator.h
"
26
27
#include "ns3/nstime.h"
28
#include "ns3/uinteger.h"
29
#include <ns3/lte-common.h>
30
31
#include <fstream>
32
#include <string>
33
34
namespace
ns3
35
{
36
37
/**
38
* \ingroup lte
39
*
40
* Takes care of storing the information generated at PHY layer regarding
41
* transmission. Metrics saved are:
42
*
43
* - Timestamp (in seconds)
44
* - Frame index
45
* - Subframe index
46
* - C-RNTI
47
* - MCS for transport block 1
48
* - Size of transport block 1
49
* - MCS for transport block 2 (0 if not used)
50
* - Size of transport block 2 (0 if not used)
51
*/
52
class
PhyTxStatsCalculator
:
public
LteStatsCalculator
53
{
54
public
:
55
/**
56
* Constructor
57
*/
58
PhyTxStatsCalculator
();
59
60
/**
61
* Destructor
62
*/
63
~PhyTxStatsCalculator
()
override
;
64
65
// Inherited from ns3::Object
66
/**
67
* Register this type.
68
* \return The object TypeId.
69
*/
70
static
TypeId
GetTypeId
();
71
72
/**
73
* Set the name of the file where the UL Tx PHY statistics will be stored.
74
*
75
* @param outputFilename string with the name of the file
76
*/
77
void
SetUlTxOutputFilename
(std::string outputFilename);
78
79
/**
80
* Get the name of the file where the UL RX PHY statistics will be stored.
81
* @return the name of the file where the UL RX PHY statistics will be stored
82
*/
83
std::string
GetUlTxOutputFilename
();
84
85
/**
86
* Set the name of the file where the DL TX PHY statistics will be stored.
87
*
88
* @param outputFilename string with the name of the file
89
*/
90
void
SetDlTxOutputFilename
(std::string outputFilename);
91
92
/**
93
* Get the name of the file where the DL TX PHY statistics will be stored.
94
* @return the name of the file where the DL TX PHY statistics will be stored
95
*/
96
std::string
GetDlTxOutputFilename
();
97
98
/**
99
* Notifies the stats calculator that an downlink transmission has occurred.
100
* @param params Trace information regarding PHY transmission stats
101
*/
102
void
DlPhyTransmission
(
PhyTransmissionStatParameters
params);
103
104
/**
105
* Notifies the stats calculator that an uplink transmission has occurred.
106
* @param params Trace information regarding PHY transmission stats
107
*/
108
void
UlPhyTransmission
(
PhyTransmissionStatParameters
params);
109
110
/**
111
* trace sink
112
*
113
* \param phyTxStats
114
* \param path
115
* \param params
116
*/
117
static
void
DlPhyTransmissionCallback
(
Ptr<PhyTxStatsCalculator>
phyTxStats,
118
std::string path,
119
PhyTransmissionStatParameters
params);
120
121
/**
122
* trace sink
123
*
124
* \param phyTxStats
125
* \param path
126
* \param params
127
*/
128
static
void
UlPhyTransmissionCallback
(
Ptr<PhyTxStatsCalculator>
phyTxStats,
129
std::string path,
130
PhyTransmissionStatParameters
params);
131
132
private
:
133
/**
134
* When writing DL TX PHY statistics first time to file,
135
* columns description is added. Then next lines are
136
* appended to file. This value is true if output
137
* files have not been opened yet
138
*/
139
bool
m_dlTxFirstWrite
;
140
141
/**
142
* When writing UL TX PHY statistics first time to file,
143
* columns description is added. Then next lines are
144
* appended to file. This value is true if output
145
* files have not been opened yet
146
*/
147
bool
m_ulTxFirstWrite
;
148
149
/**
150
* DL TX PHY statistics output trace file
151
*/
152
std::ofstream
m_dlTxOutFile
;
153
154
/**
155
* UL TX PHY statistics output trace file
156
*/
157
std::ofstream
m_ulTxOutFile
;
158
};
159
160
}
// namespace ns3
161
162
#endif
/* PHY_TX_STATS_CALCULATOR_H_ */
ns3::LteStatsCalculator
Base class for ***StatsCalculator classes.
Definition:
lte-stats-calculator.h:40
ns3::PhyTxStatsCalculator
Takes care of storing the information generated at PHY layer regarding transmission.
Definition:
phy-tx-stats-calculator.h:53
ns3::PhyTxStatsCalculator::m_ulTxFirstWrite
bool m_ulTxFirstWrite
When writing UL TX PHY statistics first time to file, columns description is added.
Definition:
phy-tx-stats-calculator.h:147
ns3::PhyTxStatsCalculator::SetDlTxOutputFilename
void SetDlTxOutputFilename(std::string outputFilename)
Set the name of the file where the DL TX PHY statistics will be stored.
Definition:
phy-tx-stats-calculator.cc:90
ns3::PhyTxStatsCalculator::SetUlTxOutputFilename
void SetUlTxOutputFilename(std::string outputFilename)
Set the name of the file where the UL Tx PHY statistics will be stored.
Definition:
phy-tx-stats-calculator.cc:78
ns3::PhyTxStatsCalculator::m_dlTxFirstWrite
bool m_dlTxFirstWrite
When writing DL TX PHY statistics first time to file, columns description is added.
Definition:
phy-tx-stats-calculator.h:139
ns3::PhyTxStatsCalculator::DlPhyTransmissionCallback
static void DlPhyTransmissionCallback(Ptr< PhyTxStatsCalculator > phyTxStats, std::string path, PhyTransmissionStatParameters params)
trace sink
Definition:
phy-tx-stats-calculator.cc:171
ns3::PhyTxStatsCalculator::PhyTxStatsCalculator
PhyTxStatsCalculator()
Constructor.
Definition:
phy-tx-stats-calculator.cc:35
ns3::PhyTxStatsCalculator::m_ulTxOutFile
std::ofstream m_ulTxOutFile
UL TX PHY statistics output trace file.
Definition:
phy-tx-stats-calculator.h:157
ns3::PhyTxStatsCalculator::DlPhyTransmission
void DlPhyTransmission(PhyTransmissionStatParameters params)
Notifies the stats calculator that an downlink transmission has occurred.
Definition:
phy-tx-stats-calculator.cc:102
ns3::PhyTxStatsCalculator::GetDlTxOutputFilename
std::string GetDlTxOutputFilename()
Get the name of the file where the DL TX PHY statistics will be stored.
Definition:
phy-tx-stats-calculator.cc:96
ns3::PhyTxStatsCalculator::m_dlTxOutFile
std::ofstream m_dlTxOutFile
DL TX PHY statistics output trace file.
Definition:
phy-tx-stats-calculator.h:152
ns3::PhyTxStatsCalculator::UlPhyTransmission
void UlPhyTransmission(PhyTransmissionStatParameters params)
Notifies the stats calculator that an uplink transmission has occurred.
Definition:
phy-tx-stats-calculator.cc:136
ns3::PhyTxStatsCalculator::GetUlTxOutputFilename
std::string GetUlTxOutputFilename()
Get the name of the file where the UL RX PHY statistics will be stored.
Definition:
phy-tx-stats-calculator.cc:84
ns3::PhyTxStatsCalculator::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition:
phy-tx-stats-calculator.cc:57
ns3::PhyTxStatsCalculator::UlPhyTransmissionCallback
static void UlPhyTransmissionCallback(Ptr< PhyTxStatsCalculator > phyTxStats, std::string path, PhyTransmissionStatParameters params)
trace sink
Definition:
phy-tx-stats-calculator.cc:195
ns3::PhyTxStatsCalculator::~PhyTxStatsCalculator
~PhyTxStatsCalculator() override
Destructor.
Definition:
phy-tx-stats-calculator.cc:42
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
lte-stats-calculator.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::PhyTransmissionStatParameters
PhyTransmissionStatParameters structure.
Definition:
lte-common.h:188
src
lte
helper
phy-tx-stats-calculator.h
Generated on Tue May 28 2024 23:37:04 for ns-3 by
1.9.6