25 #include <ns3/simulator.h>
34 : m_receiving (false),
53 .SetGroupName (
"Spectrum")
110 (*m_allSignals) += (*spd);
119 (*m_allSignals) -= (*spd);
134 SpectrumValue sinr = (*m_rxSignal) / ((*m_allSignals) - (*m_rxSignal) + (*m_noise));
136 NS_LOG_LOGIC (
"calling m_errorModel->EvaluateChunk (sinr, duration)");
150 m_allSignals = Create<SpectrumValue> (noisePsd->GetSpectrumModel ());
A base class which provides memory management and object aggregation.
virtual void DoDispose(void)
Destructor implementation.
static EventId Schedule(Time const &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...
void AbortRx()
Notify that the PHY has aborted RX.
void SetNoisePowerSpectralDensity(Ptr< const SpectrumValue > noisePsd)
Set the Noise Power Spectral Density.
void DoDispose()
Destructor implementation.
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.
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.
virtual ~SpectrumInterference()
static TypeId GetTypeId(void)
Register this type.
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(void)
create an ns3::Time instance which contains the current simulation time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.