A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
radio-environment-map-helper.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Nicola Baldo <nbaldo@cttc.es>
7 */
8
9#ifndef RADIO_ENVIRONMENT_MAP_HELPER_H
10#define RADIO_ENVIRONMENT_MAP_HELPER_H
11
12#include <ns3/object.h>
13
14#include <fstream>
15
16namespace ns3
17{
18
19class RemSpectrumPhy;
20class Node;
21class NetDevice;
22class SpectrumChannel;
23// class BuildingsMobilityModel;
24class MobilityModel;
25
26/**
27 * \ingroup lte
28 *
29 * Generates a 2D map of the SINR from the strongest transmitter in the
30 * downlink of an LTE FDD system. For instructions on usage, please refer to
31 * the User Documentation.
32 */
34{
35 public:
38
39 // inherited from Object
40 void DoDispose() override;
41 /**
42 * Register this type.
43 * \return The object TypeId.
44 */
45 static TypeId GetTypeId();
46
47 /**
48 * \return the bandwidth (in num of RBs) over which SINR is calculated
49 */
50 uint16_t GetBandwidth() const;
51
52 /**
53 *
54 * \param bw the bandwidth (in num of RBs) over which SINR is calculated
55 */
56 void SetBandwidth(uint16_t bw);
57
58 /**
59 * Deploy the RemSpectrumPhy objects that generate the map according to the specified settings.
60 *
61 */
62 void Install();
63
64 private:
65 /**
66 * Scheduled by Install() to perform the actual generation of map.
67 *
68 * If control channel is used for SINR calculation (the default), the delay
69 * is 2.6 milliseconds from the start of simulation. Otherwise, if data
70 * channel is used, the delay is 500.1 milliseconds from the start of
71 * simulation.
72 *
73 * The method will divide the whole map into parts (each contains at most a
74 * certain number of SINR listening points), and then call RunOneIteration()
75 * on each part, one by one.
76 */
77 void DelayedInstall();
78
79 /**
80 * Mobilize all the listeners to a specified area. Afterwards, schedule a
81 * call to PrintAndReset() in 0.5 milliseconds.
82 *
83 * \param xMin X coordinate of the first SINR listening point to deploy.
84 * \param xMax X coordinate of the last SINR listening point to deploy.
85 * \param yMin Y coordinate of the first SINR listening point to deploy.
86 * \param yMax Y coordinate of the last SINR listening point to deploy.
87 */
88 void RunOneIteration(double xMin, double xMax, double yMin, double yMax);
89
90 /// Go through every listener, write the computed SINR, and then reset it.
91 void PrintAndReset();
92
93 /// Called when the map generation procedure has been completed.
94 void Finalize();
95
96 /// A complete Radio Environment Map is composed of many of this structure.
97 struct RemPoint
98 {
99 /// Simplified listener which compute SINR over the DL channel.
101 /// Position of the listener in the environment.
103 };
104
105 /// List of listeners in the environment.
106 std::list<RemPoint> m_rem;
107
108 double m_xMin; ///< The `XMin` attribute.
109 double m_xMax; ///< The `XMax` attribute.
110 uint16_t m_xRes; ///< The `XRes` attribute.
111 double m_xStep; ///< Distance along X axis between adjacent listening points.
112
113 double m_yMin; ///< The `YMin` attribute.
114 double m_yMax; ///< The `YMax` attribute.
115 uint16_t m_yRes; ///< The `YRes` attribute.
116 double m_yStep; ///< Distance along Y axis between adjacent listening points.
117
118 uint32_t m_maxPointsPerIteration; ///< The `MaxPointsPerIteration` attribute.
119
120 uint16_t m_earfcn; ///< The `Earfcn` attribute.
121 uint16_t m_bandwidth; ///< The `Bandwidth` attribute.
122
123 double m_z; ///< The `Z` attribute.
124
125 /**
126 * The `ChannelPath` attribute. If `Channel` attribute is not set, then
127 * `ChannelPath` will be used to determine the DL channel object for which
128 * the REM will be created.
129 */
130 std::string m_channelPath;
131
132 std::string m_outputFile; ///< The `OutputFile` attribute.
133
134 bool m_stopWhenDone; ///< The `StopWhenDone` attribute.
135
136 /**
137 * The `Channel` attribute, which is a direct pointer to the DL channel
138 * object for which will be created the REM. Alternatively, `ChannelPath`
139 * attribute can be used. If `ChannelPath` attribute is being used then the
140 * m_channel object is configured by using the `ChannelPath` attribute value.
141 */
143
144 double m_noisePower; ///< The `NoisePower` attribute.
145
146 std::ofstream m_outFile; ///< Stream the output to a file.
147
148 bool m_useDataChannel; ///< The `UseDataChannel` attribute.
149 int32_t m_rbId; ///< The `RbId` attribute.
150
151}; // end of `class RadioEnvironmentMapHelper`
152
153} // namespace ns3
154
155#endif /* RADIO_ENVIRONMENT_MAP_HELPER_H */
A base class which provides memory management and object aggregation.
Definition object.h:78
Smart pointer class similar to boost::intrusive_ptr.
Generates a 2D map of the SINR from the strongest transmitter in the downlink of an LTE FDD system.
void Install()
Deploy the RemSpectrumPhy objects that generate the map according to the specified settings.
static TypeId GetTypeId()
Register this type.
std::list< RemPoint > m_rem
List of listeners in the environment.
Ptr< SpectrumChannel > m_channel
The Channel attribute, which is a direct pointer to the DL channel object for which will be created t...
std::ofstream m_outFile
Stream the output to a file.
bool m_useDataChannel
The UseDataChannel attribute.
std::string m_outputFile
The OutputFile attribute.
double m_noisePower
The NoisePower attribute.
void Finalize()
Called when the map generation procedure has been completed.
void DoDispose() override
Destructor implementation.
uint32_t m_maxPointsPerIteration
The MaxPointsPerIteration attribute.
double m_xStep
Distance along X axis between adjacent listening points.
void DelayedInstall()
Scheduled by Install() to perform the actual generation of map.
std::string m_channelPath
The ChannelPath attribute.
void PrintAndReset()
Go through every listener, write the computed SINR, and then reset it.
uint16_t m_bandwidth
The Bandwidth attribute.
void RunOneIteration(double xMin, double xMax, double yMin, double yMax)
Mobilize all the listeners to a specified area.
double m_yStep
Distance along Y axis between adjacent listening points.
bool m_stopWhenDone
The StopWhenDone attribute.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.
A complete Radio Environment Map is composed of many of this structure.
Ptr< RemSpectrumPhy > phy
Simplified listener which compute SINR over the DL channel.
Ptr< MobilityModel > bmm
Position of the listener in the environment.