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"
62 Time duration,
double rxPower);
181 Time duration,
double rxPower);
230 Time GetTime (
void)
const;
236 double GetDelta (
void)
const;
enum WifiPreamble m_preamble
Simulation virtual time values and 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.
std::vector< NiChange > NiChanges
typedef for a vector of NiChanges
handles interference calculations
Time GetEnergyDuration(double energyW)
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.
struct InterferenceHelper::SnrPer CalculatePlcpHeaderSnrPer(Ptr< InterferenceHelper::Event > event)
Calculate the SNIR at the start of the plcp header and accumulate all SNIR changes in the snir vector...
double CalculatePlcpPayloadPer(Ptr< const Event > event, NiChanges *ni) const
Calculate the error rate of the given plcp payload.
bool operator<(const int64x64_t &lhs, const int64x64_t &rhs)
Less than operator.
std::list< Ptr< Event > > Events
typedef for a list of Events
double m_noiseFigure
noise figure (linear)
struct InterferenceHelper::SnrPer CalculatePlcpPayloadSnrPer(Ptr< InterferenceHelper::Event > event)
Calculate the SNIR at the start of the plcp payload and accumulate all SNIR changes in the snir vecto...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void NotifyRxStart()
Notify that RX has started.
Noise and Interference (thus Ni) event.
void EraseEvents(void)
Erase all events.
Ptr< InterferenceHelper::Event > Add(uint32_t size, WifiTxVector txvector, enum WifiPreamble preamble, Time duration, double rxPower)
Add the packet-related signal to interference helper.
double CalculatePlcpHeaderPer(Ptr< const Event > event, NiChanges *ni) const
Calculate the error rate of the plcp header.
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.
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.
Event(uint32_t size, WifiTxVector txvector, enum WifiPreamble preamble, Time duration, double rxPower)
Create an Event with the given parameters.