A Discrete-Event Network Simulator
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 * 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 PhyTxStatsCalculator
9 */
10
11#ifndef PHY_TX_STATS_CALCULATOR_H_
12#define PHY_TX_STATS_CALCULATOR_H_
13
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
23namespace ns3
24{
25
26/**
27 * @ingroup lte
28 *
29 * Takes care of storing the information generated at PHY layer regarding
30 * transmission. 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 */
42{
43 public:
44 /**
45 * Constructor
46 */
48
49 /**
50 * Destructor
51 */
52 ~PhyTxStatsCalculator() 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 Tx PHY statistics will be stored.
63 *
64 * @param outputFilename string with the name of the file
65 */
66 void SetUlTxOutputFilename(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 GetUlTxOutputFilename();
73
74 /**
75 * Set the name of the file where the DL TX PHY statistics will be stored.
76 *
77 * @param outputFilename string with the name of the file
78 */
79 void SetDlTxOutputFilename(std::string outputFilename);
80
81 /**
82 * Get the name of the file where the DL TX PHY statistics will be stored.
83 * @return the name of the file where the DL TX PHY statistics will be stored
84 */
85 std::string GetDlTxOutputFilename();
86
87 /**
88 * Notifies the stats calculator that an downlink transmission has occurred.
89 * @param params Trace information regarding PHY transmission stats
90 */
92
93 /**
94 * Notifies the stats calculator that an uplink transmission has occurred.
95 * @param params Trace information regarding PHY transmission stats
96 */
98
99 /**
100 * trace sink
101 *
102 * @param phyTxStats
103 * @param path
104 * @param params
105 */
107 std::string path,
109
110 /**
111 * trace sink
112 *
113 * @param phyTxStats
114 * @param path
115 * @param params
116 */
118 std::string path,
120
121 private:
122 /**
123 * When writing DL TX 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 */
129
130 /**
131 * When writing UL TX 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 */
137
138 /**
139 * DL TX PHY statistics output trace file
140 */
141 std::ofstream m_dlTxOutFile;
142
143 /**
144 * UL TX PHY statistics output trace file
145 */
146 std::ofstream m_ulTxOutFile;
147};
148
149} // namespace ns3
150
151#endif /* PHY_TX_STATS_CALCULATOR_H_ */
Base class for ***StatsCalculator classes.
Takes care of storing the information generated at PHY layer regarding transmission.
bool m_ulTxFirstWrite
When writing UL TX PHY statistics first time to file, columns description is added.
void SetDlTxOutputFilename(std::string outputFilename)
Set the name of the file where the DL TX PHY statistics will be stored.
void SetUlTxOutputFilename(std::string outputFilename)
Set the name of the file where the UL Tx PHY statistics will be stored.
bool m_dlTxFirstWrite
When writing DL TX PHY statistics first time to file, columns description is added.
static void DlPhyTransmissionCallback(Ptr< PhyTxStatsCalculator > phyTxStats, std::string path, PhyTransmissionStatParameters params)
trace sink
std::ofstream m_ulTxOutFile
UL TX PHY statistics output trace file.
void DlPhyTransmission(PhyTransmissionStatParameters params)
Notifies the stats calculator that an downlink transmission has occurred.
std::string GetDlTxOutputFilename()
Get the name of the file where the DL TX PHY statistics will be stored.
std::ofstream m_dlTxOutFile
DL TX PHY statistics output trace file.
void UlPhyTransmission(PhyTransmissionStatParameters params)
Notifies the stats calculator that an uplink transmission has occurred.
std::string GetUlTxOutputFilename()
Get the name of the file where the UL RX PHY statistics will be stored.
static TypeId GetTypeId()
Register this type.
static void UlPhyTransmissionCallback(Ptr< PhyTxStatsCalculator > phyTxStats, std::string path, PhyTransmissionStatParameters params)
trace sink
~PhyTxStatsCalculator() override
Destructor.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.
PhyTransmissionStatParameters structure.
Definition lte-common.h:177