A Discrete-Event Network Simulator
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
24namespace 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 */
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 */
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
126};
127
128}; // namespace ns3
129
130#endif
Hold a value for an Attribute.
Definition attribute.h:59
void SetAttribute(std::string name, const AttributeValue &value)
Set an attribute for each node.
LeoOrbitNodeHelper(const Time &resolution=Seconds(0))
Construct a LEO Orbit Node Helper.
void Install(NodeContainer nodes, const LeoOrbitalShell &orbit)
Install orbital mobility on a node container using an orbit definition.
std::size_t CalculateNumberOfOrbitSatellites(const LeoOrbitalShell &orbit)
Calculates the total number of satellites in a given LEO orbit.
ObjectFactory m_nodeFactory
Node factory.
void SetResolution(Time resolution)
Set the time resolution for course change notifications.
NodeContainer CreateNodesAndInstallMobility(const std::string &orbitFile)
Create satellite nodes and install orbital mobility from a CSV file.
Time m_resolution
Time interval between CourseChange notifications.
virtual ~LeoOrbitNodeHelper()=default
destructor
Orbit definition.
keep track of a set of node pointers.
Instantiate subclasses of ns3::Object.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:95
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1273
NodeContainer nodes
Every class exported by the ns3 library is enclosed in the ns3 namespace.