5G-LENA nr-v3.1-69-g2dd513a7
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
hexagonal-grid-scenario-helper.h
1// Copyright (c) 2019 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2//
3// SPDX-License-Identifier: GPL-2.0-only
4
5#ifndef HEXAGONAL_GRID_SCENARIO_HELPER_H
6#define HEXAGONAL_GRID_SCENARIO_HELPER_H
7
8#include "node-distribution-scenario-interface.h"
9
10#include <ns3/random-variable-stream.h>
11#include <ns3/vector.h>
12
13namespace ns3
14{
15
22{
23 public:
24 /*
25 * \brief Set results directory for the gnuplot file
26 */
27 void SetResultsDir(std::string resultsDir);
28
29 /*
30 * \brief Set simTag for the gnuplot file
31 */
32 void SetSimTag(std::string simTag);
33
38
43
72 void SetNumRings(uint8_t numRings);
73
78 double GetHexagonalCellRadius() const;
79
85 Vector GetHexagonalCellCenter(const Vector& sitePos, uint16_t cellId) const;
86
87 // inherited
88 void CreateScenario() override;
89
97 void CreateScenarioWithMobility(const Vector& speed, double percentage);
98
107 int64_t AssignStreams(int64_t stream);
108
109 /*
110 * \brief Sets the maximum distance between UE and the closest site.
111 * Note: used only in the function CreateScenarioWithMobility
112 */
113 void SetMaxUeDistanceToClosestSite(double maxUeDistanceToClosestSite);
114
115 private:
116 uint8_t m_numRings{0};
117 Vector m_centralPos{Vector(0, 0, 0)};
118 double m_hexagonalRadius{0.0};
119 double m_maxUeDistanceToClosestSite{
120 10000};
121
122 static std::vector<double> siteDistances;
123 static std::vector<double> siteAngles;
124
125 Ptr<UniformRandomVariable>
126 m_r;
127 Ptr<UniformRandomVariable> m_theta;
128
129 std::string m_resultsDir;
130 std::string m_simTag;
131};
132
133} // namespace ns3
134
135#endif // HEXAGONAL_GRID_SCENARIO_HELPER_H
The HexagonalGridScenarioHelper class.
Vector GetHexagonalCellCenter(const Vector &sitePos, uint16_t cellId) const
Returns the cell center coordinates.
void CreateScenario() override
Create the scenario, with the configured parameter.
~HexagonalGridScenarioHelper() override
~HexagonalGridScenarioHelper
double GetHexagonalCellRadius() const
Gets the radius of the hexagonal cell.
void SetNumRings(uint8_t numRings)
Sets the number of outer rings of sites around the central site.
void CreateScenarioWithMobility(const Vector &speed, double percentage)
This function can be used to create a scenario with UEs with mobility and define a percentage of UEs,...
HexagonalGridScenarioHelper()
HexagonalGridScenarioHelper.
Represents a scenario with base stations and user terminals.