A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
leo-orbit-node-helper.h
Go to the documentation of this file.
1
// Copyright (c) Tim Schubert
2
//
3
// SPDX-License-Identifier: GPL-2.0-only
4
//
5
// Author: Tim Schubert <ns-3-leo@timschubert.net>
6
// Porting: Thiago Miyazaki <miyathiago@gmail.com> <t.miyazaki@unesp.br>
7
8
#ifndef LEO_ORBIT_NODE_HELPER_H
9
#define LEO_ORBIT_NODE_HELPER_H
10
11
#include "ns3/leo-orbital-shell.h"
12
#include "ns3/node-container.h"
13
#include "ns3/nstime.h"
14
#include "ns3/object-factory.h"
15
16
#include <string>
17
18
/**
19
* @file
20
* @ingroup leo
21
* LeoOrbitNodeHelper class declaration.
22
*/
23
24
namespace
ns3
25
{
26
27
/**
28
* @ingroup leo
29
* @brief Builds a node container of nodes with LEO positions using a list of
30
* orbit definitions.
31
*/
32
class
LeoOrbitNodeHelper
33
{
34
public
:
35
/**
36
* @brief Construct a LEO Orbit Node Helper.
37
*
38
* @param resolution time interval between CourseChange notifications
39
* on the installed mobility models. Smaller values produce
40
* more frequent notifications. Zero disables periodic
41
* notifications.
42
*/
43
LeoOrbitNodeHelper
(
const
Time
& resolution =
Seconds
(0));
44
45
/// destructor
46
virtual
~LeoOrbitNodeHelper
() =
default
;
47
48
/**
49
* @brief Install orbital mobility on a node container using an orbit definition.
50
* @param nodes node container
51
* @param orbit orbit definition
52
*/
53
void
Install
(
NodeContainer
nodes
,
const
LeoOrbitalShell
& orbit);
54
55
/**
56
* @brief Calculates the total number of satellites in a given LEO orbit.
57
*
58
* This method determines the total number of satellites by multiplying
59
* the number of orbital planes by the number of satellites per plane.
60
*
61
* @param orbit Orbit definition containing the number of planes
62
* and the number of satellites per plane.
63
* @return The total number of satellites in the specified orbit.
64
*/
65
std::size_t
CalculateNumberOfOrbitSatellites
(
const
LeoOrbitalShell
& orbit);
66
67
/**
68
* @brief Create satellite nodes and install orbital mobility from a CSV file.
69
*
70
* The CSV file contains one or more lines, each with 4-6 comma-separated columns:
71
* - altitude (km, from earth surface)
72
* - inclination (degrees relative to equator)
73
* - number of orbital planes
74
* - number of satellites per plane
75
* - phasing factor (optional, defaults to 0)
76
* - RAAN span in degrees (optional, defaults to 360)
77
*
78
* See LeoOrbitalShell for the definition of these parameters.
79
*
80
* Planes are evenly spaced by 360 degrees divided by the number of planes, starting from the
81
* prime meridian.
82
*
83
* One example: 1150.0,53.0,32,50, represents 32 orbital planes with 50 satellites each, with 53
84
* degrees of inclination in respect to the equator, and with an altitude of 1150 km.
85
*
86
* @param orbitFile path to orbit definitions file
87
* @returns a node container containing the created nodes
88
*/
89
NodeContainer
CreateNodesAndInstallMobility
(
const
std::string& orbitFile);
90
91
/**
92
* @brief Create satellite nodes and install orbital mobility from a vector
93
* of orbital parameters.
94
* @param orbits orbit definitions
95
* @returns a node container containing the created nodes
96
*/
97
NodeContainer
CreateNodesAndInstallMobility
(
const
std::vector<LeoOrbitalShell>& orbits);
98
99
/**
100
* @brief Create satellite nodes and install orbital mobility from a single
101
* orbit definition.
102
* @param orbit orbit definition
103
* @returns a node container containing the created nodes
104
*/
105
NodeContainer
CreateNodesAndInstallMobility
(
const
LeoOrbitalShell
& orbit);
106
107
/**
108
* Set an attribute for each node
109
*
110
* @param name name of the attribute
111
* @param value value of the attribute
112
*/
113
void
SetAttribute
(std::string name,
const
AttributeValue
& value);
114
115
/**
116
* @brief Set the time resolution for course change notifications.
117
* @param resolution the time resolution
118
*/
119
void
SetResolution
(
Time
resolution);
120
121
private
:
122
ObjectFactory
m_nodeFactory
;
///< Node factory
123
124
/// Time interval between CourseChange notifications
125
Time
m_resolution
;
126
};
127
128
};
// namespace ns3
129
130
#endif
ns3::AttributeValue
Hold a value for an Attribute.
Definition
attribute.h:59
ns3::LeoOrbitNodeHelper::SetAttribute
void SetAttribute(std::string name, const AttributeValue &value)
Set an attribute for each node.
Definition
leo-orbit-node-helper.cc:33
ns3::LeoOrbitNodeHelper::LeoOrbitNodeHelper
LeoOrbitNodeHelper(const Time &resolution=Seconds(0))
Construct a LEO Orbit Node Helper.
Definition
leo-orbit-node-helper.cc:25
ns3::LeoOrbitNodeHelper::Install
void Install(NodeContainer nodes, const LeoOrbitalShell &orbit)
Install orbital mobility on a node container using an orbit definition.
Definition
leo-orbit-node-helper.cc:69
ns3::LeoOrbitNodeHelper::CalculateNumberOfOrbitSatellites
std::size_t CalculateNumberOfOrbitSatellites(const LeoOrbitalShell &orbit)
Calculates the total number of satellites in a given LEO orbit.
Definition
leo-orbit-node-helper.cc:47
ns3::LeoOrbitNodeHelper::m_nodeFactory
ObjectFactory m_nodeFactory
Node factory.
Definition
leo-orbit-node-helper.h:122
ns3::LeoOrbitNodeHelper::SetResolution
void SetResolution(Time resolution)
Set the time resolution for course change notifications.
Definition
leo-orbit-node-helper.cc:40
ns3::LeoOrbitNodeHelper::CreateNodesAndInstallMobility
NodeContainer CreateNodesAndInstallMobility(const std::string &orbitFile)
Create satellite nodes and install orbital mobility from a CSV file.
Definition
leo-orbit-node-helper.cc:118
ns3::LeoOrbitNodeHelper::m_resolution
Time m_resolution
Time interval between CourseChange notifications.
Definition
leo-orbit-node-helper.h:125
ns3::LeoOrbitNodeHelper::~LeoOrbitNodeHelper
virtual ~LeoOrbitNodeHelper()=default
destructor
ns3::LeoOrbitalShell
Orbit definition.
Definition
leo-orbital-shell.h:76
ns3::NodeContainer
keep track of a set of node pointers.
Definition
node-container.h:29
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition
object-factory.h:37
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:95
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition
nstime.h:1273
nodes
NodeContainer nodes
Definition
lr-wpan-bootstrap.cc:43
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
mobility
helper
leo-orbit-node-helper.h
Generated on
for ns-3 by
1.16.1