25 #include <ns3/simulator.h>
35 m_allSignals(nullptr),
52 .SetGroupName(
"Spectrum")
106 (*m_allSignals) += (*spd);
115 (*m_allSignals) -= (*spd);
129 SpectrumValue sinr = (*m_rxSignal) / ((*m_allSignals) - (*m_rxSignal) + (*m_noise));
131 NS_LOG_LOGIC(
"calling m_errorModel->EvaluateChunk (sinr, duration)");
145 m_allSignals = Create<SpectrumValue>(noisePsd->GetSpectrumModel());
A base class which provides memory management and object aggregation.
virtual void DoDispose()
Destructor implementation.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
This class implements a gaussian interference model, i.e., all incoming signals are added to the tota...
~SpectrumInterference() override
void AbortRx()
Notify that the PHY has aborted RX.
void SetNoisePowerSpectralDensity(Ptr< const SpectrumValue > noisePsd)
Set the Noise Power Spectral Density.
void ConditionallyEvaluateChunk()
Evaluate a Chunk, depending on the Rx status and the last update time.
Ptr< SpectrumValue > m_allSignals
Stores the spectral power density of the sum of incoming signals; does not include noise,...
bool EndRx()
Notify that the RX attempt has ended.
Time m_lastChangeTime
the time of the last change in m_TotalPower
bool m_receiving
True if in Rx status.
static TypeId GetTypeId()
Register this type.
Ptr< const SpectrumValue > m_noise
Noise spectral power density.
void SetErrorModel(Ptr< SpectrumErrorModel > e)
Set the SpectrumErrorModel to be used.
void DoSubtractSignal(Ptr< const SpectrumValue > spd)
Removes a signal perceived in the medium.
void StartRx(Ptr< const Packet > p, Ptr< const SpectrumValue > rxPsd)
Notify that the PHY is starting a RX attempt.
Ptr< SpectrumErrorModel > m_errorModel
Error model.
void DoAddSignal(Ptr< const SpectrumValue > spd)
Adds a signal perceived in the medium.
void DoDispose() override
Destructor implementation.
void AddSignal(Ptr< const SpectrumValue > spd, const Time duration)
Notify that a new signal is being perceived in the medium.
Ptr< const SpectrumValue > m_rxSignal
Stores the power spectral density of the signal whose RX is being attempted.
Set of values corresponding to a given SpectrumModel.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Time Now()
create an ns3::Time instance which contains the current simulation time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.