A Discrete-Event Network Simulator
API
error-rate-model.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005,2006 INRIA
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 
21 #ifndef ERROR_RATE_MODEL_H
22 #define ERROR_RATE_MODEL_H
23 
24 #include "ns3/object.h"
25 #include "wifi-mode.h"
26 
27 namespace ns3 {
28 
34 class ErrorRateModel : public Object
35 {
36 public:
41  static TypeId GetTypeId (void);
42 
49  double CalculateSnr (const WifiTxVector& txVector, double ber) const;
50 
55  virtual bool IsAwgn (void) const;
56 
85  double GetChunkSuccessRate (WifiMode mode, const WifiTxVector& txVector, double snr, uint64_t nbits,
86  uint8_t numRxAntennas = 1, WifiPpduField field = WIFI_PPDU_FIELD_DATA,
87  uint16_t staId = SU_STA_ID) const;
88 
97  virtual int64_t AssignStreams (int64_t stream);
98 
99 
100 private:
114  virtual double DoGetChunkSuccessRate (WifiMode mode, const WifiTxVector& txVector, double snr, uint64_t nbits,
115  uint8_t numRxAntennas, WifiPpduField field, uint16_t staId) const = 0;
116 };
117 
118 } //namespace ns3
119 
120 #endif /* ERROR_RATE_MODEL_H */
121 
static TypeId GetTypeId(void)
Get the type ID.
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
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.
double CalculateSnr(const WifiTxVector &txVector, double ber) const
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:47
virtual bool IsAwgn(void) const
the interface for Wifi&#39;s error models
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 &#39;chunk&#39; of the packet will be successfully receive...
WifiPpduField
The type of PPDU field (grouped for convenience)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
A base class which provides memory management and object aggregation.
Definition: object.h:87
a unique identifier for an interface.
Definition: type-id.h:58
#define SU_STA_ID
Definition: wifi-mode.h:32