Loading...
Searching...
No Matches
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
37namespace ns3
38{
39
46{
47 public:
57
61 typedef std::pair<Ptr<SatFadingExternalInputTrace>, Ptr<SatFadingExternalInputTrace>>
63
68 static TypeId GetTypeId(void);
69
74
83 virtual void NotifyConstructionCompleted() override;
84
89
98 Ptr<SatFadingExternalInputTrace> GetFadingTrace(uint32_t nodeId,
99 SatEnums::ChannelType_t channelType,
100 Ptr<MobilityModel> mobility);
101
109 bool TestFadingTraces(uint32_t numOfUts, uint32_t numOfGws);
110
111 private:
112 typedef std::pair<std::string, GeoCoordinate> TraceFileContainerItem_t;
113 typedef std::vector<TraceFileContainerItem_t> TraceFileContainer_t;
114
115 typedef std::map<std::string, Ptr<SatFadingExternalInputTrace>> TraceInputContainer_t;
116
120 std::map<uint32_t, ChannelTracePair_t> m_utFadingMap;
121
125 std::map<uint32_t, ChannelTracePair_t> m_gwFadingMap;
126
131
137
143
149
155
160
165
170
175
180
183
185 std::string m_dataPath;
186
189
193 void LoadIndexFiles();
194
200 void CreateUtFadingTrace(uint32_t utId, Ptr<MobilityModel> mobility);
201
207 void CreateGwFadingTrace(uint32_t gwId, Ptr<MobilityModel> mobility);
208
215 void ReadIndexFile(std::string indexFile, TraceFileContainer_t& container);
216
227 Ptr<SatFadingExternalInputTrace> CreateFadingTrace(
229 InputMode_t inputMode,
230 TraceFileContainer_t& container,
231 uint32_t id,
232 Ptr<MobilityModel> mobility);
243 std::string FindSourceBasedOnPosition(TraceFileContainer_t& container,
244 uint32_t id,
245 Ptr<MobilityModel> mobility);
246};
247
248} // namespace ns3
249
250#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.
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.
virtual void NotifyConstructionCompleted() override
Notifier called once the ObjectBase is fully constructed.
TraceFileContainer_t m_utFwdDownFileNames
UT forward down link trace file names.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.