5G-LENA nr-v3.0-33-g7aea1e4
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
hexagonal-grid-scenario-helper.h
1/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2
3// Copyright (c) 2019 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4//
5// SPDX-License-Identifier: GPL-2.0-only
6
7#ifndef HEXAGONAL_GRID_SCENARIO_HELPER_H
8#define HEXAGONAL_GRID_SCENARIO_HELPER_H
9
10#include "node-distribution-scenario-interface.h"
11
12#include <ns3/random-variable-stream.h>
13#include <ns3/vector.h>
14
15namespace ns3
16{
17
24{
25 public:
26 /*
27 * \brief Set results directory for the gnuplot file
28 */
29 void SetResultsDir(std::string resultsDir);
30
31 /*
32 * \brief Set simTag for the gnuplot file
33 */
34 void SetSimTag(std::string simTag);
35
40
45
74 void SetNumRings(uint8_t numRings);
75
80 double GetHexagonalCellRadius() const;
81
87 Vector GetHexagonalCellCenter(const Vector& sitePos, uint16_t cellId) const;
88
89 // inherited
90 void CreateScenario() override;
91
99 void CreateScenarioWithMobility(const Vector& speed, double percentage);
100
109 int64_t AssignStreams(int64_t stream);
110
111 /*
112 * \brief Sets the maximum distance between UE and the closest site.
113 * Note: used only in the function CreateScenarioWithMobility
114 */
115 void SetMaxUeDistanceToClosestSite(double maxUeDistanceToClosestSite);
116
117 private:
118 uint8_t m_numRings{0};
119 Vector m_centralPos{Vector(0, 0, 0)};
120 double m_hexagonalRadius{0.0};
121 double m_maxUeDistanceToClosestSite{
122 10000};
123
124 static std::vector<double> siteDistances;
125 static std::vector<double> siteAngles;
126
127 Ptr<UniformRandomVariable>
128 m_r;
129 Ptr<UniformRandomVariable> m_theta;
130
131 std::string m_resultsDir;
132 std::string m_simTag;
133};
134
135} // namespace ns3
136
137#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.