A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
building-penetration-loss.h
Go to the documentation of this file.
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License version 2 as
4 * published by the Free Software Foundation;
5 *
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14 *
15 * Author: Davide Magrin <magrinda@dei.unipd.it>
16 */
17
18#ifndef BUILDING_PENETRATION_LOSS_H
19#define BUILDING_PENETRATION_LOSS_H
20
21#include "ns3/mobility-model.h"
22#include "ns3/propagation-loss-model.h"
23#include "ns3/random-variable-stream.h"
24#include "ns3/vector.h"
25
26namespace ns3
27{
28class MobilityModel;
29
30namespace lorawan
31{
32
33/**
34 * \ingroup lorawan
35 *
36 * A class implementing the TR 45.820 model for building losses
37 */
39{
40 public:
41 /**
42 * Register this type.
43 * \return The object TypeId.
44 */
45 static TypeId GetTypeId();
46
47 BuildingPenetrationLoss(); //!< Default constructor
48 ~BuildingPenetrationLoss() override; //!< Destructor
49
50 private:
51 double DoCalcRxPower(double txPowerDbm,
53 Ptr<MobilityModel> b) const override;
54
55 int64_t DoAssignStreams(int64_t stream) override;
56
57 /**
58 * Generate a random p value.
59 * The distribution of the returned value is as specified in TR 45.820.
60 * \return A random value in the 0-3 range.
61 */
62 int GetPValue() const;
63
64 /**
65 * Get a value to compute the wall loss.
66 * The distribution of the returned value is as specified in TR 45.820.
67 * \return A random value in the 0-2 range.
68 */
69 int GetWallLossValue() const;
70
71 /**
72 * Compute the wall loss associated to this mobility model
73 * \param b The mobility model associated to the node whose wall loss we need
74 * to compute.
75 * \return The power loss due to external walls.
76 */
77 double GetWallLoss(Ptr<MobilityModel> b) const;
78
79 /**
80 * Get the Tor1 value used in the TR 45.820 standard to account for internal
81 * wall loss.
82 * \param b The mobility model of the node we want to compute the value for.
83 * \return The tor1 value.
84 */
85 double GetTor1(Ptr<MobilityModel> b) const;
86
88
89 /**
90 * A map linking each mobility model to a p value.
91 */
92 mutable std::map<Ptr<MobilityModel>, int> m_pMap;
93
94 /**
95 * A map linking each mobility model to a value deciding its external wall
96 * loss.
97 */
98 mutable std::map<Ptr<MobilityModel>, int> m_wallLossMap;
99};
100} // namespace lorawan
101} // namespace ns3
102#endif
Models the propagation loss through a transmission medium.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
a unique identifier for an interface.
Definition: type-id.h:59
A class implementing the TR 45.820 model for building losses.
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
int GetWallLossValue() const
Get a value to compute the wall loss.
int GetPValue() const
Generate a random p value.
std::map< Ptr< MobilityModel >, int > m_wallLossMap
A map linking each mobility model to a value deciding its external wall loss.
Ptr< UniformRandomVariable > m_uniformRV
An uniform RV.
static TypeId GetTypeId()
Register this type.
double GetTor1(Ptr< MobilityModel > b) const
Get the Tor1 value used in the TR 45.820 standard to account for internal wall loss.
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
std::map< Ptr< MobilityModel >, int > m_pMap
A map linking each mobility model to a p value.
double GetWallLoss(Ptr< MobilityModel > b) const
Compute the wall loss associated to this mobility model.
Every class exported by the ns3 library is enclosed in the ns3 namespace.