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 <stdint.h>
33 #include <string>
34 #include <utility>
35 #include <vector>
36 
37 namespace ns3
38 {
39 
46 {
47  public:
51  typedef enum
52  {
57 
61  typedef std::pair<Ptr<SatFadingExternalInputTrace>, Ptr<SatFadingExternalInputTrace>>
63 
68  static TypeId GetTypeId(void);
69 
74  virtual TypeId GetInstanceTypeId(void) const;
75 
80 
85 
94  Ptr<SatFadingExternalInputTrace> GetFadingTrace(uint32_t nodeId,
95  SatEnums::ChannelType_t channelType,
96  Ptr<MobilityModel> mobility);
97 
105  bool TestFadingTraces(uint32_t numOfUts, uint32_t numOfGws);
106 
107  private:
108  typedef std::pair<std::string, GeoCoordinate> TraceFileContainerItem_t;
109  typedef std::vector<TraceFileContainerItem_t> TraceFileContainer_t;
110 
111  typedef std::map<std::string, Ptr<SatFadingExternalInputTrace>> TraceInputContainer_t;
112 
116  std::map<uint32_t, ChannelTracePair_t> m_utFadingMap;
117 
121  std::map<uint32_t, ChannelTracePair_t> m_gwFadingMap;
122 
127 
133 
139 
145 
151 
156 
161 
166 
171 
176 
179 
181  std::string m_dataPath;
182 
185 
189  void LoadIndexFiles();
190 
196  void CreateUtFadingTrace(uint32_t utId, Ptr<MobilityModel> mobility);
197 
203  void CreateGwFadingTrace(uint32_t gwId, Ptr<MobilityModel> mobility);
204 
211  void ReadIndexFile(std::string indexFile, TraceFileContainer_t& container);
212 
223  Ptr<SatFadingExternalInputTrace> CreateFadingTrace(
225  InputMode_t inputMode,
226  TraceFileContainer_t& container,
227  uint32_t id,
228  Ptr<MobilityModel> mobility);
239  std::string FindSourceBasedOnPosition(TraceFileContainer_t& container,
240  uint32_t id,
241  Ptr<MobilityModel> mobility);
242 };
243 
244 } // namespace ns3
245 
246 #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.