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