25 #include <ns3/simulator.h>
35 : m_receiving (false),
100 (*m_allSignals) += (*spd);
109 (*m_allSignals) -= (*spd);
124 SpectrumValue sinr = (*m_rxSignal) / ((*m_allSignals) - (*m_rxSignal) + (*m_noise));
126 NS_LOG_LOGIC (
"calling m_errorModel->EvaluateChunk (sinr, duration)");
140 m_allSignals = Create<SpectrumValue> (noisePsd->GetSpectrumModel ());
keep track of time values and allow control of global simulation resolution
#define NS_LOG_FUNCTION(parameters)
NS_LOG_COMPONENT_DEFINE("SpectrumInterference")
void SetNoisePowerSpectralDensity(Ptr< const SpectrumValue > noisePsd)
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
void AddSignal(Ptr< const SpectrumValue > spd, const Time duration)
notify that a new signal is being perceived in the medium.
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
void AbortRx()
notify that the PHY has aborted RX
Ptr< const SpectrumValue > m_noise
void StartRx(Ptr< const Packet > p, Ptr< const SpectrumValue > rxPsd)
notify that the PHY is starting a RX attempt
void DoDispose()
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Time m_lastChangeTime
the time of the last change in m_TotalPower
#define NS_LOG_LOGIC(msg)
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.
Ptr< const SpectrumValue > m_rxSignal
stores the power spectral density of the signal whose RX is being attempted
Ptr< SpectrumErrorModel > m_errorModel
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
virtual ~SpectrumInterference()
void DoAddSignal(Ptr< const SpectrumValue > spd)
void SetErrorModel(Ptr< SpectrumErrorModel > e)
set the SpectrumErrorModel to be used.
void DoSubtractSignal(Ptr< const SpectrumValue > spd)
Set of values corresponding to a given SpectrumModel.
void ConditionallyEvaluateChunk()