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
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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
7
* <amine.ismail@udcast.com>
8
*/
9
10
#ifndef SNR_TO_BLOCK_ERROR_RATE_MANAGER_H
11
#define SNR_TO_BLOCK_ERROR_RATE_MANAGER_H
12
13
#include "
snr-to-block-error-rate-record.h
"
14
15
#include "ns3/ptr.h"
16
17
#include <vector>
18
19
namespace
ns3
20
{
21
22
/**
23
* \ingroup wimax
24
* \brief This class handles the SNR to BlcER traces.
25
*
26
* A path to a repository containing trace files should be provided.
27
* If no repository is provided the traces from default-traces.h will be loaded.
28
* A valid repository should contain 7 files, one for each modulation
29
* and coding scheme.
30
*
31
* The names of the files should respect the following format:
32
* \c modulation<modulation-and-conding-index>.txt, _e.g._
33
* \c modulation0.txt, \c modulation1.txt, _etc._ for
34
* modulation 0, modulation 1, and so on...
35
*
36
* The file format is ASCII with six columns as follows:
37
*
38
* -# The SNR value,
39
* -# The bit error rate BER,
40
* -# The block error rate BlcERm,
41
* -# The standard deviation on block error rate,
42
* -# The lower bound confidence interval for a given modulation, and
43
* -# The upper bound confidence interval for a given modulation.
44
*/
45
class
SNRToBlockErrorRateManager
46
{
47
public
:
48
SNRToBlockErrorRateManager
();
49
~SNRToBlockErrorRateManager
();
50
/**
51
* \brief Set the path of the repository containing the traces
52
* \param traceFilePath the path to the repository.
53
*/
54
void
SetTraceFilePath
(
char
* traceFilePath);
55
/**
56
* \return the path to the repository containing the traces.
57
*/
58
std::string
GetTraceFilePath
();
59
/**
60
* \brief returns the Block Error Rate for a given modulation and SNR value
61
* \param SNR the SNR value
62
* \param modulation one of the seven MCS
63
* \return the Block Error Rate
64
*/
65
double
GetBlockErrorRate
(
double
SNR, uint8_t modulation);
66
SNRToBlockErrorRateRecord
*
67
/**
68
* \brief returns a record of type SNRToBlockErrorRateRecord corresponding to a given modulation
69
* and SNR value
70
* \param SNR the SNR value
71
* \param modulation one of the seven MCS
72
* \return the Block Error Rate
73
*/
74
GetSNRToBlockErrorRateRecord
(
double
SNR, uint8_t modulation);
75
/**
76
* \brief Loads the traces form the repository specified in the constructor or set by
77
* SetTraceFilePath function. If no repository is provided, default traces will be loaded from
78
* default-traces.h file
79
*/
80
81
void
LoadTraces
();
82
/**
83
* \brief Loads the default traces from default-traces.h file
84
*/
85
void
LoadDefaultTraces
();
86
/**
87
* \brief Reloads the trace
88
*/
89
void
ReLoadTraces
();
90
/**
91
* \brief If activate loss is called with false, all the returned BlcER will be 0 (no losses)
92
* \param loss true to activates losses
93
*/
94
void
ActivateLoss
(
bool
loss);
95
96
private
:
97
/// Clear records function
98
void
ClearRecords
();
99
bool
m_activateLoss
;
///< activate loss
100
std::string
m_traceFilePath
;
///< trace file path
101
102
std::vector<SNRToBlockErrorRateRecord*>*
m_recordModulation
[7];
///< record modulation
103
};
104
}
// namespace ns3
105
106
#endif
/* SNR_TO_BLOCK_ERROR_RATE_MANAGER_H */
ns3::SNRToBlockErrorRateManager
This class handles the SNR to BlcER traces.
Definition
snr-to-block-error-rate-manager.h:46
ns3::SNRToBlockErrorRateManager::ActivateLoss
void ActivateLoss(bool loss)
If activate loss is called with false, all the returned BlcER will be 0 (no losses)
Definition
snr-to-block-error-rate-manager.cc:65
ns3::SNRToBlockErrorRateManager::ClearRecords
void ClearRecords()
Clear records function.
Definition
snr-to-block-error-rate-manager.cc:47
ns3::SNRToBlockErrorRateManager::SNRToBlockErrorRateManager
SNRToBlockErrorRateManager()
Definition
snr-to-block-error-rate-manager.cc:27
ns3::SNRToBlockErrorRateManager::m_activateLoss
bool m_activateLoss
activate loss
Definition
snr-to-block-error-rate-manager.h:99
ns3::SNRToBlockErrorRateManager::ReLoadTraces
void ReLoadTraces()
Reloads the trace.
Definition
snr-to-block-error-rate-manager.cc:208
ns3::SNRToBlockErrorRateManager::LoadTraces
void LoadTraces()
Loads the traces form the repository specified in the constructor or set by SetTraceFilePath function...
Definition
snr-to-block-error-rate-manager.cc:71
ns3::SNRToBlockErrorRateManager::GetSNRToBlockErrorRateRecord
SNRToBlockErrorRateRecord * GetSNRToBlockErrorRateRecord(double SNR, uint8_t modulation)
returns a record of type SNRToBlockErrorRateRecord corresponding to a given modulation and SNR value
Definition
snr-to-block-error-rate-manager.cc:300
ns3::SNRToBlockErrorRateManager::GetTraceFilePath
std::string GetTraceFilePath()
Definition
snr-to-block-error-rate-manager.cc:257
ns3::SNRToBlockErrorRateManager::m_traceFilePath
std::string m_traceFilePath
trace file path
Definition
snr-to-block-error-rate-manager.h:100
ns3::SNRToBlockErrorRateManager::GetBlockErrorRate
double GetBlockErrorRate(double SNR, uint8_t modulation)
returns the Block Error Rate for a given modulation and SNR value
Definition
snr-to-block-error-rate-manager.cc:263
ns3::SNRToBlockErrorRateManager::SetTraceFilePath
void SetTraceFilePath(char *traceFilePath)
Set the path of the repository containing the traces.
Definition
snr-to-block-error-rate-manager.cc:251
ns3::SNRToBlockErrorRateManager::m_recordModulation
std::vector< SNRToBlockErrorRateRecord * > * m_recordModulation[7]
record modulation
Definition
snr-to-block-error-rate-manager.h:102
ns3::SNRToBlockErrorRateManager::LoadDefaultTraces
void LoadDefaultTraces()
Loads the default traces from default-traces.h file.
Definition
snr-to-block-error-rate-manager.cc:111
ns3::SNRToBlockErrorRateManager::~SNRToBlockErrorRateManager
~SNRToBlockErrorRateManager()
Definition
snr-to-block-error-rate-manager.cc:37
ns3::SNRToBlockErrorRateRecord
This class represents a record (handled by SnrToBlockErrorRate manager) that keeps a mapping between ...
Definition
snr-to-block-error-rate-record.h:24
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
snr-to-block-error-rate-record.h
src
wimax
model
snr-to-block-error-rate-manager.h
Generated on Sun Nov 3 2024 09:20:53 for ns-3 by
1.11.0