A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
snr-to-block-error-rate-manager.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007,2008, 2009 INRIA, UDcast
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
19  * <amine.ismail@udcast.com>
20  */
21 
22 
23 #ifndef SNR_TO_BLOCK_ERROR_RATE_MANAGER_H
24 #define SNR_TO_BLOCK_ERROR_RATE_MANAGER_H
25 
26 #include "ns3/snr-to-block-error-rate-record.h"
27 #include <vector>
28 #include "ns3/ptr.h"
29 
30 namespace ns3 {
31 
47 {
48 public:
55  void SetTraceFilePath (char *traceFilePath);
59  std::string GetTraceFilePath (void);
66  double GetBlockErrorRate (double SNR, uint8_t modulation);
74  GetSNRToBlockErrorRateRecord (double SNR, uint8_t modulation);
80  void LoadTraces (void);
84  void LoadDefaultTraces (void);
88  void ReLoadTraces (void);
92  void ActivateLoss (bool loss);
93 private:
94  void ClearRecords (void);
95  uint8_t m_activateLoss;
96  static const unsigned int TRACE_FILE_PATH_SIZE = 1024;
98 
99  std::vector<SNRToBlockErrorRateRecord *> * m_recordModulation[7];
100 
101 };
102 }
103 
104 #endif /* SNR_TO_BLOCK_ERROR_RATE_MANAGER_H */
void LoadDefaultTraces(void)
Loads the default traces from default-traces.h file.
This class represents a record (handled by SnrToBlockErrorRate manager) that keeps a mapping between ...
SNRToBlockErrorRateRecord * GetSNRToBlockErrorRateRecord(double SNR, uint8_t modulation)
returns a record of type SNRToBlockErrorRateRecord corresponding to a given modulation and SNR value ...
void ActivateLoss(bool loss)
If activate loss is called with false, all the returned BlcER will be 0 (no losses) ...
void SetTraceFilePath(char *traceFilePath)
Set the path of the repository containing the traces.
void LoadTraces(void)
Loads the traces form the repository specified in the constructor or setted by SetTraceFilePath funct...
double GetBlockErrorRate(double SNR, uint8_t modulation)
returns the Block Error Rate for a given modulation and SNR value
std::vector< SNRToBlockErrorRateRecord * > * m_recordModulation[7]
This class handles the SNR to BlcER traces.