5G-LENA nr-v3.1-69-g2dd513a7
The 5G/NR module for the ns-3 simulator
|
The FileScenarioHelper class. More...
#include "file-scenario-helper.h"
Public Member Functions | |
~FileScenarioHelper () override | |
~FileScenarioHelper | |
void | Add (const std::string filePath, char delimiter=',') |
Add the positions listed in a file. The file should be a simple text file, with one position per line, either X and Y, or X, Y and Z, in meters. The delimiter can be any character, such as ',' or '\t'; the default is a comma ','. | |
void | CreateScenario () override |
Create the scenario, with the configured parameter. | |
Vector | GetAntennaPosition (const Vector &sitePos, uint16_t cellId) const |
Returns the position of the cell antenna. | |
Vector | GetSitePosition (std::size_t cellId) const |
Get the site position corresponding to a given cell. | |
Public Member Functions inherited from ns3::NodeDistributionScenarioInterface | |
~NodeDistributionScenarioInterface () override | |
~NodeDistributionScenarioInterface | |
double | GetAntennaOrientationDegrees (std::size_t cellId) const |
Returns the orientation in degrees of the antenna array for the given cellId. The orientation is the azimuth angle of the antenna bore sight. | |
double | GetAntennaOrientationRadians (std::size_t cellId) const |
Returns the orientation in radians of the antenna array for the given cellId. | |
Vector | GetAntennaPosition (const Vector &sitePos, uint16_t cellId) const |
Returns the position of the cell antenna. | |
const NodeContainer & | GetBaseStations () const |
Get the list of gnb/base station nodes. | |
uint16_t | GetCellIndex (std::size_t ueId) const |
Get the cell (base station) index the queried UE id belongs to. | |
std::size_t | GetNumCells () const |
Gets the total number of cells deployed. | |
std::size_t | GetNumSites () const |
Gets the number of sites with cell base stations. | |
uint16_t | GetSectorIndex (std::size_t cellId) const |
Get the sector index the queried cell id belongs to. | |
uint16_t | GetSiteIndex (std::size_t cellId) const |
Gets the site index the queried cell id belongs to. | |
const NodeContainer & | GetUserTerminals () const |
Get the list of user nodes. | |
void | SetBsNumber (std::size_t n) |
Set the number of base stations. | |
void | SetSitesNumber (std::size_t n) |
Set number of sites/towers. | |
void | SetUtNumber (std::size_t n) |
Set the number of UT/UE. | |
Public Member Functions inherited from ns3::ScenarioParameters | |
virtual | ~ScenarioParameters () |
~ScenarioParameters | |
uint32_t | GetNumSectorsPerSite () const |
Gets the number of sectors per site. | |
void | SetBsHeight (double h) |
SetGnbHeight. | |
void | SetRMaParameters () |
Sets rural Macro scenario parameters. | |
void | SetScenarioParameters (const ScenarioParameters &scenario) |
Sets parameters to the specified scenario. | |
void | SetScenarioParameters (const std::string &scenario) |
Sets parameters to the specified scenario. | |
void | SetSectorization (SiteSectorizationType numSectors) |
Sets the number of sectors of every site. | |
void | SetSectorization (uint32_t numSectors) |
Sets the number of sectors of every site. | |
void | SetUMaParameters () |
Sets the Urban Macro (UMa) scenario parameters. | |
void | SetUMiParameters () |
Sets the Urban Micro (UMi) scenario parameters. | |
void | SetUtHeight (double h) |
SetUeHeight. | |
Additional Inherited Members | |
Public Types inherited from ns3::ScenarioParameters | |
enum | SiteSectorizationType { NONE = 0 , SINGLE = 1 , TRIPLE = 3 } |
Type of site sectorization. More... | |
Public Attributes inherited from ns3::ScenarioParameters | |
double | m_antennaOffset {-1.0} |
Cell antenna offset in meters w.r.t. site location. | |
double | m_bsHeight {-1.0} |
Height of gNB nodes. | |
double | m_isd {-1.0} |
Inter-site distance (ISD) in meters. | |
double | m_minBsUtDistance {-1.0} |
Minimum distance between BS and UT in meters. | |
SiteSectorizationType | m_sectorization {NONE} |
Number of sectors per site. | |
double | m_utHeight {-1.0} |
Height of UE nodes. | |
Static Public Attributes inherited from ns3::ScenarioParameters | |
static double | MAX_ANTENNA_OFFSET = 1 |
Protected Attributes inherited from ns3::NodeDistributionScenarioInterface | |
NodeContainer | m_bs |
Base stations. | |
std::size_t | m_numBs |
Number of base stations to create. | |
std::size_t | m_numSites |
Number of sites with base stations. | |
std::size_t | m_numUt |
Number of user terminals to create. | |
NodeContainer | m_ut |
User Terminals. | |
The FileScenarioHelper class.
This scenario helper reads site locations from a CSV file. First Add() the positions, then CreateScenario(). Most Get() functions won't be valid before those two steps.
Definition at line 28 of file file-scenario-helper.h.
|
override |
~FileScenarioHelper
Definition at line 124 of file file-scenario-helper.cc.
void ns3::FileScenarioHelper::Add | ( | const std::string | filePath, |
char | delimiter = ',' |
||
) |
Add the positions listed in a file. The file should be a simple text file, with one position per line, either X and Y, or X, Y and Z, in meters. The delimiter can be any character, such as ',' or '\t'; the default is a comma ','.
The file is read using CsvReader, which explains how comments and whitespace are handled.
Multiple calls to Add() will append the positions from each successive file to the list of sites.
[in] | filePath | The path to the input file. |
[in] | delimiter | The delimiter character; see CsvReader. |
Definition at line 129 of file file-scenario-helper.cc.
References ns3::ScenarioParameters::m_bsHeight, and ns3::NodeDistributionScenarioInterface::SetSitesNumber().
|
overridevirtual |
Create the scenario, with the configured parameter.
After this call, GetGnbs and GetUes will return the containers with the nodes created and positioned.
Implements ns3::NodeDistributionScenarioInterface.
Definition at line 160 of file file-scenario-helper.cc.
References ns3::NodeDistributionScenarioInterface::GetAntennaOrientationRadians(), ns3::NodeDistributionScenarioInterface::GetCellIndex(), ns3::ScenarioParameters::GetNumSectorsPerSite(), ns3::NodeDistributionScenarioInterface::GetSiteIndex(), ns3::ScenarioParameters::m_antennaOffset, ns3::NodeDistributionScenarioInterface::m_bs, ns3::ScenarioParameters::m_bsHeight, ns3::ScenarioParameters::m_isd, ns3::ScenarioParameters::m_minBsUtDistance, ns3::NodeDistributionScenarioInterface::m_numBs, ns3::NodeDistributionScenarioInterface::m_numSites, ns3::NodeDistributionScenarioInterface::m_numUt, ns3::ScenarioParameters::m_sectorization, ns3::NodeDistributionScenarioInterface::m_ut, ns3::ScenarioParameters::m_utHeight, and ns3::ScenarioParameters::NONE.
Vector ns3::NodeDistributionScenarioInterface::GetAntennaPosition | ( | const Vector & | sitePos, |
uint16_t | cellId | ||
) | const |
Returns the position of the cell antenna.
sitePos | Site position coordinates in meters |
cellId | Id Cell id of the antenna |
Definition at line 106 of file node-distribution-scenario-interface.cc.
Vector ns3::FileScenarioHelper::GetSitePosition | ( | std::size_t | cellId | ) | const |
Get the site position corresponding to a given cell.
cellId | the cell ID of the antenna |
Definition at line 150 of file file-scenario-helper.cc.
References ns3::NodeDistributionScenarioInterface::m_bs.