A Discrete-Event Network Simulator
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
12namespace ns3
13{
14namespace lorawan
15{
16
17/**
18 * @ingroup lorawan
19 *
20 * A class implementing the TR 45.820 model for building losses
21 */
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,
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
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 */
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
a unique identifier for an interface.
Definition type-id.h:50
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.