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
* SPDX-License-Identifier: GPL-2.0-only
3
*
4
* Author: Davide Magrin <magrinda@dei.unipd.it>
5
*/
6
7
#ifndef BUILDING_PENETRATION_LOSS_H
8
#define BUILDING_PENETRATION_LOSS_H
9
10
#include "ns3/propagation-loss-model.h"
11
12
namespace
ns3
13
{
14
namespace
lorawan
15
{
16
17
/**
18
* @ingroup lorawan
19
*
20
* A class implementing the TR 45.820 model for building losses
21
*/
22
class
BuildingPenetrationLoss
:
public
PropagationLossModel
23
{
24
public
:
25
/**
26
* Register this type.
27
* @return The object TypeId.
28
*/
29
static
TypeId
GetTypeId
();
30
31
BuildingPenetrationLoss
();
//!< Default constructor
32
~BuildingPenetrationLoss
()
override
;
//!< Destructor
33
34
private
:
35
double
DoCalcRxPower
(
double
txPowerDbm,
36
Ptr<MobilityModel>
a,
37
Ptr<MobilityModel>
b)
const override
;
38
39
int64_t
DoAssignStreams
(int64_t stream)
override
;
40
41
/**
42
* Generate a random p value.
43
* The distribution of the returned value is as specified in TR 45.820.
44
* @return A random value in the 0-3 range.
45
*/
46
int
GetPValue
()
const
;
47
48
/**
49
* Get a value to compute the wall loss.
50
* The distribution of the returned value is as specified in TR 45.820.
51
* @return A random value in the 0-2 range.
52
*/
53
int
GetWallLossValue
()
const
;
54
55
/**
56
* Compute the wall loss associated to this mobility model
57
* @param b The mobility model associated to the node whose wall loss we need
58
* to compute.
59
* @return The power loss due to external walls.
60
*/
61
double
GetWallLoss
(
Ptr<MobilityModel>
b)
const
;
62
63
/**
64
* Get the Tor1 value used in the TR 45.820 standard to account for internal
65
* wall loss.
66
* @param b The mobility model of the node we want to compute the value for.
67
* @return The tor1 value.
68
*/
69
double
GetTor1
(
Ptr<MobilityModel>
b)
const
;
70
71
Ptr<UniformRandomVariable>
m_uniformRV
;
//!< An uniform RV
72
73
/**
74
* A map linking each mobility model to a p value.
75
*/
76
mutable
std::map<Ptr<MobilityModel>,
int
>
m_pMap
;
77
78
/**
79
* A map linking each mobility model to a value deciding its external wall
80
* loss.
81
*/
82
mutable
std::map<Ptr<MobilityModel>,
int
>
m_wallLossMap
;
83
};
84
85
}
// namespace lorawan
86
}
// namespace ns3
87
88
#endif
/* BUILDING_PENETRATION_LOSS_H */
ns3::PropagationLossModel::PropagationLossModel
PropagationLossModel()
Definition
propagation-loss-model.cc:41
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:70
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:50
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:117
ns3::lorawan::BuildingPenetrationLoss::GetWallLossValue
int GetWallLossValue() const
Get a value to compute the wall loss.
Definition
building-penetration-loss.cc:151
ns3::lorawan::BuildingPenetrationLoss::GetPValue
int GetPValue() const
Generate a random p value.
Definition
building-penetration-loss.cc:124
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:82
ns3::lorawan::BuildingPenetrationLoss::m_uniformRV
Ptr< UniformRandomVariable > m_uniformRV
An uniform RV.
Definition
building-penetration-loss.h:71
ns3::lorawan::BuildingPenetrationLoss::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition
building-penetration-loss.cc:21
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:204
ns3::lorawan::BuildingPenetrationLoss::DoCalcRxPower
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
Definition
building-penetration-loss.cc:44
ns3::lorawan::BuildingPenetrationLoss::~BuildingPenetrationLoss
~BuildingPenetrationLoss() override
Destructor.
Definition
building-penetration-loss.cc:38
ns3::lorawan::BuildingPenetrationLoss::BuildingPenetrationLoss
BuildingPenetrationLoss()
Default constructor.
Definition
building-penetration-loss.cc:30
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:76
ns3::lorawan::BuildingPenetrationLoss::GetWallLoss
double GetWallLoss(Ptr< MobilityModel > b) const
Compute the wall loss associated to this mobility model.
Definition
building-penetration-loss.cc:174
ns3::lorawan
Definition
forwarder-helper.cc:19
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lorawan
model
building-penetration-loss.h
Generated on
for ns-3 by
1.15.0