23 #include "../utils/satellite-env-variables.h"
27 #include <ns3/singleton.h>
35 NS_LOG_COMPONENT_DEFINE(
"SatInterferenceInputTraceContainer");
40 NS_OBJECT_ENSURE_REGISTERED(SatInterferenceInputTraceContainer);
45 static TypeId tid = TypeId(
"ns3::SatInterferenceInputTraceContainer")
47 .AddConstructor<SatInterferenceInputTraceContainer>();
54 NS_LOG_FUNCTION(
this);
61 NS_LOG_FUNCTION(
this);
66 NS_LOG_FUNCTION(
this);
74 NS_LOG_FUNCTION(
this);
78 SatBaseTraceContainer::DoDispose();
84 NS_LOG_FUNCTION(
this);
92 Ptr<SatInputFileStreamTimeDoubleContainer>
95 NS_LOG_FUNCTION(
this);
97 std::stringstream filename;
98 std::string dataPath = Singleton<SatEnvVariables>::Get()->LocateDataDirectory();
100 int32_t gwId = Singleton<SatIdMapper>::Get()->GetGwIdWithMac(key.first);
101 int32_t utId = Singleton<SatIdMapper>::Get()->GetUtIdWithMac(key.first);
102 int32_t beamId = Singleton<SatIdMapper>::Get()->GetBeamIdWithMac(key.first);
104 if (beamId < 0 || (utId < 0 && gwId < 0))
110 if (utId >= 0 && gwId < 0)
112 filename << dataPath <<
"/additional-input/interferencetraces/input/BEAM_" << beamId
113 <<
"_UT_" << utId <<
"_channelType_"
117 if (gwId >= 0 && utId < 0)
119 filename << dataPath <<
"/additional-input/interferencetraces/input/BEAM_" << beamId
120 <<
"_GW_" << gwId <<
"_channelType_"
124 std::pair<container_t::iterator, bool> result =
m_container.insert(
126 CreateObject<SatInputFileStreamTimeDoubleContainer>(
127 filename.str().c_str(),
131 if (result.second ==
false)
133 NS_FATAL_ERROR(
"SatInterferenceInputTraceContainer::AddNode failed");
136 NS_LOG_INFO(
"Added node with MAC " << key.first <<
" channel type " << key.second);
138 return result.first->second;
141 NS_FATAL_ERROR(
"SatInterferenceInputTraceContainer::AddNode failed");
145 Ptr<SatInputFileStreamTimeDoubleContainer>
148 NS_LOG_FUNCTION(
this);
150 container_t::iterator iter =
m_container.find(key);
163 NS_LOG_FUNCTION(
this);
165 return FindNode(key)->ProceedToNextClosestTimeSample().at(
Base class for trace containers such as interference or fading traces.
static const uint32_t INTF_TRACE_DEFAULT_INTF_DENSITY_INDEX
Default interference density index for interference traces.
static const uint32_t INTF_TRACE_DEFAULT_NUMBER_OF_COLUMNS
Default number of columns for interference traces.
static std::string GetChannelTypeName(ChannelType_t channelType)
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.