A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
leo-orbital-shell.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_ORBITAL_SHELL_H
9#define LEO_ORBITAL_SHELL_H
10
11#include "ns3/uinteger.h"
12
13/**
14 * @file
15 * @ingroup leo
16 */
17
18namespace ns3
19{
20class LeoOrbitalShell;
21
22/**
23 * @brief Serialize an orbit parameters in csv format
24 *
25 * Serialized orbit parameters as a comma-separated list in this order:
26 * - altitude (km, from earth surface)
27 * - inclination (degrees relative to equator)
28 * - number of orbital planes
29 * - number of satellites per plane
30 *
31 * Planes are evenly spaced by 360 degrees divided by the number of planes, starting from the prime
32 * meridian for Walker Delta, or 180 degrees for Walker Star.
33 *
34 * Example: "700,98,2,12" (700 km altitude, 98 degrees of inclination, 2 planes, 12
35 * satellites/plane).
36 *
37 * @return the stream
38 * @param os the stream
39 * @param [in] orbit is an Orbit
40 */
41std::ostream& operator<<(std::ostream& os, const LeoOrbitalShell& orbit);
42
43/**
44 * @brief Deserialize an orbit in csv format
45 *
46 * Deserialized orbit parameters as a comma-separated list in this order:
47 * - altitude (km, from earth surface)
48 * - inclination (degrees relative to equator)
49 * - number of orbital planes
50 * - number of satellites per plane
51 * - Walker Delta phasing factor (optional, default 0)
52 * - RAAN span in degrees (optional, default 360)
53 *
54 *
55 * Planes are evenly spaced by 360 degrees divided by the number of planes, starting from the prime
56 * meridian for Walker Delta, or 180 degrees for Walker Star.
57 *
58 * Example: "700,98,2,12" (700 km altitude, 98 degrees of inclination, 2 planes, 12
59 * satellites/plane).
60 *
61 * If deserialization fails due to unexpected fields/comments/text, the orbit is initialized with
62 * all zero fields. Input stream error flags are cleared to continue parsing, so comments can be
63 * added, except in lines with orbital parameters.
64 *
65 * @return the stream
66 * @param is the stream
67 * @param [out] orbit is the Orbit
68 */
69std::istream& operator>>(std::istream& is, LeoOrbitalShell& orbit);
70
71/**
72 * @ingroup leo
73 * @brief Orbit definition
74 */
76{
77 public:
78 /// constructor
79 LeoOrbitalShell() = default;
80
81 /**
82 * @brief Constructor
83 * @param a altitude (km, from earth surface)
84 * @param i inclination (degrees)
85 * @param p number of planes
86 * @param s number of satellites per plane
87 * @param f Walker Delta phasing factor (default 0)
88 * @param r RAAN span in degrees (360 for Walker Delta, 180 for Walker Star)
89 */
91 double i,
92 std::size_t p,
93 std::size_t s,
94 double f = 0,
95 double r = 360.0)
96 : alt(a),
97 inc(i),
98 planes(p),
99 sats(s),
100 phasing(f),
102 {
103 }
104
105 /// Altitude of orbit (km, from earth surface)
106 double alt;
107 /// Inclination of orbit (degrees)
108 double inc;
109 /// Number of planes with that altitude and inclination
110 std::size_t planes;
111 /// Number of satellites in those planes
112 std::size_t sats;
113 /// Walker Delta phasing factor F (0 means no inter-plane stagger)
114 double phasing{0};
115 /// RAAN span in degrees (360 for Walker Delta, 180 for Walker Star)
116 double raanSpanDeg{360.0};
117};
118
119}; // namespace ns3
120
121#endif
uint32_t r
Orbit definition.
double inc
Inclination of orbit (degrees).
LeoOrbitalShell()=default
constructor
std::size_t sats
Number of satellites in those planes.
double raanSpanDeg
RAAN span in degrees (360 for Walker Delta, 180 for Walker Star).
std::size_t planes
Number of planes with that altitude and inclination.
double alt
Altitude of orbit (km, from earth surface).
double phasing
Walker Delta phasing factor F (0 means no inter-plane stagger).
LeoOrbitalShell(double a, double i, std::size_t p, std::size_t s, double f=0, double r=360.0)
Constructor.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition angles.cc:148
std::istream & operator>>(std::istream &is, Angles &a)
Definition angles.cc:172