src/propagation/model/propagation-loss-model.h
author Mitch Watrous <watrous@u.washington.edu>
Wed, 18 May 2011 17:24:04 -0700
changeset 7241 0a7a16b599e8
parent 7207 440bbee145f0
child 7385 10beb0e53130
permissions -rw-r--r--
Make some more modules show up on doxygen modules page
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
7241
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
    34
/**
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
    35
 * \defgroup propagation Propagation Models
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
    36
 *
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
    37
 */
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
    38
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
    39
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
    40
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
/**
7241
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
    42
 * \ingroup propagation
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
    43
 *
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
    44
 * \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
    45
 *
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
 * 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
    47
 * 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
    48
 */
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
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
    50
{
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff changeset
    51
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
    52
  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
    53
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff changeset
    54
  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
    55
  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
    56
6622
ee39e2c196c3 Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents: 6461
diff changeset
    57
  /**
ee39e2c196c3 Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents: 6461
diff changeset
    58
   * \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
    59
   * \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
    60
   *
ee39e2c196c3 Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents: 6461
diff changeset
    61
   * 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
    62
   * 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
    63
   * of transmit power.
ee39e2c196c3 Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents: 6461
diff changeset
    64
   */
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
    65
  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
    66
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
  /**
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
   * \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
    69
   * \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
    70
   * \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
    71
   * \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
    72
   */
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
  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
    74
                      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
    75
                      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
    76
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
    77
  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
    78
  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
    79
  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
    80
                                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
    81
                                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
    82
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
  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
    84
};
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
/**
7241
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
    87
 * \ingroup propagation
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
    88
 *
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
    89
 * \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
    90
 */ 
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
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
    92
{
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
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
    94
  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
    95
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
  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
    97
  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
    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
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
   100
  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
   101
  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
   102
  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
   103
                                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
   104
                                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
   105
  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
   106
};
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
/**
7241
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
   109
 * \ingroup propagation
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
   110
 *
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
   111
 * \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
   112
 *
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
 * 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
   114
 * "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
   115
 * "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
   116
 * 
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
 * 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
   118
 *  \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
   119
 *  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
   120
 *  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
   121
 *  \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
   122
 *
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
 * 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
   124
 * \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
   125
 *
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
 * 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
   127
 * \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
   128
 *
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
 * 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
   130
 *  - \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
   131
 *  - \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
   132
 *  - \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
   133
 *  - \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
   134
 *  - \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
   135
 *  - \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
   136
 *  - \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
   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
 *
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
 * 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
   140
 * 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
   141
 * 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
   142
 */
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
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
   144
{
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
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
   146
  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
   147
  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
   148
  /**
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
   * \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
   150
   * \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
   151
   *
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
   * 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
   153
   * 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
   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
  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
   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
   * \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
   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
   * 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
   160
   * 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
   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
  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
   163
  /**
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
   * \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
   165
   *
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
   * 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
   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
  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
   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
  /**
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
   * \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
   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
   * 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
   174
   * 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
   175
   */
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
  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
   177
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
   * \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
   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
  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
   182
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
  /**
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
   * \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
   185
   */
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
  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
   187
  /**
6273
8d70de29d514 spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents: 6115
diff changeset
   188
   * \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
   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
  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
   191
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
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
   193
  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
   194
  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
   195
  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
   196
                                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
   197
                                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
   198
  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
   199
  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
   200
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff changeset
   201
  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
   202
  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
   203
  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
   204
  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
   205
};
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff changeset
   206
7241
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
   207
/**
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
   208
 * \ingroup propagation
5972
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
 * \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
   211
 *
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   212
 * Two-ray ground reflection model.
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
 * \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
   215
 *
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   216
 * 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
   217
 * 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
   218
 *
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   219
 * 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
   220
 * set via SetHeightAboveZ.
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   221
 *
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   222
 * 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
   223
 * 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
   224
 * 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
   225
 *
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   226
 * 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
   227
 *
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   228
 * \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
   229
 */
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   230
class TwoRayGroundPropagationLossModel : public PropagationLossModel
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   231
{
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   232
public:
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   233
  static TypeId GetTypeId (void);
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   234
  TwoRayGroundPropagationLossModel ();
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   235
  /**
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   236
   * \param frequency (Hz)
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   237
   * \param speed (m/s)
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   238
   *
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   239
   * 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
   240
   * calculation.
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
  void SetLambda (double frequency, double speed);
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
   * \param lambda (m) the wavelength
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
   * 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
   247
   * calculation.
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   248
   */
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   249
  void SetLambda (double lambda);
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
   * \param systemLoss (dimension-less)
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
   * 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
   254
   */
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   255
  void SetSystemLoss (double systemLoss);
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
   * \param minDistance the minimum distance
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
   * Below this distance, the txpower is returned
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   260
   * unmodified as the rxpower.
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   261
   */
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   262
  void SetMinDistance (double minDistance);
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   263
  /**
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   264
   * \returns the minimum distance.
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   265
   */
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   266
  double GetMinDistance (void) const;
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   267
  /**
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   268
   * \returns the current wavelength (m)
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   269
   */
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   270
  double GetLambda (void) const;
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   271
  /**
6273
8d70de29d514 spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents: 6115
diff changeset
   272
   * \returns the current system loss (dimension-less)
5972
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   273
   */
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   274
  double GetSystemLoss (void) const;
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   275
  /**
6008
aa1c297a0de2 Fix non-undocumented warnings in doxygen, also update doxygen.conf
Josh Pelkey <jpelkey@gatech.edu>
parents: 5972
diff changeset
   276
   * \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
   277
   *
aa1c297a0de2 Fix non-undocumented warnings in doxygen, also update doxygen.conf
Josh Pelkey <jpelkey@gatech.edu>
parents: 5972
diff changeset
   278
   * 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
   279
   */
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   280
  void SetHeightAboveZ (double heightAboveZ);
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   281
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   282
private:
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   283
  TwoRayGroundPropagationLossModel (const TwoRayGroundPropagationLossModel &o);
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   284
  TwoRayGroundPropagationLossModel & operator = (const TwoRayGroundPropagationLossModel &o);
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   285
  virtual double DoCalcRxPower (double txPowerDbm,
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   286
                                Ptr<MobilityModel> a,
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   287
                                Ptr<MobilityModel> b) const;
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   288
  double DbmToW (double dbm) const;
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   289
  double DbmFromW (double w) const;
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   290
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   291
  static const double PI;
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   292
  double m_lambda;
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   293
  double m_systemLoss;
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   294
  double m_minDistance;
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   295
  double m_heightAboveZ;
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   296
};
def0efbb0fd5 addition of two ray ground model and tests
tomhewer@blackbook.local
parents: 5944
diff changeset
   297
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
   298
/**
7241
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
   299
 * \ingroup propagation
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
   300
 *
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
   301
 * \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
   302
 *
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
 * 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
   304
 * 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
   305
 * \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
   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
 * 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
   308
 *  - \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
   309
 *  - \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
   310
 *  - \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
   311
 *  - \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
   312
 *  - \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
   313
 *
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
 * 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
   315
 * 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
   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
 */
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
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
   319
{
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
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
   321
  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
   322
  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
   323
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
  /**
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
   * \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
   326
   * 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
   327
   */
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
  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
   329
  /** 
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
   * \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
   331
   */
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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 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
   333
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
  void SetReference (double referenceDistance, double referenceLoss);
7188
ea48206d68bd propagation coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6803
diff changeset
   335
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
   336
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
   337
  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
   338
  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
   339
  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
   340
                                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
   341
                                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
   342
  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
   343
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
  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
   345
  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
   346
  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
   347
};
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
/**
7241
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
   350
 * \ingroup propagation
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
   351
 *
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
   352
 * \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
   353
 * 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
   354
 * 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
   355
 * 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
   356
 *
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff changeset
   357
 * 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
   358
 * 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
   359
 * \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
   360
 * 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
   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
 * 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
   363
 * 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
   364
 *
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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[ \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
   366
 *
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
 * 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
   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
 * \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
   370
\begin{cases}
7207
440bbee145f0 fix TeX formulas after doxygen change
Vedran Miletić <rivanvx@gmail.com>
parents: 7188
diff changeset
   371
0 & d < d_0 \\
440bbee145f0 fix TeX formulas after doxygen change
Vedran Miletić <rivanvx@gmail.com>
parents: 7188
diff changeset
   372
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
   373
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
   374
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
   375
\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
   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
 * 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
   378
 *  - \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
   379
 *  - \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
   380
 *  - \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
   381
 *  - \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
   382
 *  - \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
   383
 *
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
 * 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
   385
 * 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
   386
 * 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
   387
 * 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
   388
 */
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
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
   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
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
   392
  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
   393
  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
   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
  // 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
   396
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
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
   398
  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
   399
  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
   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
  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
   402
                                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
   403
                                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
   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
  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
   406
  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
   407
  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
   408
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
  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
   410
  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
   411
  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
   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
  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
   414
};
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
/**
7241
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
   417
 * \ingroup propagation
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
   418
 *
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
   419
 * \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
   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
 * 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
   422
 * 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
   423
 * \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
   424
 * 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
   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
 * 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
   427
 * 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
   428
 *
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
 * 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
   430
 * 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
   431
 * \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
   432
 *
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
 * 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
   434
 * 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
   435
 */
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
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
   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
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
   439
  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
   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
  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
   442
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
  // 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
   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
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
   446
  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
   447
  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
   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
  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
   450
                                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
   451
                                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
   452
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff changeset
   453
  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
   454
  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
   455
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff changeset
   456
  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
   457
  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
   458
  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
   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
  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
   461
  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
   462
};
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
/**
7241
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
   465
 * \ingroup propagation
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
   466
 *
6622
ee39e2c196c3 Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents: 6461
diff changeset
   467
 * \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
   468
 *  power
ee39e2c196c3 Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents: 6461
diff changeset
   469
 *
ee39e2c196c3 Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents: 6461
diff changeset
   470
 * 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
   471
 * 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
   472
 * 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
   473
 * 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
   474
 * 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
   475
 * 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
   476
 */ 
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
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
   478
{
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to 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
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
   480
  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
   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
  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
   483
  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
   484
  /**
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff changeset
   485
   * \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
   486
   *
6622
ee39e2c196c3 Improve documentation for propagation loss models
Tom Henderson <tomh@tomh.org>
parents: 6461
diff changeset
   487
   * 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
   488
   */
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff changeset
   489
  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
   490
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff changeset
   491
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
   492
  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
   493
  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
   494
  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
   495
                                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
   496
                                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
   497
  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
   498
};
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff changeset
   499
6115
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   500
/**
7241
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
   501
 * \ingroup propagation
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
   502
 *
6115
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   503
 * \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
   504
 * 
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   505
 * 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
   506
 */
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   507
class MatrixPropagationLossModel : public PropagationLossModel
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   508
{
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   509
public:
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   510
  static TypeId GetTypeId (void);
7188
ea48206d68bd propagation coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6803
diff changeset
   511
6115
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   512
  MatrixPropagationLossModel ();
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   513
  virtual ~MatrixPropagationLossModel ();
7188
ea48206d68bd propagation coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6803
diff changeset
   514
6115
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   515
  /**
6778
bb040260d75c Bug 1019: common --> node --> common circular dependency
Mitch Watrous <watrous@u.washington.edu>
parents: 6622
diff changeset
   516
   * \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
   517
   * (typically, nodes).
6115
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   518
   * 
6803
f07c4f00b07e Bug 1048: MatrixPropagationLossModel API changed from Ptr<Object> to Ptr<MobilityModel>
Pavel Boyko <boyko@iitp.ru>
parents: 6794
diff changeset
   519
   * \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
   520
   * \param mb          Destination mobility model
6115
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   521
   * \param loss        a -> b path loss, positive in dB
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   522
   * \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
   523
   */ 
6803
f07c4f00b07e Bug 1048: MatrixPropagationLossModel API changed from Ptr<Object> to Ptr<MobilityModel>
Pavel Boyko <boyko@iitp.ru>
parents: 6794
diff changeset
   524
  void SetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b, double loss, bool symmetric = true);
6445
43d91786d268 simple doxygen fixes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6273
diff changeset
   525
  /// 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
   526
  void SetDefaultLoss (double);
7188
ea48206d68bd propagation coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6803
diff changeset
   527
6115
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   528
private:
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   529
  virtual double DoCalcRxPower (double txPowerDbm,
7188
ea48206d68bd propagation coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6803
diff changeset
   530
                                Ptr<MobilityModel> a,
ea48206d68bd propagation coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6803
diff changeset
   531
                                Ptr<MobilityModel> b) const;
6115
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   532
private:
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   533
  /// default loss
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   534
  double m_default; 
7188
ea48206d68bd propagation coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6803
diff changeset
   535
6115
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   536
  typedef std::pair< Ptr<MobilityModel>, Ptr<MobilityModel> > MobilityPair; 
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   537
  /// Fixed loss between pair of nodes
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   538
  std::map<MobilityPair, double> m_loss;
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   539
};
edc1648e5ad4 Matrix propagation loss model added
Pavel Boyko <boyko@iitp.ru>
parents: 6008
diff changeset
   540
6461
99dd2b53fbfd Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents: 6445
diff changeset
   541
/**
7241
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
   542
 * \ingroup propagation
0a7a16b599e8 Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 7207
diff changeset
   543
 *
6461
99dd2b53fbfd Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents: 6445
diff changeset
   544
 * \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
   545
 *
99dd2b53fbfd Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents: 6445
diff changeset
   546
 * 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
   547
 * 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
   548
 * 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
   549
 * -1000 dBm (effectively zero).
99dd2b53fbfd Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents: 6445
diff changeset
   550
*/
99dd2b53fbfd Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents: 6445
diff changeset
   551
class RangePropagationLossModel : public PropagationLossModel
99dd2b53fbfd Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents: 6445
diff changeset
   552
{
99dd2b53fbfd Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents: 6445
diff changeset
   553
public:
99dd2b53fbfd Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents: 6445
diff changeset
   554
  static TypeId GetTypeId (void);
99dd2b53fbfd Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents: 6445
diff changeset
   555
  RangePropagationLossModel ();
99dd2b53fbfd Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents: 6445
diff changeset
   556
private:
99dd2b53fbfd Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents: 6445
diff changeset
   557
  RangePropagationLossModel (const RangePropagationLossModel& o);
99dd2b53fbfd Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents: 6445
diff changeset
   558
  RangePropagationLossModel& operator= (const RangePropagationLossModel& o);
99dd2b53fbfd Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents: 6445
diff changeset
   559
  virtual double DoCalcRxPower (double txPowerDbm,
99dd2b53fbfd Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents: 6445
diff changeset
   560
                                Ptr<MobilityModel> a,
99dd2b53fbfd Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents: 6445
diff changeset
   561
                                Ptr<MobilityModel> b) const;
99dd2b53fbfd Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents: 6445
diff changeset
   562
private:
99dd2b53fbfd Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents: 6445
diff changeset
   563
  double m_range;
99dd2b53fbfd Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents: 6445
diff changeset
   564
};
99dd2b53fbfd Range-based propagation loss model added
Tom Henderson <tomh@tomh.org>
parents: 6445
diff changeset
   565
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
   566
} // 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
   567
b1a245ae00d4 Moving the propagation models of wifi from src/devices/wifi to src/common. The idea is to share them with the other wireless devices.
Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
parents:
diff changeset
   568
#endif /* PROPAGATION_LOSS_MODEL_H */