satellite-fading-external-input-trace-container.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014 Magister Solutions Ltd.
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: Jani Puttonen <jani.puttonen@magister.fi>
19  */
20 
21 #ifndef SATELLITE_FADING_EXTERNAL_INPUT_TRACE_CONTAINER_H_
22 #define SATELLITE_FADING_EXTERNAL_INPUT_TRACE_CONTAINER_H_
23 
24 #include "geo-coordinate.h"
25 #include "satellite-enums.h"
27 
28 #include <ns3/mobility-model.h>
29 #include <ns3/object.h>
30 
31 #include <map>
32 #include <string>
33 
34 namespace ns3
35 {
36 
43 {
44  public:
48  typedef enum
49  {
54 
58  typedef std::pair<Ptr<SatFadingExternalInputTrace>, Ptr<SatFadingExternalInputTrace>>
60 
65  static TypeId GetTypeId(void);
66 
71  virtual TypeId GetInstanceTypeId(void) const;
72 
77 
82 
91  Ptr<SatFadingExternalInputTrace> GetFadingTrace(uint32_t nodeId,
92  SatEnums::ChannelType_t channelType,
93  Ptr<MobilityModel> mobility);
94 
102  bool TestFadingTraces(uint32_t numOfUts, uint32_t numOfGws);
103 
104  private:
105  typedef std::pair<std::string, GeoCoordinate> TraceFileContainerItem_t;
106  typedef std::vector<TraceFileContainerItem_t> TraceFileContainer_t;
107 
108  typedef std::map<std::string, Ptr<SatFadingExternalInputTrace>> TraceInputContainer_t;
109 
113  std::map<uint32_t, ChannelTracePair_t> m_utFadingMap;
114 
118  std::map<uint32_t, ChannelTracePair_t> m_gwFadingMap;
119 
124 
130 
136 
142 
148 
153 
158 
163 
168 
173 
176 
178  std::string m_dataPath;
179 
182 
186  void LoadIndexFiles();
187 
193  void CreateUtFadingTrace(uint32_t utId, Ptr<MobilityModel> mobility);
194 
200  void CreateGwFadingTrace(uint32_t gwId, Ptr<MobilityModel> mobility);
201 
208  void ReadIndexFile(std::string indexFile, TraceFileContainer_t& container);
209 
220  Ptr<SatFadingExternalInputTrace> CreateFadingTrace(
222  InputMode_t inputMode,
223  TraceFileContainer_t& container,
224  uint32_t id,
225  Ptr<MobilityModel> mobility);
236  std::string FindSourceBasedOnPosition(TraceFileContainer_t& container,
237  uint32_t id,
238  Ptr<MobilityModel> mobility);
239 };
240 
241 } // namespace ns3
242 
243 #endif /* SATELLITE_FADING_EXTERNAL_INPUT_TRACE_CONTAINER_H_ */
ChannelType_t
Types of channel.
std::map< std::string, Ptr< SatFadingExternalInputTrace > > TraceInputContainer_t
std::string m_gwRtnDownIndexFileName
The name of file which defines the index table to be used for trace input of forward up link for GWs.
void CreateGwFadingTrace(uint32_t gwId, Ptr< MobilityModel > mobility)
Create new GW fading trace.
void ReadIndexFile(std::string indexFile, TraceFileContainer_t &container)
Read trace file information from given index file.
std::string m_utFwdDownIndexFileName
The name of file which defines the index table to be used for trace input of forward down link for UT...
void CreateUtFadingTrace(uint32_t utId, Ptr< MobilityModel > mobility)
Create new UT fading trace.
std::string FindSourceBasedOnPosition(TraceFileContainer_t &container, uint32_t id, Ptr< MobilityModel > mobility)
Find the nearest fading trace source file for the requested UT/GW based on given mobility.
TraceFileContainer_t m_utRtnUpFileNames
UT return up link trace file names.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
InputMode_t
Definitions for different modes of using trace input files.
TraceFileContainer_t m_gwRtnDownFileNames
GW return down link trace file names.
std::map< uint32_t, ChannelTracePair_t > m_gwFadingMap
Container of the GW fading traces.
double m_maxDistanceToFading
Maximum distance allowed to the external fading trace source.
std::string m_utRtnUpIndexFileName
The name of file which defines the index table to be used for trace input of return up link for UTs.
Ptr< SatFadingExternalInputTrace > CreateFadingTrace(SatFadingExternalInputTrace::TraceFileType_e fileType, InputMode_t inputMode, TraceFileContainer_t &container, uint32_t id, Ptr< MobilityModel > mobility)
Create (or load) fading trace source for the requested UT/GW.
std::string m_gwFwdUpIndexFileName
The name of file which defines the index table to be used for trace input of forward up link for GWs.
std::pair< Ptr< SatFadingExternalInputTrace >, Ptr< SatFadingExternalInputTrace > > ChannelTracePair_t
Define type ChannelTracePair_t.
InputMode_t m_utInputMode
Input mode to read trace files form given index table (file) for UTs.
Ptr< SatFadingExternalInputTrace > GetFadingTrace(uint32_t nodeId, SatEnums::ChannelType_t channelType, Ptr< MobilityModel > mobility)
Get method for getting a proper fading trace.
TraceFileContainer_t m_gwFwdUpFileNames
GW forward up link trace file names.
bool m_indexFilesLoaded
flag telling if index trace files are already loaded
bool TestFadingTraces(uint32_t numOfUts, uint32_t numOfGws)
A method to test that the fading traces are according to assumptions.
std::map< uint32_t, ChannelTracePair_t > m_utFadingMap
Container of the UT fading traces.
TraceFileContainer_t m_utFwdDownFileNames
UT forward down link trace file names.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.