23 #include "../utils/satellite-env-variables.h"
27 #include <ns3/singleton.h>
29 NS_LOG_COMPONENT_DEFINE(
"SatFadingInputTraceContainer");
34 NS_OBJECT_ENSURE_REGISTERED(SatFadingInputTraceContainer);
39 static TypeId tid = TypeId(
"ns3::SatFadingInputTraceContainer")
41 .AddConstructor<SatFadingInputTraceContainer>();
48 NS_LOG_FUNCTION(
this);
55 NS_LOG_FUNCTION(
this);
60 NS_LOG_FUNCTION(
this);
68 NS_LOG_FUNCTION(
this);
72 SatBaseTraceContainer::DoDispose();
78 NS_LOG_FUNCTION(
this);
86 Ptr<SatInputFileStreamTimeDoubleContainer>
89 NS_LOG_FUNCTION(
this);
91 std::stringstream filename;
92 std::string dataPath = Singleton<SatEnvVariables>::Get()->LocateDataDirectory();
94 int32_t gwId = Singleton<SatIdMapper>::Get()->GetGwIdWithMac(key.first);
95 int32_t utId = Singleton<SatIdMapper>::Get()->GetUtIdWithMac(key.first);
96 int32_t beamId = Singleton<SatIdMapper>::Get()->GetBeamIdWithMac(key.first);
98 if (beamId < 0 || (utId < 0 && gwId < 0))
101 "SatFadingInputTraceContainer::AddNode - No such MAC address in the trace ID mapper");
105 if (utId >= 0 && gwId < 0)
107 filename << dataPath <<
"/fadingtraces/input/BEAM_" << beamId <<
"_UT_" << utId
111 if (gwId >= 0 && utId < 0)
113 filename << dataPath <<
"/fadingtraces/input/BEAM_" << beamId <<
"_GW_" << gwId
116 std::pair<container_t::iterator, bool> result =
m_container.insert(
118 CreateObject<SatInputFileStreamTimeDoubleContainer>(
119 filename.str().c_str(),
123 if (result.second ==
false)
125 NS_FATAL_ERROR(
"SatFadingInputTraceContainer::AddNode failed");
128 NS_LOG_INFO(
"Added node with MAC " << key.first <<
" channel type " << key.second);
130 return result.first->second;
133 NS_FATAL_ERROR(
"SatFadingInputTraceContainer::AddNode failed");
137 Ptr<SatInputFileStreamTimeDoubleContainer>
140 NS_LOG_FUNCTION(
this);
142 container_t::iterator iter =
m_container.find(key);
155 NS_LOG_FUNCTION(
this);
157 return FindNode(key)->ProceedToNextClosestTimeSample().at(
Base class for trace containers such as interference or fading traces.
static const uint32_t FADING_TRACE_DEFAULT_NUMBER_OF_COLUMNS
Default number of columns for fading traces.
static const uint32_t FADING_TRACE_DEFAULT_FADING_VALUE_INDEX
Default fading value index for fading traces.
static std::string GetChannelTypeName(ChannelType_t channelType)
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.