A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
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
26
namespace
ns3
27
{
28
class
MobilityModel;
29
30
namespace
lorawan
31
{
32
33
/**
34
* \ingroup lorawan
35
*
36
* A class implementing the TR 45.820 model for building losses
37
*/
38
class
BuildingPenetrationLoss
:
public
PropagationLossModel
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,
52
Ptr<MobilityModel>
a,
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
87
Ptr<UniformRandomVariable>
m_uniformRV
;
//!< An uniform RV
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
ns3::PropagationLossModel
Models the propagation loss through a transmission medium.
Definition:
propagation-loss-model.h:56
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::lorawan::BuildingPenetrationLoss
A class implementing the TR 45.820 model for building losses.
Definition:
building-penetration-loss.h:39
ns3::lorawan::BuildingPenetrationLoss::DoAssignStreams
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
Definition:
building-penetration-loss.cc:132
ns3::lorawan::BuildingPenetrationLoss::GetWallLossValue
int GetWallLossValue() const
Get a value to compute the wall loss.
Definition:
building-penetration-loss.cc:166
ns3::lorawan::BuildingPenetrationLoss::GetPValue
int GetPValue() const
Generate a random p value.
Definition:
building-penetration-loss.cc:139
ns3::lorawan::BuildingPenetrationLoss::m_wallLossMap
std::map< Ptr< MobilityModel >, int > m_wallLossMap
A map linking each mobility model to a value deciding its external wall loss.
Definition:
building-penetration-loss.h:98
ns3::lorawan::BuildingPenetrationLoss::m_uniformRV
Ptr< UniformRandomVariable > m_uniformRV
An uniform RV.
Definition:
building-penetration-loss.h:87
ns3::lorawan::BuildingPenetrationLoss::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition:
building-penetration-loss.cc:36
ns3::lorawan::BuildingPenetrationLoss::GetTor1
double GetTor1(Ptr< MobilityModel > b) const
Get the Tor1 value used in the TR 45.820 standard to account for internal wall loss.
Definition:
building-penetration-loss.cc:219
ns3::lorawan::BuildingPenetrationLoss::DoCalcRxPower
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
Definition:
building-penetration-loss.cc:59
ns3::lorawan::BuildingPenetrationLoss::~BuildingPenetrationLoss
~BuildingPenetrationLoss() override
Destructor.
Definition:
building-penetration-loss.cc:53
ns3::lorawan::BuildingPenetrationLoss::BuildingPenetrationLoss
BuildingPenetrationLoss()
Default constructor.
Definition:
building-penetration-loss.cc:45
ns3::lorawan::BuildingPenetrationLoss::m_pMap
std::map< Ptr< MobilityModel >, int > m_pMap
A map linking each mobility model to a p value.
Definition:
building-penetration-loss.h:92
ns3::lorawan::BuildingPenetrationLoss::GetWallLoss
double GetWallLoss(Ptr< MobilityModel > b) const
Compute the wall loss associated to this mobility model.
Definition:
building-penetration-loss.cc:189
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lorawan
model
building-penetration-loss.h
Generated on Mon Aug 12 2024 11:16:15 for ns-3 by
1.9.6