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/mobility-model.h"
11#include "ns3/propagation-loss-model.h"
12#include "ns3/random-variable-stream.h"
13#include "ns3/vector.h"
14
15namespace ns3
16{
17class MobilityModel;
18
19namespace lorawan
20{
21
22/**
23 * \ingroup lorawan
24 *
25 * A class implementing the TR 45.820 model for building losses
26 */
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,
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
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
Models the propagation loss through a transmission medium.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
Definition type-id.h:48
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.