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