author | Alexander Krotov <krotov@iitp.ru> |
Wed, 05 Dec 2018 01:14:38 +0300 | |
changeset 13887 | 7b4629f45e51 |
parent 13886 | c07413d68174 |
child 13888 | 231e5749e563 |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
7143
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
4325
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4315
diff
changeset
|
2 |
/* |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4315
diff
changeset
|
3 |
* Copyright (c) 2005,2006 INRIA |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4315
diff
changeset
|
4 |
* |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4315
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
4325
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4315
diff
changeset
|
7 |
* published by the Free Software Foundation; |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4315
diff
changeset
|
8 |
* |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4315
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4315
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4315
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4315
diff
changeset
|
12 |
* GNU General Public License for more details. |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4315
diff
changeset
|
13 |
* |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4315
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4315
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4315
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4315
diff
changeset
|
17 |
* |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4315
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
acc6c801f785
bug 548: missing license header
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4315
diff
changeset
|
19 |
*/ |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11384
diff
changeset
|
20 |
|
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
21 |
#ifndef INTERFERENCE_HELPER_H |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
#define INTERFERENCE_HELPER_H |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
23 |
|
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
#include "ns3/nstime.h" |
12433
89cdf2a76202
wifi: Clean includes
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
25 |
#include "wifi-tx-vector.h" |
13311
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
26 |
#include <map> |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
27 |
|
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
28 |
namespace ns3 { |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
29 |
|
13468
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
30 |
class Packet; |
13473
394636e7f713
wifi: Use forward declaration as often as possible (part 5)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13468
diff
changeset
|
31 |
class ErrorRateModel; |
13468
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
32 |
|
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
33 |
/** |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
34 |
* \ingroup wifi |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
35 |
* \brief handles interference calculations |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
36 |
* \brief signal event for a packet. |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
37 |
*/ |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
38 |
class Event : public SimpleRefCount<Event> |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
39 |
{ |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
40 |
public: |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
41 |
/** |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
42 |
* Create an Event with the given parameters. |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
43 |
* |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
44 |
* \param packet the packet |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
45 |
* \param txVector TXVECTOR of the packet |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
46 |
* \param duration duration of the signal |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
47 |
* \param rxPower the receive power (w) |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
48 |
*/ |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
49 |
Event (Ptr<const Packet> packet, WifiTxVector txVector, Time duration, double rxPower); |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
50 |
~Event (); |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
51 |
|
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
52 |
/** Return the packet. |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
53 |
* |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
54 |
* \return the packet |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
55 |
*/ |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
56 |
Ptr<const Packet> GetPacket (void) const; |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
57 |
/** |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
58 |
* Return the start time of the signal. |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
59 |
* |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
60 |
* \return the start time of the signal |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
61 |
*/ |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
62 |
Time GetStartTime (void) const; |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
63 |
/** |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
64 |
* Return the end time of the signal. |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
65 |
* |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
66 |
* \return the end time of the signal |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
67 |
*/ |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
68 |
Time GetEndTime (void) const; |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
69 |
/** |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
70 |
* Return the receive power (w). |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
71 |
* |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
72 |
* \return the receive power (w) |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
73 |
*/ |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
74 |
double GetRxPowerW (void) const; |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
75 |
/** |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
76 |
* Return the TXVECTOR of the packet. |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
77 |
* |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
78 |
* \return the TXVECTOR of the packet |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
79 |
*/ |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
80 |
WifiTxVector GetTxVector (void) const; |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
81 |
/** |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
82 |
* Return the Wi-Fi mode used for the payload. |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
83 |
* |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
84 |
* \return the Wi-Fi mode used for the payload |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
85 |
*/ |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
86 |
WifiMode GetPayloadMode (void) const; |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
87 |
|
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
88 |
|
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
89 |
private: |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
90 |
Ptr<const Packet> m_packet; ///< packet |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
91 |
WifiTxVector m_txVector; ///< TXVECTOR |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
92 |
Time m_startTime; ///< start time |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
93 |
Time m_endTime; ///< end time |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
94 |
double m_rxPowerW; ///< receive power in watts |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
95 |
}; |
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
96 |
|
7139
79dd02ed46ec
doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents:
6852
diff
changeset
|
97 |
/** |
79dd02ed46ec
doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents:
6852
diff
changeset
|
98 |
* \ingroup wifi |
79dd02ed46ec
doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents:
6852
diff
changeset
|
99 |
* \brief handles interference calculations |
79dd02ed46ec
doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents:
6852
diff
changeset
|
100 |
*/ |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
101 |
class InterferenceHelper |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
102 |
{ |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
103 |
public: |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
104 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
105 |
* Signal event for a packet. |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
106 |
*/ |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11384
diff
changeset
|
107 |
|
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
108 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
109 |
* A struct for both SNR and PER |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
110 |
*/ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
111 |
struct SnrPer |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
112 |
{ |
12691
e33cd795e21a
wifi: Doxygen updates for model files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12499
diff
changeset
|
113 |
double snr; ///< SNR |
e33cd795e21a
wifi: Doxygen updates for model files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12499
diff
changeset
|
114 |
double per; ///< PER |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
115 |
}; |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
116 |
|
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
117 |
InterferenceHelper (); |
3906
01acc159ffb1
merge with HEAD
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3905
diff
changeset
|
118 |
~InterferenceHelper (); |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
119 |
|
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
120 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
121 |
* Set the noise figure. |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
122 |
* |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
123 |
* \param value noise figure |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
124 |
*/ |
4315
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
3906
diff
changeset
|
125 |
void SetNoiseFigure (double value); |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
126 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
127 |
* Set the error rate model for this interference helper. |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
128 |
* |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
129 |
* \param rate Error rate model |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
130 |
*/ |
12940
9b6857031ad4
wifi: Use const in setters
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12933
diff
changeset
|
131 |
void SetErrorRateModel (const Ptr<ErrorRateModel> rate); |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
132 |
|
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
133 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
134 |
* Return the error rate model. |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
135 |
* |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
136 |
* \return Error rate model |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
137 |
*/ |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
138 |
Ptr<ErrorRateModel> GetErrorRateModel (void) const; |
12413
f379a30efa16
wifi: (fixes #2533) Improve 802.11n MIMO PHY abstraction
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12240
diff
changeset
|
139 |
/** |
f379a30efa16
wifi: (fixes #2533) Improve 802.11n MIMO PHY abstraction
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12240
diff
changeset
|
140 |
* Set the number of RX antennas in the receiver corresponding to this |
f379a30efa16
wifi: (fixes #2533) Improve 802.11n MIMO PHY abstraction
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12240
diff
changeset
|
141 |
* interference helper. |
f379a30efa16
wifi: (fixes #2533) Improve 802.11n MIMO PHY abstraction
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12240
diff
changeset
|
142 |
* |
12691
e33cd795e21a
wifi: Doxygen updates for model files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12499
diff
changeset
|
143 |
* \param rx the number of RX antennas |
12413
f379a30efa16
wifi: (fixes #2533) Improve 802.11n MIMO PHY abstraction
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12240
diff
changeset
|
144 |
*/ |
f379a30efa16
wifi: (fixes #2533) Improve 802.11n MIMO PHY abstraction
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12240
diff
changeset
|
145 |
void SetNumberOfReceiveAntennas (uint8_t rx); |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
146 |
|
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
147 |
/** |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
148 |
* \param energyW the minimum energy (W) requested |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11384
diff
changeset
|
149 |
* |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
150 |
* \returns the expected amount of time the observed |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
151 |
* energy on the medium will be higher than |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
152 |
* the requested threshold. |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
153 |
*/ |
12822
eef21f1b562f
wifi: Make InterferenceHelper::GetEnergyDuration const
Alexander Krotov <ilabdsf@gmail.com>
parents:
12821
diff
changeset
|
154 |
Time GetEnergyDuration (double energyW) const; |
4681
8558474b6149
made InterferenceHelper::CalculateTxDuration () static
Nicola Baldo <nbaldo@cttc.es>
parents:
4680
diff
changeset
|
155 |
|
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
156 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
157 |
* Add the packet-related signal to interference helper. |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
158 |
* |
12855
99b57d734bde
wifi: Add frame capture support
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12823
diff
changeset
|
159 |
* \param packet the packet |
11570 | 160 |
* \param txVector TXVECTOR of the packet |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
161 |
* \param duration the duration of the signal |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11384
diff
changeset
|
162 |
* \param rxPower receive power (W) |
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11384
diff
changeset
|
163 |
* |
13468
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
164 |
* \return Event |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
165 |
*/ |
13468
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
166 |
Ptr<Event> Add (Ptr<const Packet> packet, WifiTxVector txVector, Time duration, double rxPower); |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
167 |
|
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
168 |
/** |
12219
a7e5825d00b6
wifi: (closes #2400) Add SpectrumWifiPhy model
Tom Henderson <tomh@tomh.org>
parents:
11628
diff
changeset
|
169 |
* Add a non-Wifi signal to interference helper. |
a7e5825d00b6
wifi: (closes #2400) Add SpectrumWifiPhy model
Tom Henderson <tomh@tomh.org>
parents:
11628
diff
changeset
|
170 |
* \param duration the duration of the signal |
a7e5825d00b6
wifi: (closes #2400) Add SpectrumWifiPhy model
Tom Henderson <tomh@tomh.org>
parents:
11628
diff
changeset
|
171 |
* \param rxPower receive power (W) |
a7e5825d00b6
wifi: (closes #2400) Add SpectrumWifiPhy model
Tom Henderson <tomh@tomh.org>
parents:
11628
diff
changeset
|
172 |
*/ |
a7e5825d00b6
wifi: (closes #2400) Add SpectrumWifiPhy model
Tom Henderson <tomh@tomh.org>
parents:
11628
diff
changeset
|
173 |
void AddForeignSignal (Time duration, double rxPower); |
a7e5825d00b6
wifi: (closes #2400) Add SpectrumWifiPhy model
Tom Henderson <tomh@tomh.org>
parents:
11628
diff
changeset
|
174 |
/** |
11348
ded786322135
Bug 2066 [wifi] - A-MPDU reception should check for successful preamble
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10483
diff
changeset
|
175 |
* Calculate the SNIR at the start of the plcp payload and accumulate |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
176 |
* all SNIR changes in the snir vector. |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
177 |
* |
11348
ded786322135
Bug 2066 [wifi] - A-MPDU reception should check for successful preamble
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10483
diff
changeset
|
178 |
* \param event the event corresponding to the first time the corresponding packet arrives |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11384
diff
changeset
|
179 |
* |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
180 |
* \return struct of SNR and PER |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
181 |
*/ |
13468
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
182 |
struct InterferenceHelper::SnrPer CalculatePlcpPayloadSnrPer (Ptr<Event> event) const; |
11348
ded786322135
Bug 2066 [wifi] - A-MPDU reception should check for successful preamble
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10483
diff
changeset
|
183 |
/** |
ded786322135
Bug 2066 [wifi] - A-MPDU reception should check for successful preamble
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10483
diff
changeset
|
184 |
* Calculate the SNIR at the start of the plcp header and accumulate |
ded786322135
Bug 2066 [wifi] - A-MPDU reception should check for successful preamble
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10483
diff
changeset
|
185 |
* all SNIR changes in the snir vector. |
ded786322135
Bug 2066 [wifi] - A-MPDU reception should check for successful preamble
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10483
diff
changeset
|
186 |
* |
ded786322135
Bug 2066 [wifi] - A-MPDU reception should check for successful preamble
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10483
diff
changeset
|
187 |
* \param event the event corresponding to the first time the corresponding packet arrives |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11384
diff
changeset
|
188 |
* |
11348
ded786322135
Bug 2066 [wifi] - A-MPDU reception should check for successful preamble
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10483
diff
changeset
|
189 |
* \return struct of SNR and PER |
ded786322135
Bug 2066 [wifi] - A-MPDU reception should check for successful preamble
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10483
diff
changeset
|
190 |
*/ |
13468
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
191 |
struct InterferenceHelper::SnrPer CalculatePlcpHeaderSnrPer (Ptr<Event> event) const; |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11384
diff
changeset
|
192 |
|
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
193 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
194 |
* Notify that RX has started. |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
195 |
*/ |
6474
0894b2a245e9
fixed Bug 799 - Interference helper is too slow
Kirill Andreev <andreev@iitp.ru>
parents:
5819
diff
changeset
|
196 |
void NotifyRxStart (); |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
197 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
198 |
* Notify that RX has ended. |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
199 |
*/ |
6474
0894b2a245e9
fixed Bug 799 - Interference helper is too slow
Kirill Andreev <andreev@iitp.ru>
parents:
5819
diff
changeset
|
200 |
void NotifyRxEnd (); |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
201 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
202 |
* Erase all events. |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
203 |
*/ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
204 |
void EraseEvents (void); |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11384
diff
changeset
|
205 |
|
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11384
diff
changeset
|
206 |
|
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
207 |
private: |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
208 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
209 |
* Noise and Interference (thus Ni) event. |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
210 |
*/ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
211 |
class NiChange |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
212 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
213 |
public: |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
214 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
215 |
* Create a NiChange at the given time and the amount of NI change. |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
216 |
* |
13311
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
217 |
* \param power the power |
12855
99b57d734bde
wifi: Add frame capture support
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12823
diff
changeset
|
218 |
* \param event causes this NI change |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
219 |
*/ |
13468
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
220 |
NiChange (double power, Ptr<Event> event); |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
221 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
222 |
* Return the power |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
223 |
* |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
224 |
* \return the power |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
225 |
*/ |
13311
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
226 |
double GetPower (void) const; |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
227 |
/** |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
228 |
* Add a given amount of power. |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
229 |
* |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
230 |
* \param power the power to be added to the existing value |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
231 |
*/ |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
232 |
void AddPower (double power); |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
233 |
/** |
12855
99b57d734bde
wifi: Add frame capture support
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12823
diff
changeset
|
234 |
* Return the event causes the corresponding NI change |
99b57d734bde
wifi: Add frame capture support
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12823
diff
changeset
|
235 |
* |
99b57d734bde
wifi: Add frame capture support
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12823
diff
changeset
|
236 |
* \return the event |
99b57d734bde
wifi: Add frame capture support
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12823
diff
changeset
|
237 |
*/ |
13468
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
238 |
Ptr<Event> GetEvent (void) const; |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11384
diff
changeset
|
239 |
|
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11384
diff
changeset
|
240 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
241 |
private: |
13311
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
242 |
double m_power; ///< power |
13468
64f744da5cfe
wifi: Use forward declaration as often as possible (part 1)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
243 |
Ptr<Event> m_event; ///< event |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
244 |
}; |
13311
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
245 |
|
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
246 |
/** |
13311
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
247 |
* typedef for a multimap of NiChanges |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
248 |
*/ |
13311
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
249 |
typedef std::multimap<Time, NiChange> NiChanges; |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
250 |
|
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
251 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
252 |
* Append the given Event. |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
253 |
* |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
254 |
* \param event |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
255 |
*/ |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
256 |
void AppendEvent (Ptr<Event> event); |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
257 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
258 |
* Calculate noise and interference power in W. |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
259 |
* |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
260 |
* \param event |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
261 |
* \param ni |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11384
diff
changeset
|
262 |
* |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
263 |
* \return noise and interference power |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
264 |
*/ |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
265 |
double CalculateNoiseInterferenceW (Ptr<Event> event, NiChanges *ni) const; |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
266 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
267 |
* Calculate SNR (linear ratio) from the given signal power and noise+interference power. |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
268 |
* |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
269 |
* \param signal |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
270 |
* \param noiseInterference |
11628
243b71de25a0
add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11570
diff
changeset
|
271 |
* \param channelWidth |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11384
diff
changeset
|
272 |
* |
13886
c07413d68174
wifi: fix typo ("liear")
Alexander Krotov <krotov@iitp.ru>
parents:
13496
diff
changeset
|
273 |
* \return SNR in linear ratio |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
274 |
*/ |
13496
df02bf906b2b
wifi: Use uint16_t for channel widths to prepare 802.11ad support and silent some Visual Studio compiler warnings
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13473
diff
changeset
|
275 |
double CalculateSnr (double signal, double noiseInterference, uint16_t channelWidth) const; |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
276 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
277 |
* Calculate the success rate of the chunk given the SINR, duration, and Wi-Fi mode. |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
278 |
* The duration and mode are used to calculate how many bits are present in the chunk. |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
279 |
* |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
280 |
* \param snir SINR |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
281 |
* \param duration |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
282 |
* \param mode |
11628
243b71de25a0
add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11570
diff
changeset
|
283 |
* \param txVector |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11384
diff
changeset
|
284 |
* |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
285 |
* \return the success rate |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
286 |
*/ |
11628
243b71de25a0
add support for IEEE 802.11ac
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11570
diff
changeset
|
287 |
double CalculateChunkSuccessRate (double snir, Time duration, WifiMode mode, WifiTxVector txVector) const; |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
288 |
/** |
11348
ded786322135
Bug 2066 [wifi] - A-MPDU reception should check for successful preamble
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10483
diff
changeset
|
289 |
* Calculate the error rate of the given plcp payload. The plcp payload can be divided into |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
290 |
* multiple chunks (e.g. due to interference from other transmissions). |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
291 |
* |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
292 |
* \param event |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
293 |
* \param ni |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11384
diff
changeset
|
294 |
* |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
295 |
* \return the error rate of the packet |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
296 |
*/ |
11348
ded786322135
Bug 2066 [wifi] - A-MPDU reception should check for successful preamble
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10483
diff
changeset
|
297 |
double CalculatePlcpPayloadPer (Ptr<const Event> event, NiChanges *ni) const; |
ded786322135
Bug 2066 [wifi] - A-MPDU reception should check for successful preamble
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10483
diff
changeset
|
298 |
/** |
ded786322135
Bug 2066 [wifi] - A-MPDU reception should check for successful preamble
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10483
diff
changeset
|
299 |
* Calculate the error rate of the plcp header. The plcp header can be divided into |
ded786322135
Bug 2066 [wifi] - A-MPDU reception should check for successful preamble
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10483
diff
changeset
|
300 |
* multiple chunks (e.g. due to interference from other transmissions). |
ded786322135
Bug 2066 [wifi] - A-MPDU reception should check for successful preamble
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10483
diff
changeset
|
301 |
* |
ded786322135
Bug 2066 [wifi] - A-MPDU reception should check for successful preamble
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10483
diff
changeset
|
302 |
* \param event |
ded786322135
Bug 2066 [wifi] - A-MPDU reception should check for successful preamble
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10483
diff
changeset
|
303 |
* \param ni |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11384
diff
changeset
|
304 |
* |
11348
ded786322135
Bug 2066 [wifi] - A-MPDU reception should check for successful preamble
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10483
diff
changeset
|
305 |
* \return the error rate of the packet |
ded786322135
Bug 2066 [wifi] - A-MPDU reception should check for successful preamble
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10483
diff
changeset
|
306 |
*/ |
ded786322135
Bug 2066 [wifi] - A-MPDU reception should check for successful preamble
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10483
diff
changeset
|
307 |
double CalculatePlcpHeaderPer (Ptr<const Event> event, NiChanges *ni) const; |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
308 |
|
4315
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
3906
diff
changeset
|
309 |
double m_noiseFigure; /**< noise figure (linear) */ |
12691
e33cd795e21a
wifi: Doxygen updates for model files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12499
diff
changeset
|
310 |
Ptr<ErrorRateModel> m_errorRateModel; ///< error rate model |
12413
f379a30efa16
wifi: (fixes #2533) Improve 802.11n MIMO PHY abstraction
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12240
diff
changeset
|
311 |
uint8_t m_numRxAntennas; /**< the number of RX antennas in the corresponding receiver */ |
7600
57ba46094a0d
fix various doxygen errors
Vedran Miletić <rivanvx@gmail.com>
parents:
7385
diff
changeset
|
312 |
/// Experimental: needed for energy duration calculation |
6474
0894b2a245e9
fixed Bug 799 - Interference helper is too slow
Kirill Andreev <andreev@iitp.ru>
parents:
5819
diff
changeset
|
313 |
NiChanges m_niChanges; |
12691
e33cd795e21a
wifi: Doxygen updates for model files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12499
diff
changeset
|
314 |
double m_firstPower; ///< first power |
e33cd795e21a
wifi: Doxygen updates for model files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12499
diff
changeset
|
315 |
bool m_rxing; ///< flag whether it is in receiving state |
12855
99b57d734bde
wifi: Add frame capture support
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12823
diff
changeset
|
316 |
|
13048
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12940
diff
changeset
|
317 |
/** |
13311
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
318 |
* Returns an iterator to the first nichange that is later than moment |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
319 |
* |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
320 |
* \param moment time to check from |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
321 |
* \returns an iterator to the list of NiChanges |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
322 |
*/ |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
323 |
NiChanges::const_iterator GetNextPosition (Time moment) const; |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
324 |
/** |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
325 |
* Returns an iterator to the first nichange that is later than moment |
13048
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12940
diff
changeset
|
326 |
* |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12940
diff
changeset
|
327 |
* \param moment time to check from |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12940
diff
changeset
|
328 |
* \returns an iterator to the list of NiChanges |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12940
diff
changeset
|
329 |
*/ |
13311
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
330 |
//NiChanges::iterator GetNextPosition (Time moment); |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
331 |
/** |
13311
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
332 |
* Returns an iterator to the last nichange that is before than moment |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
333 |
* |
13311
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
334 |
* \param moment time to check from |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
335 |
* \returns an iterator to the list of NiChanges |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10139
diff
changeset
|
336 |
*/ |
13311
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
337 |
NiChanges::const_iterator GetPreviousPosition (Time moment) const; |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
338 |
|
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
339 |
/** |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
340 |
* Add NiChange to the list at the appropriate position and |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
341 |
* return the iterator of the new event. |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
342 |
* |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
343 |
* \param moment |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
344 |
* \param change |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
345 |
* \returns the iterator of the new event |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
346 |
*/ |
a40bedf7801a
wifi: (fixes #2791) rework InterferenceHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13116
diff
changeset
|
347 |
NiChanges::iterator AddNiChangeEvent (Time moment, NiChange change); |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
348 |
}; |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
349 |
|
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11384
diff
changeset
|
350 |
} //namespace ns3 |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
351 |
|
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
352 |
#endif /* INTERFERENCE_HELPER_H */ |