A Discrete-Event Network Simulator
API
error-rate-model.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2005,2006 INRIA
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18  */
19 
20 #ifndef ERROR_RATE_MODEL_H
21 #define ERROR_RATE_MODEL_H
22 
23 #include "wifi-mode.h"
24 
25 #include "ns3/object.h"
26 
27 namespace ns3
28 {
29 
35 class ErrorRateModel : public Object
36 {
37  public:
42  static TypeId GetTypeId();
43 
50  double CalculateSnr(const WifiTxVector& txVector, double ber) const;
51 
56  virtual bool IsAwgn() const;
57 
87  double GetChunkSuccessRate(WifiMode mode,
88  const WifiTxVector& txVector,
89  double snr,
90  uint64_t nbits,
91  uint8_t numRxAntennas = 1,
93  uint16_t staId = SU_STA_ID) const;
94 
103  virtual int64_t AssignStreams(int64_t stream);
104 
105  private:
119  virtual double DoGetChunkSuccessRate(WifiMode mode,
120  const WifiTxVector& txVector,
121  double snr,
122  uint64_t nbits,
123  uint8_t numRxAntennas,
124  WifiPpduField field,
125  uint16_t staId) const = 0;
126 };
127 
128 } // namespace ns3
129 
130 #endif /* ERROR_RATE_MODEL_H */
the interface for Wifi's error models
virtual bool IsAwgn() const
static TypeId GetTypeId()
Get the type ID.
double GetChunkSuccessRate(WifiMode mode, const WifiTxVector &txVector, double snr, uint64_t nbits, uint8_t numRxAntennas=1, WifiPpduField field=WIFI_PPDU_FIELD_DATA, uint16_t staId=SU_STA_ID) const
This method returns the probability that the given 'chunk' of the packet will be successfully receive...
virtual double DoGetChunkSuccessRate(WifiMode mode, const WifiTxVector &txVector, double snr, uint64_t nbits, uint8_t numRxAntennas, WifiPpduField field, uint16_t staId) const =0
A pure virtual method that must be implemented in the subclass.
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
double CalculateSnr(const WifiTxVector &txVector, double ber) const
A base class which provides memory management and object aggregation.
Definition: object.h:89
a unique identifier for an interface.
Definition: type-id.h:59
represent a single transmission mode
Definition: wifi-mode.h:51
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiPpduField
The type of PPDU field (grouped for convenience)
@ WIFI_PPDU_FIELD_DATA
data field
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static constexpr uint16_t SU_STA_ID
STA_ID to identify a single user (SU)
Definition: wifi-mode.h:35