satellite-look-up-table.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013 Magister Solutions
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: Budiarto Herman <budiarto.herman@magister.fi>
19  *
20  */
21 
22 #ifndef SATELLITE_LOOK_UP_TABLE_H
23 #define SATELLITE_LOOK_UP_TABLE_H
24 
25 #include <ns3/object.h>
26 
27 #include <fstream>
28 #include <string>
29 #include <vector>
30 
31 namespace ns3
32 {
33 
39 class SatLookUpTable : public Object
40 {
41  public:
46  SatLookUpTable(std::string linkResultPath);
47 
51  virtual ~SatLookUpTable();
52 
57  static TypeId GetTypeId();
58 
64  double GetBler(double sinrDb) const;
65 
71  double GetEsNoDb(double blerTarget) const;
72 
73  private:
74  virtual void DoDispose();
75 
80  void Load(std::string linkResultPath);
81 
82  std::vector<double> m_esNoDb;
83  std::vector<double> m_bler;
84  std::ifstream* m_ifs;
85 };
86 
87 } // end of namespace ns3
88 
89 #endif /* SATELLITE_LOOK_UP_TABLE_H */
Loads a link result file and provide query service for BLER.
virtual ~SatLookUpTable()
Destructor for SatLookUpTable.
double GetBler(double sinrDb) const
Get the BLER corresponding to a given SINR.
std::vector< double > m_bler
static TypeId GetTypeId()
Get the type ID.
double GetEsNoDb(double blerTarget) const
Get Es/No in dB for a given BLER target.
std::vector< double > m_esNoDb
void Load(std::string linkResultPath)
Load the link results.
SatLookUpTable(std::string linkResultPath)
Constructor with initialization parameters.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.