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-circular-orbit-position-allocator.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_CIRCULAR_ORBIT_POSITION_ALLOCATOR_H
9
#define LEO_CIRCULAR_ORBIT_POSITION_ALLOCATOR_H
10
11
#include "
position-allocator.h
"
12
13
/**
14
* @file
15
* @ingroup leo
16
*
17
* Declaration of LeoCircularOrbitAllocator
18
*/
19
20
namespace
ns3
21
{
22
23
/**
24
* @ingroup leo
25
* @brief Represents a position in a Walker constellation as a pair of angular
26
* coordinates.
27
*
28
* The fields are in degrees to match the LeoCircularOrbitMobilityModel
29
* SetPosition() interface (longitude/argument of latitude in degrees).
30
*/
31
struct
LeoOrbitPosition
32
{
33
double
longitude
;
///< Longitude of the ascending node in degrees
34
double
argumentOfLatitude
;
///< Argument of latitude (orbital offset) in degrees
35
double
satelliteIndex
;
///< Satellite index within the plane (kept for compat)
36
};
37
38
/**
39
* @ingroup leo
40
* @brief Allocate pairs of longitude and latitude (offset within orbit) for
41
* use in LeoCircularOrbitMobilityModel
42
*/
43
class
LeoCircularOrbitAllocator
:
public
PositionAllocator
44
{
45
public
:
46
/**
47
* @brief Get the type ID.
48
* @return the object TypeId
49
*/
50
static
TypeId
GetTypeId
();
51
52
/// constructor
53
LeoCircularOrbitAllocator
();
54
/// destructor
55
~LeoCircularOrbitAllocator
()
override
;
56
57
/**
58
* @brief Gets the next position on the longitude grid
59
*
60
* If all positions have been returned once, the first position is returned
61
* again and so on.
62
*
63
* @return LeoOrbitPosition with longitude of the ascending node in degrees
64
* (x), orbital offset / argument of latitude in degrees (y), and
65
* the satellite index within the plane (z).
66
*/
67
LeoOrbitPosition
GetNextOrbitPosition
()
const
;
68
69
/**
70
* @brief Gets the next position on the longitude grid (base class compat)
71
*
72
* If all positions have been returned once, the first position is returned
73
* again and so on.
74
*
75
* @return Vector where x is the longitude of the ascending node in
76
* degrees, y is the orbital offset in degrees, and z is the
77
* satellite index within the plane.
78
*/
79
Vector
GetNext
()
const override
;
80
81
// Inherited
82
int64_t
AssignStreams
(int64_t stream)
override
;
83
84
/**
85
* @brief Set the number of orbits (planes) in the constellation.
86
*
87
* @param num Number of orbits.
88
*/
89
void
SetNumOrbits
(uint64_t num)
90
{
91
m_config
.m_numOrbits = num;
92
}
93
94
/**
95
* @brief Get the number of orbits (planes) in the constellation.
96
*
97
* @return Number of orbits.
98
*/
99
uint64_t
GetNumOrbits
()
const
100
{
101
return
m_config
.m_numOrbits;
102
}
103
104
/**
105
* @brief Set the number of satellites per orbit.
106
*
107
* @param num Number of satellites.
108
*/
109
void
SetNumSatellites
(uint64_t num)
110
{
111
m_config
.m_numSatellites = num;
112
}
113
114
/**
115
* @brief Get the number of satellites per orbit.
116
*
117
* @return Number of satellites per orbit.
118
*/
119
uint64_t
GetNumSatellites
()
const
120
{
121
return
m_config
.m_numSatellites;
122
}
123
124
/**
125
* @brief Set the phasing factor (angular spacing between adjacent orbits).
126
*
127
* @param factor Phasing factor value.
128
*/
129
void
SetPhasingFactor
(uint16_t factor)
130
{
131
m_config
.m_phasingFactor = factor;
132
}
133
134
/**
135
* @brief Get the phasing factor.
136
*
137
* @return Phasing factor.
138
*/
139
uint16_t
GetPhasingFactor
()
const
140
{
141
return
m_config
.m_phasingFactor;
142
}
143
144
/**
145
* @brief Set the RAAN (Right Ascension of the Ascending Node) span in degrees.
146
*
147
* @param deg RAAN span in degrees.
148
*/
149
void
SetRaanSpanDeg
(
double
deg)
150
{
151
m_config
.m_raanSpanDeg = deg;
152
}
153
154
/**
155
* @brief Get the RAAN span in degrees.
156
*
157
* @return RAAN span in degrees.
158
*/
159
double
GetRaanSpanDeg
()
const
160
{
161
return
m_config
.m_raanSpanDeg;
162
}
163
164
private
:
165
/**
166
* @brief Configuration parameters for the LEO circular orbit allocator.
167
*/
168
struct
Config
169
{
170
uint64_t
m_numOrbits
;
///< Number of orbits (planes)
171
uint64_t
m_numSatellites
;
///< Number of satellites per orbit
172
uint16_t
m_phasingFactor
;
///< Phasing factor (angular spacing)
173
double
m_raanSpanDeg
;
///< RAAN span in degrees
174
}
m_config
;
///< Configuration parameters
175
176
/// The last orbit that has been assigned
177
mutable
uint64_t
m_lastOrbit
{0};
178
/// The last position inside the orbit that has been assigned
179
mutable
uint64_t
m_lastSatellite
{0};
180
};
181
182
};
// namespace ns3
183
184
#endif
ns3::LeoCircularOrbitAllocator::GetNext
Vector GetNext() const override
Gets the next position on the longitude grid (base class compat).
Definition
leo-circular-orbit-position-allocator.cc:79
ns3::LeoCircularOrbitAllocator::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
leo-circular-orbit-position-allocator.cc:35
ns3::LeoCircularOrbitAllocator::m_lastOrbit
uint64_t m_lastOrbit
The last orbit that has been assigned.
Definition
leo-circular-orbit-position-allocator.h:177
ns3::LeoCircularOrbitAllocator::GetRaanSpanDeg
double GetRaanSpanDeg() const
Get the RAAN span in degrees.
Definition
leo-circular-orbit-position-allocator.h:159
ns3::LeoCircularOrbitAllocator::GetNumOrbits
uint64_t GetNumOrbits() const
Get the number of orbits (planes) in the constellation.
Definition
leo-circular-orbit-position-allocator.h:99
ns3::LeoCircularOrbitAllocator::SetRaanSpanDeg
void SetRaanSpanDeg(double deg)
Set the RAAN (Right Ascension of the Ascending Node) span in degrees.
Definition
leo-circular-orbit-position-allocator.h:149
ns3::LeoCircularOrbitAllocator::SetNumSatellites
void SetNumSatellites(uint64_t num)
Set the number of satellites per orbit.
Definition
leo-circular-orbit-position-allocator.h:109
ns3::LeoCircularOrbitAllocator::AssignStreams
int64_t AssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
Definition
leo-circular-orbit-position-allocator.cc:73
ns3::LeoCircularOrbitAllocator::~LeoCircularOrbitAllocator
~LeoCircularOrbitAllocator() override
destructor
Definition
leo-circular-orbit-position-allocator.cc:30
ns3::LeoCircularOrbitAllocator::GetNumSatellites
uint64_t GetNumSatellites() const
Get the number of satellites per orbit.
Definition
leo-circular-orbit-position-allocator.h:119
ns3::LeoCircularOrbitAllocator::GetNextOrbitPosition
LeoOrbitPosition GetNextOrbitPosition() const
Gets the next position on the longitude grid.
Definition
leo-circular-orbit-position-allocator.cc:86
ns3::LeoCircularOrbitAllocator::m_lastSatellite
uint64_t m_lastSatellite
The last position inside the orbit that has been assigned.
Definition
leo-circular-orbit-position-allocator.h:179
ns3::LeoCircularOrbitAllocator::LeoCircularOrbitAllocator
LeoCircularOrbitAllocator()
constructor
Definition
leo-circular-orbit-position-allocator.cc:26
ns3::LeoCircularOrbitAllocator::SetNumOrbits
void SetNumOrbits(uint64_t num)
Set the number of orbits (planes) in the constellation.
Definition
leo-circular-orbit-position-allocator.h:89
ns3::LeoCircularOrbitAllocator::m_config
struct ns3::LeoCircularOrbitAllocator::Config m_config
Configuration parameters.
ns3::LeoCircularOrbitAllocator::GetPhasingFactor
uint16_t GetPhasingFactor() const
Get the phasing factor.
Definition
leo-circular-orbit-position-allocator.h:139
ns3::LeoCircularOrbitAllocator::SetPhasingFactor
void SetPhasingFactor(uint16_t factor)
Set the phasing factor (angular spacing between adjacent orbits).
Definition
leo-circular-orbit-position-allocator.h:129
ns3::PositionAllocator::PositionAllocator
PositionAllocator()
Definition
position-allocator.cc:35
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:50
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
position-allocator.h
ns3::LeoCircularOrbitAllocator::Config
Configuration parameters for the LEO circular orbit allocator.
Definition
leo-circular-orbit-position-allocator.h:169
ns3::LeoCircularOrbitAllocator::Config::m_raanSpanDeg
double m_raanSpanDeg
RAAN span in degrees.
Definition
leo-circular-orbit-position-allocator.h:173
ns3::LeoCircularOrbitAllocator::Config::m_numSatellites
uint64_t m_numSatellites
Number of satellites per orbit.
Definition
leo-circular-orbit-position-allocator.h:171
ns3::LeoCircularOrbitAllocator::Config::m_phasingFactor
uint16_t m_phasingFactor
Phasing factor (angular spacing).
Definition
leo-circular-orbit-position-allocator.h:172
ns3::LeoCircularOrbitAllocator::Config::m_numOrbits
uint64_t m_numOrbits
Number of orbits (planes).
Definition
leo-circular-orbit-position-allocator.h:170
ns3::LeoOrbitPosition
Represents a position in a Walker constellation as a pair of angular coordinates.
Definition
leo-circular-orbit-position-allocator.h:32
ns3::LeoOrbitPosition::argumentOfLatitude
double argumentOfLatitude
Argument of latitude (orbital offset) in degrees.
Definition
leo-circular-orbit-position-allocator.h:34
ns3::LeoOrbitPosition::longitude
double longitude
Longitude of the ascending node in degrees.
Definition
leo-circular-orbit-position-allocator.h:33
ns3::LeoOrbitPosition::satelliteIndex
double satelliteIndex
Satellite index within the plane (kept for compat).
Definition
leo-circular-orbit-position-allocator.h:35
src
mobility
model
leo-circular-orbit-position-allocator.h
Generated on
for ns-3 by
1.16.1