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-rx-stats-calculator.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Jaume Nin <jnin@cttc.es>
7
* modified by: Marco Miozzo <mmiozzo@cttc.es>
8
* Convert MacStatsCalculator in PhyRxStatsCalculator
9
*/
10
11
#ifndef PHY_RX_STATS_CALCULATOR_H_
12
#define PHY_RX_STATS_CALCULATOR_H_
13
14
#include "
lte-stats-calculator.h
"
15
16
#include "ns3/nstime.h"
17
#include "ns3/uinteger.h"
18
#include <ns3/lte-common.h>
19
20
#include <fstream>
21
#include <string>
22
23
namespace
ns3
24
{
25
26
/**
27
* @ingroup lte
28
*
29
* Takes care of storing the information generated at PHY layer regarding
30
* reception. Metrics saved are:
31
*
32
* - Timestamp (in seconds)
33
* - Frame index
34
* - Subframe index
35
* - C-RNTI
36
* - MCS for transport block 1
37
* - Size of transport block 1
38
* - MCS for transport block 2 (0 if not used)
39
* - Size of transport block 2 (0 if not used)
40
*/
41
class
PhyRxStatsCalculator
:
public
LteStatsCalculator
42
{
43
public
:
44
/**
45
* Constructor
46
*/
47
PhyRxStatsCalculator
();
48
49
/**
50
* Destructor
51
*/
52
~PhyRxStatsCalculator
()
override
;
53
54
// Inherited from ns3::Object
55
/**
56
* Register this type.
57
* @return The object TypeId.
58
*/
59
static
TypeId
GetTypeId
();
60
61
/**
62
* Set the name of the file where the UL Rx PHY statistics will be stored.
63
*
64
* @param outputFilename string with the name of the file
65
*/
66
void
SetUlRxOutputFilename
(std::string outputFilename);
67
68
/**
69
* Get the name of the file where the UL RX PHY statistics will be stored.
70
* @return the name of the file where the UL RX PHY statistics will be stored
71
*/
72
std::string
GetUlRxOutputFilename
();
73
74
/**
75
* Set the name of the file where the DL RX PHY statistics will be stored.
76
*
77
* @param outputFilename string with the name of the file
78
*/
79
void
SetDlRxOutputFilename
(std::string outputFilename);
80
81
/**
82
* Get the name of the file where the DL RX PHY statistics will be stored.
83
* @return the name of the file where the DL RX PHY statistics will be stored
84
*/
85
std::string
GetDlRxOutputFilename
();
86
87
/**
88
* Notifies the stats calculator that an downlink reception has occurred.
89
* @param params Trace information regarding PHY reception stats
90
*/
91
void
DlPhyReception
(
PhyReceptionStatParameters
params);
92
93
/**
94
* Notifies the stats calculator that an uplink reception has occurred.
95
* @param params Trace information regarding PHY reception stats
96
*/
97
void
UlPhyReception
(
PhyReceptionStatParameters
params);
98
99
/**
100
* trace sink
101
*
102
* @param phyRxStats
103
* @param path
104
* @param params
105
*/
106
static
void
DlPhyReceptionCallback
(
Ptr<PhyRxStatsCalculator>
phyRxStats,
107
std::string path,
108
PhyReceptionStatParameters
params);
109
110
/**
111
* trace sink
112
*
113
* @param phyRxStats
114
* @param path
115
* @param params
116
*/
117
static
void
UlPhyReceptionCallback
(
Ptr<PhyRxStatsCalculator>
phyRxStats,
118
std::string path,
119
PhyReceptionStatParameters
params);
120
121
private
:
122
/**
123
* When writing DL RX PHY statistics first time to file,
124
* columns description is added. Then next lines are
125
* appended to file. This value is true if output
126
* files have not been opened yet
127
*/
128
bool
m_dlRxFirstWrite
;
129
130
/**
131
* When writing UL RX PHY statistics first time to file,
132
* columns description is added. Then next lines are
133
* appended to file. This value is true if output
134
* files have not been opened yet
135
*/
136
bool
m_ulRxFirstWrite
;
137
138
/**
139
* DL RX PHY output trace file
140
*/
141
std::ofstream
m_dlRxOutFile
;
142
143
/**
144
* UL RX PHY output trace file
145
*/
146
std::ofstream
m_ulRxOutFile
;
147
};
148
149
}
// namespace ns3
150
151
#endif
/* PHY_RX_STATS_CALCULATOR_H_ */
ns3::LteStatsCalculator
Base class for ***StatsCalculator classes.
Definition
lte-stats-calculator.h:29
ns3::PhyRxStatsCalculator
Takes care of storing the information generated at PHY layer regarding reception.
Definition
phy-rx-stats-calculator.h:42
ns3::PhyRxStatsCalculator::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition
phy-rx-stats-calculator.cc:46
ns3::PhyRxStatsCalculator::m_dlRxFirstWrite
bool m_dlRxFirstWrite
When writing DL RX PHY statistics first time to file, columns description is added.
Definition
phy-rx-stats-calculator.h:128
ns3::PhyRxStatsCalculator::m_ulRxOutFile
std::ofstream m_ulRxOutFile
UL RX PHY output trace file.
Definition
phy-rx-stats-calculator.h:146
ns3::PhyRxStatsCalculator::PhyRxStatsCalculator
PhyRxStatsCalculator()
Constructor.
Definition
phy-rx-stats-calculator.cc:24
ns3::PhyRxStatsCalculator::m_ulRxFirstWrite
bool m_ulRxFirstWrite
When writing UL RX PHY statistics first time to file, columns description is added.
Definition
phy-rx-stats-calculator.h:136
ns3::PhyRxStatsCalculator::UlPhyReceptionCallback
static void UlPhyReceptionCallback(Ptr< PhyRxStatsCalculator > phyRxStats, std::string path, PhyReceptionStatParameters params)
trace sink
Definition
phy-rx-stats-calculator.cc:185
ns3::PhyRxStatsCalculator::GetUlRxOutputFilename
std::string GetUlRxOutputFilename()
Get the name of the file where the UL RX PHY statistics will be stored.
Definition
phy-rx-stats-calculator.cc:73
ns3::PhyRxStatsCalculator::DlPhyReception
void DlPhyReception(PhyReceptionStatParameters params)
Notifies the stats calculator that an downlink reception has occurred.
Definition
phy-rx-stats-calculator.cc:91
ns3::PhyRxStatsCalculator::SetDlRxOutputFilename
void SetDlRxOutputFilename(std::string outputFilename)
Set the name of the file where the DL RX PHY statistics will be stored.
Definition
phy-rx-stats-calculator.cc:79
ns3::PhyRxStatsCalculator::GetDlRxOutputFilename
std::string GetDlRxOutputFilename()
Get the name of the file where the DL RX PHY statistics will be stored.
Definition
phy-rx-stats-calculator.cc:85
ns3::PhyRxStatsCalculator::~PhyRxStatsCalculator
~PhyRxStatsCalculator() override
Destructor.
Definition
phy-rx-stats-calculator.cc:31
ns3::PhyRxStatsCalculator::DlPhyReceptionCallback
static void DlPhyReceptionCallback(Ptr< PhyRxStatsCalculator > phyRxStats, std::string path, PhyReceptionStatParameters params)
trace sink
Definition
phy-rx-stats-calculator.cc:161
ns3::PhyRxStatsCalculator::UlPhyReception
void UlPhyReception(PhyReceptionStatParameters params)
Notifies the stats calculator that an uplink reception has occurred.
Definition
phy-rx-stats-calculator.cc:127
ns3::PhyRxStatsCalculator::SetUlRxOutputFilename
void SetUlRxOutputFilename(std::string outputFilename)
Set the name of the file where the UL Rx PHY statistics will be stored.
Definition
phy-rx-stats-calculator.cc:67
ns3::PhyRxStatsCalculator::m_dlRxOutFile
std::ofstream m_dlRxOutFile
DL RX PHY output trace file.
Definition
phy-rx-stats-calculator.h:141
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
lte-stats-calculator.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::PhyReceptionStatParameters
PhyReceptionStatParameters structure.
Definition
lte-common.h:201
src
lte
helper
phy-rx-stats-calculator.h
Generated on Fri Dec 13 2024 18:20:43 for ns-3 by
1.11.0