A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
snr-to-block-error-rate-manager.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007,2008, 2009 INRIA, UDcast
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: Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
18 * <amine.ismail@udcast.com>
19 */
20
21#ifndef SNR_TO_BLOCK_ERROR_RATE_MANAGER_H
22#define SNR_TO_BLOCK_ERROR_RATE_MANAGER_H
23
25
26#include "ns3/ptr.h"
27
28#include <vector>
29
30namespace ns3
31{
32
33/**
34 * \ingroup wimax
35 * \brief This class handles the SNR to BlcER traces.
36 *
37 * A path to a repository containing trace files should be provided.
38 * If no repository is provided the traces from default-traces.h will be loaded.
39 * A valid repository should contain 7 files, one for each modulation
40 * and coding scheme.
41 *
42 * The names of the files should respect the following format:
43 * \c modulation<modulation-and-conding-index>.txt, _e.g._
44 * \c modulation0.txt, \c modulation1.txt, _etc._ for
45 * modulation 0, modulation 1, and so on...
46 *
47 * The file format is ASCII with six columns as follows:
48 *
49 * -# The SNR value,
50 * -# The bit error rate BER,
51 * -# The block error rate BlcERm,
52 * -# The standard deviation on block error rate,
53 * -# The lower bound confidence interval for a given modulation, and
54 * -# The upper bound confidence interval for a given modulation.
55 */
57{
58 public:
61 /**
62 * \brief Set the path of the repository containing the traces
63 * \param traceFilePath the path to the repository.
64 */
65 void SetTraceFilePath(char* traceFilePath);
66 /**
67 * \return the path to the repository containing the traces.
68 */
69 std::string GetTraceFilePath();
70 /**
71 * \brief returns the Block Error Rate for a given modulation and SNR value
72 * \param SNR the SNR value
73 * \param modulation one of the seven MCS
74 * \return the Block Error Rate
75 */
76 double GetBlockErrorRate(double SNR, uint8_t modulation);
78 /**
79 * \brief returns a record of type SNRToBlockErrorRateRecord corresponding to a given modulation
80 * and SNR value
81 * \param SNR the SNR value
82 * \param modulation one of the seven MCS
83 * \return the Block Error Rate
84 */
85 GetSNRToBlockErrorRateRecord(double SNR, uint8_t modulation);
86 /**
87 * \brief Loads the traces form the repository specified in the constructor or set by
88 * SetTraceFilePath function. If no repository is provided, default traces will be loaded from
89 * default-traces.h file
90 */
91
92 void LoadTraces();
93 /**
94 * \brief Loads the default traces from default-traces.h file
95 */
96 void LoadDefaultTraces();
97 /**
98 * \brief Reloads the trace
99 */
100 void ReLoadTraces();
101 /**
102 * \brief If activate loss is called with false, all the returned BlcER will be 0 (no losses)
103 * \param loss true to activates losses
104 */
105 void ActivateLoss(bool loss);
106
107 private:
108 /// Clear records function
109 void ClearRecords();
110 bool m_activateLoss; ///< activate loss
111 std::string m_traceFilePath; ///< trace file path
112
113 std::vector<SNRToBlockErrorRateRecord*>* m_recordModulation[7]; ///< record modulation
114};
115} // namespace ns3
116
117#endif /* SNR_TO_BLOCK_ERROR_RATE_MANAGER_H */
This class handles the SNR to BlcER traces.
void ActivateLoss(bool loss)
If activate loss is called with false, all the returned BlcER will be 0 (no losses)
void LoadTraces()
Loads the traces form the repository specified in the constructor or set by SetTraceFilePath function...
SNRToBlockErrorRateRecord * GetSNRToBlockErrorRateRecord(double SNR, uint8_t modulation)
returns a record of type SNRToBlockErrorRateRecord corresponding to a given modulation and SNR value
double GetBlockErrorRate(double SNR, uint8_t modulation)
returns the Block Error Rate for a given modulation and SNR value
void SetTraceFilePath(char *traceFilePath)
Set the path of the repository containing the traces.
std::vector< SNRToBlockErrorRateRecord * > * m_recordModulation[7]
record modulation
void LoadDefaultTraces()
Loads the default traces from default-traces.h file.
This class represents a record (handled by SnrToBlockErrorRate manager) that keeps a mapping between ...
Every class exported by the ns3 library is enclosed in the ns3 namespace.