20 #ifndef INTERFERENCE_HELPER_H
21 #define INTERFERENCE_HELPER_H
29 #include "ns3/nstime.h"
30 #include "ns3/simple-ref-count.h"
31 #include "ns3/wifi-tx-vector.h"
223 Time GetTime (
void)
const;
229 double GetDelta (
void)
const;
enum WifiPreamble m_preamble
keep track of time values and allow control of global simulation resolution
A struct for both SNR and PER.
smart pointer class similar to boost::intrusive_ptr
Ptr< ErrorRateModel > GetErrorRateModel(void) const
Return the error rate model.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Signal event for a packet.
double CalculatePer(Ptr< const Event > event, NiChanges *ni) const
Calculate the error rate of the given packet.
std::vector< NiChange > NiChanges
typedef for a vector of NiChanges
handles interference calculations
Time GetEnergyDuration(double energyW)
bool operator<(const Room &a, const Room &b)
double GetRxPowerW(void) const
Return the receive power (w).
Ptr< ErrorRateModel > m_errorRateModel
NiChanges::iterator GetPosition(Time moment)
Returns an iterator to the first nichange, which is later than moment.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
uint32_t GetSize(void) const
Return the size of the packet (bytes).
double CalculateChunkSuccessRate(double snir, Time duration, WifiMode mode) const
Calculate the success rate of the chunk given the SINR, duration, and Wi-Fi mode. ...
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
void SetErrorRateModel(Ptr< ErrorRateModel > rate)
Set the error rate model for this interference helper.
double CalculateNoiseInterferenceW(Ptr< Event > event, NiChanges *ni) const
Calculate noise and interference power in W.
Time GetStartTime(void) const
Return the start time of the signal.
WifiTxVector GetTxVector(void) const
Return the TXVECTOR of the packet.
NiChanges m_niChanges
Experimental: needed for energy duration calculation.
void AddNiChangeEvent(NiChange change)
Add NiChange to the list at the appropriate position.
Ptr< InterferenceHelper::Event > Add(uint32_t size, WifiMode payloadMode, enum WifiPreamble preamble, Time duration, double rxPower, WifiTxVector txvector)
Add the packet-related signal to interference helper.
struct InterferenceHelper::SnrPer CalculateSnrPer(Ptr< InterferenceHelper::Event > event)
Calculate the SNIR at the start of the packet and accumulate all SNIR changes in the snir vector...
std::list< Ptr< Event > > Events
typedef for a list of Events
double m_noiseFigure
noise figure (linear)
void NotifyRxStart()
Notify that RX has started.
Noise and Interference (thus Ni) event.
void EraseEvents(void)
Erase all events.
Time GetEndTime(void) const
Return the end time of the signal.
enum WifiPreamble GetPreambleType(void) const
Return the preamble type of the packet.
void NotifyRxEnd()
Notify that RX has ended.
Time GetDuration(void) const
Return the duration of the signal.
void SetNoiseFigure(double value)
Set the noise figure.
WifiMode GetPayloadMode(void) const
Return the Wi-Fi mode used for the payload.
Event(uint32_t size, WifiMode payloadMode, enum WifiPreamble preamble, Time duration, double rxPower, WifiTxVector txvector)
Create an Event with the given parameters.
double CalculateSnr(double signal, double noiseInterference, WifiMode mode) const
Calculate SNR (linear ratio) from the given signal power and noise+interference power.
void AppendEvent(Ptr< Event > event)
Append the given Event.
double GetNoiseFigure(void) const
Return the noise figure.
A template-based reference counting class.