A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::SNRToBlockErrorRateManager Class Reference

This class handles the SNR to BlcER traces. More...

#include <snr-to-block-error-rate-manager.h>

+ Collaboration diagram for ns3::SNRToBlockErrorRateManager:

Public Member Functions

 SNRToBlockErrorRateManager ()
 
 ~SNRToBlockErrorRateManager (void)
 
void ActivateLoss (bool loss)
 If activate loss is called with false, all the returned BlcER will be 0 (no losses) More...
 
double GetBlockErrorRate (double SNR, uint8_t modulation)
 returns the Block Error Rate for a given modulation and SNR value More...
 
SNRToBlockErrorRateRecordGetSNRToBlockErrorRateRecord (double SNR, uint8_t modulation)
 returns a record of type SNRToBlockErrorRateRecord corresponding to a given modulation and SNR value More...
 
std::string GetTraceFilePath (void)
 
void LoadDefaultTraces (void)
 Loads the default traces from default-traces.h file. More...
 
void LoadTraces (void)
 Loads the traces form the repository specified in the constructor or setted by SetTraceFilePath function. More...
 
void ReLoadTraces (void)
 Reloads the trace. More...
 
void SetTraceFilePath (char *traceFilePath)
 Set the path of the repository containing the traces. More...
 

Private Member Functions

void ClearRecords (void)
 

Private Attributes

uint8_t m_activateLoss
 
std::vector
< SNRToBlockErrorRateRecord * > * 
m_recordModulation [7]
 
char m_traceFilePath [TRACE_FILE_PATH_SIZE]
 

Static Private Attributes

static const unsigned int TRACE_FILE_PATH_SIZE = 1024
 

Detailed Description

This class handles the SNR to BlcER traces.

A path to a repository containing trace files should be provided. If no repository is provided the traces form default-traces.h will be loaded. A valid repository should contain 7 files, one for each modulation and coding scheme. The names of the files should respect the following format: modulation0.txt for modulation 0, modulation1.txt for modulation 1 and so on... The files format should be as follows SNR_value(1) BER(1) Blc_ER(1) STANDARD_DEVIATION(1) CONFIDENCE_INTERVAL1(1) CONFIDENCE_INTERVAL2(1) SNR_value(2) BER(2) Blc_ER(2) STANDARD_DEVIATION(2) CONFIDENCE_INTERVAL1(2) CONFIDENCE_INTERVAL2(2) ... ... ... ... ... ... ... ... ... ... ... ... SNR_value(n) BER(n) Blc_ER(n) STANDARD_DEVIATION(n) CONFIDENCE_INTERVAL1(n) CONFIDENCE_INTERVAL2(n)

Definition at line 46 of file snr-to-block-error-rate-manager.h.

Constructor & Destructor Documentation

ns3::SNRToBlockErrorRateManager::SNRToBlockErrorRateManager ( void  )
ns3::SNRToBlockErrorRateManager::~SNRToBlockErrorRateManager ( void  )

Definition at line 45 of file snr-to-block-error-rate-manager.cc.

References ClearRecords(), and m_recordModulation.

+ Here is the call graph for this function:

Member Function Documentation

void ns3::SNRToBlockErrorRateManager::ActivateLoss ( bool  loss)

If activate loss is called with false, all the returned BlcER will be 0 (no losses)

Definition at line 74 of file snr-to-block-error-rate-manager.cc.

References m_activateLoss.

Referenced by ns3::SimpleOfdmWimaxPhy::ActivateLoss().

+ Here is the caller graph for this function:

void ns3::SNRToBlockErrorRateManager::ClearRecords ( void  )
private

Definition at line 55 of file snr-to-block-error-rate-manager.cc.

References m_recordModulation.

Referenced by LoadDefaultTraces(), LoadTraces(), ReLoadTraces(), and ~SNRToBlockErrorRateManager().

+ Here is the caller graph for this function:

double ns3::SNRToBlockErrorRateManager::GetBlockErrorRate ( double  SNR,
uint8_t  modulation 
)

returns the Block Error Rate for a given modulation and SNR value

Parameters
SNRthe SNR value
modulationone of the seven MCS
Returns
the Block Error Rate

Definition at line 289 of file snr-to-block-error-rate-manager.cc.

References m_activateLoss, and m_recordModulation.

SNRToBlockErrorRateRecord * ns3::SNRToBlockErrorRateManager::GetSNRToBlockErrorRateRecord ( double  SNR,
uint8_t  modulation 
)

returns a record of type SNRToBlockErrorRateRecord corresponding to a given modulation and SNR value

Parameters
SNRthe SNR value
modulationone of the seven MCS
Returns
the Block Error Rate

Definition at line 327 of file snr-to-block-error-rate-manager.cc.

References ns3::Copy(), m_activateLoss, and m_recordModulation.

Referenced by Ns3WimaxSNRtoBLERTestCase::DoRunOnce(), and ns3::SimpleOfdmWimaxPhy::StartReceive().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string ns3::SNRToBlockErrorRateManager::GetTraceFilePath ( void  )
Returns
the path to the repository containing the traces.

Definition at line 283 of file snr-to-block-error-rate-manager.cc.

References m_traceFilePath.

Referenced by ns3::SimpleOfdmWimaxPhy::GetTraceFilePath().

+ Here is the caller graph for this function:

void ns3::SNRToBlockErrorRateManager::LoadDefaultTraces ( void  )

Loads the default traces from default-traces.h file.

Definition at line 116 of file snr-to-block-error-rate-manager.cc.

References ClearRecords(), m_activateLoss, m_recordModulation, modulation0, modulation1, modulation2, modulation3, modulation4, modulation5, and modulation6.

Referenced by LoadTraces(), and ReLoadTraces().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::SNRToBlockErrorRateManager::LoadTraces ( void  )

Loads the traces form the repository specified in the constructor or setted by SetTraceFilePath function.

If no repository is provided, default traces will be loaded from default-traces.h file

Definition at line 80 of file snr-to-block-error-rate-manager.cc.

References ClearRecords(), LoadDefaultTraces(), m_activateLoss, m_recordModulation, m_traceFilePath, and NS_LOG_INFO.

Referenced by Ns3WimaxSNRtoBLERTestCase::DoRunOnce(), ns3::SimpleOfdmWimaxPhy::SetTraceFilePath(), and ns3::SimpleOfdmWimaxPhy::SimpleOfdmWimaxPhy().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::SNRToBlockErrorRateManager::ReLoadTraces ( void  )

Reloads the trace.

Definition at line 236 of file snr-to-block-error-rate-manager.cc.

References ClearRecords(), LoadDefaultTraces(), m_activateLoss, m_recordModulation, m_traceFilePath, and NS_LOG_INFO.

Referenced by ns3::SimpleOfdmWimaxPhy::SetSNRToBlockErrorRateTracesPath().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::SNRToBlockErrorRateManager::SetTraceFilePath ( char *  traceFilePath)

Set the path of the repository containing the traces.

Parameters
traceFilePaththe path to the repository.

Definition at line 275 of file snr-to-block-error-rate-manager.cc.

References m_traceFilePath, NS_ASSERT_MSG, and TRACE_FILE_PATH_SIZE.

Referenced by ns3::SimpleOfdmWimaxPhy::SetSNRToBlockErrorRateTracesPath(), ns3::SimpleOfdmWimaxPhy::SetTraceFilePath(), and ns3::SimpleOfdmWimaxPhy::SimpleOfdmWimaxPhy().

+ Here is the caller graph for this function:

Member Data Documentation

uint8_t ns3::SNRToBlockErrorRateManager::m_activateLoss
private
char ns3::SNRToBlockErrorRateManager::m_traceFilePath[TRACE_FILE_PATH_SIZE]
private
const unsigned int ns3::SNRToBlockErrorRateManager::TRACE_FILE_PATH_SIZE = 1024
staticprivate

Definition at line 96 of file snr-to-block-error-rate-manager.h.

Referenced by SetTraceFilePath().


The documentation for this class was generated from the following files: