26 #include <ns3/simulator.h>
27 #include <ns3/singleton.h>
34 NS_LOG_COMPONENT_DEFINE(
"SatTracedInterference");
39 NS_OBJECT_ENSURE_REGISTERED(SatTracedInterference);
44 static TypeId tid = TypeId(
"ns3::SatTracedInterference")
46 .AddConstructor<SatTracedInterference>();
61 m_channelType(channeltype),
62 m_rxBandwidth_Hz(rxBandwidth)
64 NS_LOG_FUNCTION(
this);
68 NS_FATAL_ERROR(
"SatTracedInterference::SatTracedInterference - Invalid value");
78 NS_LOG_FUNCTION(
this);
80 NS_FATAL_ERROR(
"SatTracedInterference::SatTracedInterference - Constructor not in use");
85 NS_LOG_FUNCTION(
this);
90 Ptr<SatInterference::InterferenceChangeEvent>
93 NS_LOG_FUNCTION(
this << duration.GetSeconds() << power << rxAddress);
95 Ptr<SatInterference::InterferenceChangeEvent> event;
96 event = Create<SatInterference::InterferenceChangeEvent>(0, duration, power, rxAddress);
101 std::vector<std::pair<double, double>>
104 NS_LOG_FUNCTION(
this);
107 Singleton<SatInterferenceInputTraceContainer>::Get()->GetInterferenceDensity(
108 std::make_pair(event->GetSatEarthStationAddress(),
m_channelType));
110 std::vector<std::pair<double, double>> powerPerFragment;
111 powerPerFragment.emplace_back(1.0,
m_power);
113 return powerPerFragment;
119 NS_LOG_FUNCTION(
this);
125 NS_LOG_FUNCTION(
this);
133 NS_LOG_FUNCTION(
this);
141 NS_LOG_FUNCTION(
this);
143 SatInterference::DoDispose();
149 NS_LOG_FUNCTION(
this);
151 if (rxBandwidth <= std::numeric_limits<double>::epsilon())
153 NS_FATAL_ERROR(
"SatTracedInterference::SetRxBandwidth - Invalid value");
ChannelType_t
Types of channel.
Abstract class defining interface for interference calculations objects.
void Reset(void)
Resets current interference.
static TypeId GetTypeId(void)
Derived from Object.
virtual void DoNotifyRxEnd(Ptr< SatInterference::InterferenceChangeEvent > event)
Notifies that RX is ended by a receiver.
TypeId GetInstanceTypeId(void) const
Derived from Object.
virtual void DoReset(void)
Resets current interference.
void DoDispose()
Dispose of SatTracedInterference.
virtual std::vector< std::pair< double, double > > DoCalculate(Ptr< SatInterference::InterferenceChangeEvent > event)
Calculates interference power for the given reference Sets final power at end time to finalPower.
SatEnums::ChannelType_t m_channelType
void SetRxBandwidth(double rxBandwidth)
Set Rx bandwidth.
SatTracedInterference()
Default constructor, not used.
virtual void DoNotifyRxStart(Ptr< SatInterference::InterferenceChangeEvent > event)
Notifies that RX is started by a receiver.
double m_rxBandwidth_Hz
RX Bandwidth in Hz.
virtual Ptr< SatInterference::InterferenceChangeEvent > DoAdd(Time rxDuration, double rxPower, Address rxAddress)
Adds interference power to interference object.
~SatTracedInterference()
Destructor.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.