author | Vedran Mileti? <rivanvx@gmail.com> |
Sun, 15 May 2011 09:40:43 -0400 | |
changeset 7207 | 440bbee145f0 |
parent 7188 | ea48206d68bd |
child 7241 | 0a7a16b599e8 |
permissions | -rw-r--r-- |
5944
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
2 |
/* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
3 |
* Copyright (c) 2005,2006,2007 INRIA |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
4 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
8 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
13 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
17 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
19 |
* Contributions: Timo Bingmann <timo.bingmann@student.kit.edu> |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
20 |
* Contributions: Gary Pei <guangyu.pei@boeing.com> for fixed RSS |
5972
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
21 |
* Contributions: Tom Hewer <tomhewer@mac.com> for two ray ground model |
6115
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
22 |
* Pavel Boyko <boyko@iitp.ru> for matrix |
5944
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
23 |
*/ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
24 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
25 |
#ifndef PROPAGATION_LOSS_MODEL_H |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
26 |
#define PROPAGATION_LOSS_MODEL_H |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
27 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
28 |
#include "ns3/object.h" |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
29 |
#include "ns3/random-variable.h" |
6115
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
30 |
#include <map> |
5944
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
31 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
32 |
namespace ns3 { |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
33 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
34 |
class MobilityModel; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
35 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
36 |
/** |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
37 |
* \brief Modelize the propagation loss through a transmission medium |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
38 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
39 |
* Calculate the receive power (dbm) from a transmit power (dbm) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
40 |
* and a mobility model for the source and destination positions. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
41 |
*/ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
42 |
class PropagationLossModel : public Object |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
43 |
{ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
44 |
public: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
45 |
static TypeId GetTypeId (void); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
46 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
47 |
PropagationLossModel (); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
48 |
virtual ~PropagationLossModel (); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
49 |
|
6622
ee39e2c196c3
Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents:
6461
diff
changeset
|
50 |
/** |
ee39e2c196c3
Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents:
6461
diff
changeset
|
51 |
* \brief Enables a chain of loss models to act on the signal |
ee39e2c196c3
Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents:
6461
diff
changeset
|
52 |
* \param The next PropagationLossModel to add to the chain |
ee39e2c196c3
Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents:
6461
diff
changeset
|
53 |
* |
ee39e2c196c3
Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents:
6461
diff
changeset
|
54 |
* This method of chaining propagation loss models only works commutatively |
ee39e2c196c3
Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents:
6461
diff
changeset
|
55 |
* if the propagation loss of all models in the chain are independent |
ee39e2c196c3
Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents:
6461
diff
changeset
|
56 |
* of transmit power. |
ee39e2c196c3
Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents:
6461
diff
changeset
|
57 |
*/ |
5944
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
58 |
void SetNext (Ptr<PropagationLossModel> next); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
59 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
60 |
/** |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
61 |
* \param txPowerDbm current transmission power (in dBm) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
62 |
* \param a the mobility model of the source |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
63 |
* \param b the mobility model of the destination |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
64 |
* \returns the reception power after adding/multiplying propagation loss (in dBm) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
65 |
*/ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
66 |
double CalcRxPower (double txPowerDbm, |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
67 |
Ptr<MobilityModel> a, |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
68 |
Ptr<MobilityModel> b) const; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
69 |
private: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
70 |
PropagationLossModel (const PropagationLossModel &o); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
71 |
PropagationLossModel &operator = (const PropagationLossModel &o); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
72 |
virtual double DoCalcRxPower (double txPowerDbm, |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
73 |
Ptr<MobilityModel> a, |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
74 |
Ptr<MobilityModel> b) const = 0; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
75 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
76 |
Ptr<PropagationLossModel> m_next; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
77 |
}; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
78 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
79 |
/** |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
80 |
* \brief The propagation loss follows a random distribution. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
81 |
*/ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
82 |
class RandomPropagationLossModel : public PropagationLossModel |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
83 |
{ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
84 |
public: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
85 |
static TypeId GetTypeId (void); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
86 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
87 |
RandomPropagationLossModel (); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
88 |
virtual ~RandomPropagationLossModel (); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
89 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
90 |
private: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
91 |
RandomPropagationLossModel (const RandomPropagationLossModel &o); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
92 |
RandomPropagationLossModel & operator = (const RandomPropagationLossModel &o); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
93 |
virtual double DoCalcRxPower (double txPowerDbm, |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
94 |
Ptr<MobilityModel> a, |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
95 |
Ptr<MobilityModel> b) const; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
96 |
RandomVariable m_variable; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
97 |
}; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
98 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
99 |
/** |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
100 |
* \brief a Friis propagation loss model |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
101 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
102 |
* The Friis propagation loss model was first described in |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
103 |
* "A Note on a Simple Transmission Formula", by |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
104 |
* "Harald T. Friis". |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
105 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
106 |
* The original equation was described as: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
107 |
* \f$ \frac{P_r}{P_t} = \frac{A_r A_t}{d^2\lambda^2} \f$ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
108 |
* with the following equation for the case of an |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
109 |
* isotropic antenna with no heat loss: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
110 |
* \f$ A_{isotr.} = \frac{\lambda^2}{4\pi} \f$ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
111 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
112 |
* The final equation becomes: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
113 |
* \f$ \frac{P_r}{P_t} = \frac{\lambda^2}{(4 \pi d)^2} \f$ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
114 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
115 |
* Modern extensions to this original equation are: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
116 |
* \f$ P_r = \frac{P_t G_t G_r \lambda^2}{(4 \pi d)^2 L}\f$ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
117 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
118 |
* With: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
119 |
* - \f$ P_r \f$ : reception power (W) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
120 |
* - \f$ P_t \f$ : transmission power (W) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
121 |
* - \f$ G_t \f$ : transmission gain (unit-less) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
122 |
* - \f$ G_r \f$ : reception gain (unit-less) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
123 |
* - \f$ \lambda \f$ : wavelength (m) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
124 |
* - \f$ d \f$ : distance (m) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
125 |
* - \f$ L \f$ : system loss (unit-less) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
126 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
127 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
128 |
* This model is invalid for small distance values. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
129 |
* The current implementation returns the txpower as the rxpower |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
130 |
* for any distance smaller than MinDistance. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
131 |
*/ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
132 |
class FriisPropagationLossModel : public PropagationLossModel |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
133 |
{ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
134 |
public: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
135 |
static TypeId GetTypeId (void); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
136 |
FriisPropagationLossModel (); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
137 |
/** |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
138 |
* \param frequency (Hz) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
139 |
* \param speed (m/s) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
140 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
141 |
* Set the main wavelength used in the Friis model |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
142 |
* calculation. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
143 |
*/ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
144 |
void SetLambda (double frequency, double speed); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
145 |
/** |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
146 |
* \param lambda (m) the wavelength |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
147 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
148 |
* Set the main wavelength used in the Friis model |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
149 |
* calculation. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
150 |
*/ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
151 |
void SetLambda (double lambda); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
152 |
/** |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
153 |
* \param systemLoss (dimension-less) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
154 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
155 |
* Set the system loss used by the Friis propagation model. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
156 |
*/ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
157 |
void SetSystemLoss (double systemLoss); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
158 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
159 |
/** |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
160 |
* \param minDistance the minimum distance |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
161 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
162 |
* Below this distance, the txpower is returned |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
163 |
* unmodified as the rxpower. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
164 |
*/ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
165 |
void SetMinDistance (double minDistance); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
166 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
167 |
/** |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
168 |
* \returns the minimum distance. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
169 |
*/ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
170 |
double GetMinDistance (void) const; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
171 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
172 |
/** |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
173 |
* \returns the current wavelength (m) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
174 |
*/ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
175 |
double GetLambda (void) const; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
176 |
/** |
6273
8d70de29d514
spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents:
6115
diff
changeset
|
177 |
* \returns the current system loss (dimension-less) |
5944
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
178 |
*/ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
179 |
double GetSystemLoss (void) const; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
180 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
181 |
private: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
182 |
FriisPropagationLossModel (const FriisPropagationLossModel &o); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
183 |
FriisPropagationLossModel & operator = (const FriisPropagationLossModel &o); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
184 |
virtual double DoCalcRxPower (double txPowerDbm, |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
185 |
Ptr<MobilityModel> a, |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
186 |
Ptr<MobilityModel> b) const; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
187 |
double DbmToW (double dbm) const; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
188 |
double DbmFromW (double w) const; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
189 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
190 |
static const double PI; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
191 |
double m_lambda; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
192 |
double m_systemLoss; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
193 |
double m_minDistance; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
194 |
}; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
195 |
|
5972
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
196 |
/* |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
197 |
* |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
198 |
* \brief a Two-Ray Ground propagation loss model ported from NS2 |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
199 |
* |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
200 |
* Two-ray ground reflection model. |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
201 |
* |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
202 |
* \f$ Pr = \frac{Pt * Gt * Gr * (ht^2 * hr^2)}{d^4 * L} \f$ |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
203 |
* |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
204 |
* The original equation in Rappaport's book assumes L = 1. |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
205 |
* To be consistent with the free space equation, L is added here. |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
206 |
* |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
207 |
* Ht and Hr are set at the respective nodes z coordinate plus a model parameter |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
208 |
* set via SetHeightAboveZ. |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
209 |
* |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
210 |
* The two-ray model does not give a good result for short distances, due to the |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
211 |
* oscillation caused by constructive and destructive combination of the two |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
212 |
* rays. Instead the Friis free-space model is used for small distances. |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
213 |
* |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
214 |
* The crossover distance, below which Friis is used, is calculated as follows: |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
215 |
* |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
216 |
* \f$ dCross = \frac{(4 * pi * Ht * Hr)}{lambda} \f$ |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
217 |
*/ |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
218 |
|
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
219 |
class TwoRayGroundPropagationLossModel : public PropagationLossModel |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
220 |
{ |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
221 |
public: |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
222 |
static TypeId GetTypeId (void); |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
223 |
TwoRayGroundPropagationLossModel (); |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
224 |
/** |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
225 |
* \param frequency (Hz) |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
226 |
* \param speed (m/s) |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
227 |
* |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
228 |
* Set the main wavelength used in the TwoRayGround model |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
229 |
* calculation. |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
230 |
*/ |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
231 |
void SetLambda (double frequency, double speed); |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
232 |
/** |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
233 |
* \param lambda (m) the wavelength |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
234 |
* |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
235 |
* Set the main wavelength used in the TwoRayGround model |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
236 |
* calculation. |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
237 |
*/ |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
238 |
void SetLambda (double lambda); |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
239 |
/** |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
240 |
* \param systemLoss (dimension-less) |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
241 |
* |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
242 |
* Set the system loss used by the TwoRayGround propagation model. |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
243 |
*/ |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
244 |
void SetSystemLoss (double systemLoss); |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
245 |
/** |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
246 |
* \param minDistance the minimum distance |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
247 |
* |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
248 |
* Below this distance, the txpower is returned |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
249 |
* unmodified as the rxpower. |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
250 |
*/ |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
251 |
void SetMinDistance (double minDistance); |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
252 |
/** |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
253 |
* \returns the minimum distance. |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
254 |
*/ |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
255 |
double GetMinDistance (void) const; |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
256 |
/** |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
257 |
* \returns the current wavelength (m) |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
258 |
*/ |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
259 |
double GetLambda (void) const; |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
260 |
/** |
6273
8d70de29d514
spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents:
6115
diff
changeset
|
261 |
* \returns the current system loss (dimension-less) |
5972
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
262 |
*/ |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
263 |
double GetSystemLoss (void) const; |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
264 |
/** |
6008
aa1c297a0de2
Fix non-undocumented warnings in doxygen, also update doxygen.conf
Josh Pelkey <jpelkey@gatech.edu>
parents:
5972
diff
changeset
|
265 |
* \param heightAboveZ the model antenna height above the node's Z coordinate |
aa1c297a0de2
Fix non-undocumented warnings in doxygen, also update doxygen.conf
Josh Pelkey <jpelkey@gatech.edu>
parents:
5972
diff
changeset
|
266 |
* |
aa1c297a0de2
Fix non-undocumented warnings in doxygen, also update doxygen.conf
Josh Pelkey <jpelkey@gatech.edu>
parents:
5972
diff
changeset
|
267 |
* Set the model antenna height above the node's Z coordinate |
5972
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
268 |
*/ |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
269 |
void SetHeightAboveZ (double heightAboveZ); |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
270 |
|
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
271 |
private: |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
272 |
TwoRayGroundPropagationLossModel (const TwoRayGroundPropagationLossModel &o); |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
273 |
TwoRayGroundPropagationLossModel & operator = (const TwoRayGroundPropagationLossModel &o); |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
274 |
virtual double DoCalcRxPower (double txPowerDbm, |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
275 |
Ptr<MobilityModel> a, |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
276 |
Ptr<MobilityModel> b) const; |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
277 |
double DbmToW (double dbm) const; |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
278 |
double DbmFromW (double w) const; |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
279 |
|
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
280 |
static const double PI; |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
281 |
double m_lambda; |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
282 |
double m_systemLoss; |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
283 |
double m_minDistance; |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
284 |
double m_heightAboveZ; |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
285 |
}; |
def0efbb0fd5
addition of two ray ground model and tests
tomhewer@blackbook.local
parents:
5944
diff
changeset
|
286 |
|
5944
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
287 |
/** |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
288 |
* \brief a log distance propagation model. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
289 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
290 |
* This model calculates the reception power with a so-called |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
291 |
* log-distance propagation model: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
292 |
* \f$ L = L_0 + 10 n log_{10}(\frac{d}{d_0})\f$ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
293 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
294 |
* where: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
295 |
* - \f$ n \f$ : the path loss distance exponent |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
296 |
* - \f$ d_0 \f$ : reference distance (m) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
297 |
* - \f$ L_0 \f$ : path loss at reference distance (dB) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
298 |
* - \f$ d \f$ : distance (m) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
299 |
* - \f$ L \f$ : path loss (dB) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
300 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
301 |
* When the path loss is requested at a distance smaller than |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
302 |
* the reference distance, the tx power is returned. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
303 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
304 |
*/ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
305 |
class LogDistancePropagationLossModel : public PropagationLossModel |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
306 |
{ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
307 |
public: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
308 |
static TypeId GetTypeId (void); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
309 |
LogDistancePropagationLossModel (); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
310 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
311 |
/** |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
312 |
* \param n the path loss exponent. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
313 |
* Set the path loss exponent. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
314 |
*/ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
315 |
void SetPathLossExponent (double n); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
316 |
/** |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
317 |
* \returns the current path loss exponent. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
318 |
*/ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
319 |
double GetPathLossExponent (void) const; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
320 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
321 |
void SetReference (double referenceDistance, double referenceLoss); |
7188
ea48206d68bd
propagation coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6803
diff
changeset
|
322 |
|
5944
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
323 |
private: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
324 |
LogDistancePropagationLossModel (const LogDistancePropagationLossModel &o); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
325 |
LogDistancePropagationLossModel & operator = (const LogDistancePropagationLossModel &o); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
326 |
virtual double DoCalcRxPower (double txPowerDbm, |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
327 |
Ptr<MobilityModel> a, |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
328 |
Ptr<MobilityModel> b) const; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
329 |
static Ptr<PropagationLossModel> CreateDefaultReference (void); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
330 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
331 |
double m_exponent; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
332 |
double m_referenceDistance; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
333 |
double m_referenceLoss; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
334 |
}; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
335 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
336 |
/** |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
337 |
* \brief A log distance path loss propagation model with three distance |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
338 |
* fields. This model is the same as ns3::LogDistancePropagationLossModel |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
339 |
* except that it has three distance fields: near, middle and far with |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
340 |
* different exponents. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
341 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
342 |
* Within each field the reception power is calculated using the log-distance |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
343 |
* propagation equation: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
344 |
* \f[ L = L_0 + 10 \cdot n_0 log_{10}(\frac{d}{d_0})\f] |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
345 |
* Each field begins where the previous ends and all together form a continuous function. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
346 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
347 |
* There are three valid distance fields: near, middle, far. Actually four: the |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
348 |
* first from 0 to the reference distance is invalid and returns txPowerDbm. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
349 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
350 |
* \f[ \underbrace{0 \cdots\cdots}_{=0} \underbrace{d_0 \cdots\cdots}_{n_0} \underbrace{d_1 \cdots\cdots}_{n_1} \underbrace{d_2 \cdots\cdots}_{n_2} \infty \f] |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
351 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
352 |
* Complete formula for the path loss in dB: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
353 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
354 |
* \f[\displaystyle L = |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
355 |
\begin{cases} |
7207
440bbee145f0
fix TeX formulas after doxygen change
Vedran Mileti? <rivanvx@gmail.com>
parents:
7188
diff
changeset
|
356 |
0 & d < d_0 \\ |
440bbee145f0
fix TeX formulas after doxygen change
Vedran Mileti? <rivanvx@gmail.com>
parents:
7188
diff
changeset
|
357 |
L_0 + 10 \cdot n_0 \log_{10}(\frac{d}{d_0}) & d_0 \leq d < d_1 \\ |
440bbee145f0
fix TeX formulas after doxygen change
Vedran Mileti? <rivanvx@gmail.com>
parents:
7188
diff
changeset
|
358 |
L_0 + 10 \cdot n_0 \log_{10}(\frac{d_1}{d_0}) + 10 \cdot n_1 \log_{10}(\frac{d}{d_1}) & d_1 \leq d < d_2 \\ |
5944
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
359 |
L_0 + 10 \cdot n_0 \log_{10}(\frac{d_1}{d_0}) + 10 \cdot n_1 \log_{10}(\frac{d_2}{d_1}) + 10 \cdot n_2 \log_{10}(\frac{d}{d_2})& d_2 \leq d |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
360 |
\end{cases}\f] |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
361 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
362 |
* where: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
363 |
* - \f$ L \f$ : resulting path loss (dB) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
364 |
* - \f$ d \f$ : distance (m) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
365 |
* - \f$ d_0, d_1, d_2 \f$ : three distance fields (m) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
366 |
* - \f$ n_0, n_1, n_2 \f$ : path loss distance exponent for each field (unitless) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
367 |
* - \f$ L_0 \f$ : path loss at reference distance (dB) |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
368 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
369 |
* When the path loss is requested at a distance smaller than the reference |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
370 |
* distance \f$ d_0 \f$, the tx power (with no path loss) is returned. The |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
371 |
* reference distance defaults to 1m and reference loss defaults to |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
372 |
* ns3::FriisPropagationLossModel with 5.15 GHz and is thus \f$ L_0 \f$ = 46.67 dB. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
373 |
*/ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
374 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
375 |
class ThreeLogDistancePropagationLossModel : public PropagationLossModel |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
376 |
{ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
377 |
public: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
378 |
static TypeId GetTypeId (void); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
379 |
ThreeLogDistancePropagationLossModel (); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
380 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
381 |
// Parameters are all accessible via attributes. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
382 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
383 |
private: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
384 |
ThreeLogDistancePropagationLossModel (const ThreeLogDistancePropagationLossModel& o); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
385 |
ThreeLogDistancePropagationLossModel& operator= (const ThreeLogDistancePropagationLossModel& o); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
386 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
387 |
virtual double DoCalcRxPower (double txPowerDbm, |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
388 |
Ptr<MobilityModel> a, |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
389 |
Ptr<MobilityModel> b) const; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
390 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
391 |
double m_distance0; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
392 |
double m_distance1; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
393 |
double m_distance2; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
394 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
395 |
double m_exponent0; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
396 |
double m_exponent1; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
397 |
double m_exponent2; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
398 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
399 |
double m_referenceLoss; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
400 |
}; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
401 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
402 |
/** |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
403 |
* \brief Nakagami-m fast fading propagation loss model. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
404 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
405 |
* The Nakagami-m distribution is applied to the power level. The probability |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
406 |
* density function is defined as |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
407 |
* \f[ p(x; m, \omega) = \frac{2 m^m}{\Gamma(m) \omega^m} x^{2m - 1} e^{-\frac{m}{\omega} x^2} = 2 x \cdot p_{\text{Gamma}}(x^2, m, \frac{m}{\omega}) \f] |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
408 |
* with \f$ m \f$ the fading depth parameter and \f$ \omega \f$ the average received power. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
409 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
410 |
* It is implemented by either a ns3::GammaVariable or a ns3::ErlangVariable |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
411 |
* random variable. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
412 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
413 |
* Like in ns3::ThreeLogDistancePropagationLossModel, the m parameter is varied |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
414 |
* over three distance fields: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
415 |
* \f[ \underbrace{0 \cdots\cdots}_{m_0} \underbrace{d_1 \cdots\cdots}_{m_1} \underbrace{d_2 \cdots\cdots}_{m_2} \infty \f] |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
416 |
* |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
417 |
* For m = 1 the Nakagami-m distribution equals the Rayleigh distribution. Thus |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
418 |
* this model also implements Rayleigh distribution based fast fading. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
419 |
*/ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
420 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
421 |
class NakagamiPropagationLossModel : public PropagationLossModel |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
422 |
{ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
423 |
public: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
424 |
static TypeId GetTypeId (void); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
425 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
426 |
NakagamiPropagationLossModel (); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
427 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
428 |
// Parameters are all accessible via attributes. |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
429 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
430 |
private: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
431 |
NakagamiPropagationLossModel (const NakagamiPropagationLossModel& o); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
432 |
NakagamiPropagationLossModel& operator= (const NakagamiPropagationLossModel& o); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
433 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
434 |
virtual double DoCalcRxPower (double txPowerDbm, |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
435 |
Ptr<MobilityModel> a, |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
436 |
Ptr<MobilityModel> b) const; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
437 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
438 |
double m_distance1; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
439 |
double m_distance2; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
440 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
441 |
double m_m0; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
442 |
double m_m1; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
443 |
double m_m2; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
444 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
445 |
ErlangVariable m_erlangRandomVariable; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
446 |
GammaVariable m_gammaRandomVariable; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
447 |
}; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
448 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
449 |
/** |
6622
ee39e2c196c3
Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents:
6461
diff
changeset
|
450 |
* \brief Return a constant received power level independent of the transmit |
ee39e2c196c3
Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents:
6461
diff
changeset
|
451 |
* power |
ee39e2c196c3
Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents:
6461
diff
changeset
|
452 |
* |
ee39e2c196c3
Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents:
6461
diff
changeset
|
453 |
* The received power is constant independent of the transmit power. The user |
ee39e2c196c3
Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents:
6461
diff
changeset
|
454 |
* must set received power level through the Rss attribute or public |
ee39e2c196c3
Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents:
6461
diff
changeset
|
455 |
* SetRss() method. Note that if this loss model is chained to other loss |
ee39e2c196c3
Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents:
6461
diff
changeset
|
456 |
* models via SetNext() method, it can only be the first loss model in such |
ee39e2c196c3
Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents:
6461
diff
changeset
|
457 |
* a chain, or else it will disregard the losses computed by loss models |
ee39e2c196c3
Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents:
6461
diff
changeset
|
458 |
* that precede it in the chain. |
5944
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
459 |
*/ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
460 |
class FixedRssLossModel : public PropagationLossModel |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
461 |
{ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
462 |
public: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
463 |
static TypeId GetTypeId (void); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
464 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
465 |
FixedRssLossModel (); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
466 |
virtual ~FixedRssLossModel (); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
467 |
/** |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
468 |
* \param rss (dBm) the received signal strength |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
469 |
* |
6622
ee39e2c196c3
Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents:
6461
diff
changeset
|
470 |
* Set the received signal strength (RSS) in dBm. |
5944
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
471 |
*/ |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
472 |
void SetRss (double rss); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
473 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
474 |
private: |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
475 |
FixedRssLossModel (const FixedRssLossModel &o); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
476 |
FixedRssLossModel & operator = (const FixedRssLossModel &o); |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
477 |
virtual double DoCalcRxPower (double txPowerDbm, |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
478 |
Ptr<MobilityModel> a, |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
479 |
Ptr<MobilityModel> b) const; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
480 |
double m_rss; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
481 |
}; |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
482 |
|
6115
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
483 |
/** |
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
484 |
* \brief The propagation loss is fixed for each pair of nodes and doesn't depend on their actual positions. |
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
485 |
* |
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
486 |
* This is supposed to be used by synthetic tests. Note that by default propagation loss is assumed to be symmetric. |
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
487 |
*/ |
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
488 |
class MatrixPropagationLossModel : public PropagationLossModel |
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
489 |
{ |
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
490 |
public: |
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
491 |
static TypeId GetTypeId (void); |
7188
ea48206d68bd
propagation coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6803
diff
changeset
|
492 |
|
6115
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
493 |
MatrixPropagationLossModel (); |
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
494 |
virtual ~MatrixPropagationLossModel (); |
7188
ea48206d68bd
propagation coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6803
diff
changeset
|
495 |
|
6115
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
496 |
/** |
6778
bb040260d75c
Bug 1019: common --> node --> common circular dependency
Mitch Watrous <watrous@u.washington.edu>
parents:
6622
diff
changeset
|
497 |
* \brief Set loss (in dB, positive) between pair of ns-3 objects |
bb040260d75c
Bug 1019: common --> node --> common circular dependency
Mitch Watrous <watrous@u.washington.edu>
parents:
6622
diff
changeset
|
498 |
* (typically, nodes). |
6115
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
499 |
* |
6803
f07c4f00b07e
Bug 1048: MatrixPropagationLossModel API changed from Ptr<Object> to Ptr<MobilityModel>
Pavel Boyko <boyko@iitp.ru>
parents:
6794
diff
changeset
|
500 |
* \param ma Source mobility model |
f07c4f00b07e
Bug 1048: MatrixPropagationLossModel API changed from Ptr<Object> to Ptr<MobilityModel>
Pavel Boyko <boyko@iitp.ru>
parents:
6794
diff
changeset
|
501 |
* \param mb Destination mobility model |
6115
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
502 |
* \param loss a -> b path loss, positive in dB |
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
503 |
* \param symmetric If true (default), both a->b and b->a paths will be affected |
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
504 |
*/ |
6803
f07c4f00b07e
Bug 1048: MatrixPropagationLossModel API changed from Ptr<Object> to Ptr<MobilityModel>
Pavel Boyko <boyko@iitp.ru>
parents:
6794
diff
changeset
|
505 |
void SetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b, double loss, bool symmetric = true); |
6445 | 506 |
/// Set default loss (in dB, positive) to be used, infinity if not set |
6115
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
507 |
void SetDefaultLoss (double); |
7188
ea48206d68bd
propagation coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6803
diff
changeset
|
508 |
|
6115
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
509 |
private: |
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
510 |
virtual double DoCalcRxPower (double txPowerDbm, |
7188
ea48206d68bd
propagation coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6803
diff
changeset
|
511 |
Ptr<MobilityModel> a, |
ea48206d68bd
propagation coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6803
diff
changeset
|
512 |
Ptr<MobilityModel> b) const; |
6115
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
513 |
private: |
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
514 |
/// default loss |
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
515 |
double m_default; |
7188
ea48206d68bd
propagation coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6803
diff
changeset
|
516 |
|
6115
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
517 |
typedef std::pair< Ptr<MobilityModel>, Ptr<MobilityModel> > MobilityPair; |
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
518 |
/// Fixed loss between pair of nodes |
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
519 |
std::map<MobilityPair, double> m_loss; |
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
520 |
}; |
edc1648e5ad4
Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents:
6008
diff
changeset
|
521 |
|
6461
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
522 |
/** |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
523 |
* \brief The propagation loss depends only on the distance (range) between transmitter and receiver. |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
524 |
* |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
525 |
* The single MaxRange attribute (units of meters) determines path loss. |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
526 |
* Receivers at or within MaxRange meters receive the transmission at the |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
527 |
* transmit power level. Receivers beyond MaxRange receive at power |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
528 |
* -1000 dBm (effectively zero). |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
529 |
*/ |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
530 |
class RangePropagationLossModel : public PropagationLossModel |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
531 |
{ |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
532 |
public: |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
533 |
static TypeId GetTypeId (void); |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
534 |
RangePropagationLossModel (); |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
535 |
private: |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
536 |
RangePropagationLossModel (const RangePropagationLossModel& o); |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
537 |
RangePropagationLossModel& operator= (const RangePropagationLossModel& o); |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
538 |
virtual double DoCalcRxPower (double txPowerDbm, |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
539 |
Ptr<MobilityModel> a, |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
540 |
Ptr<MobilityModel> b) const; |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
541 |
private: |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
542 |
double m_range; |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
543 |
}; |
99dd2b53fbfd
Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents:
6445
diff
changeset
|
544 |
|
5944
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
545 |
} // namespace ns3 |
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
546 |
|
b1a245ae00d4
Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff
changeset
|
547 |
#endif /* PROPAGATION_LOSS_MODEL_H */ |