12#include "ns3/csv-reader.h"
13#include "ns3/double.h"
15#include "ns3/uinteger.h"
63 Install(satelliteContainer, orbit);
65 return satelliteContainer;
74 << orbit.
alt <<
" km, inclination = " << orbit.
inc <<
" deg, " << orbit.
planes
75 <<
" planes, " << orbit.
sats <<
" sats/plane, phasing = " << orbit.
phasing
76 <<
", RAAN span = " << orbit.
raanSpanDeg <<
" deg");
78 bool planes = orbit.
planes == 0;
79 bool sats = orbit.
sats == 0;
80 bool alt = orbit.
alt <= 0;
85 (planes ?
"Number of orbital planes must be > 0; " :
"")
86 << (sats ?
"Number of satellites per plane must be > 0; " :
"")
87 << (alt ?
"Orbital altitude must be > 0 km; " :
"")
88 << (raan ?
"RAAN span must be in (0, 360] degrees; " :
"")
89 << (phasing ?
"Phasing factor must be in [0, planes - 1]" :
""));
93 NS_LOG_WARN(
"Number of nodes " <<
nodes.GetN() <<
" does not match constellation size "
98 mobility.SetPositionAllocator(
"ns3::LeoCircularOrbitPositionAllocator",
107 mobility.SetMobilityModel(
"ns3::LeoCircularOrbitMobilityModel",
114 mobility.Install(
nodes);
123 std::vector<LeoOrbitalShell> orbits;
131 <<
": expected at least 4 columns, got "
145 <<
": non-numeric value in required column");
153 orbits.push_back(orbit);
157 "No valid orbit rows found in " << orbitFile <<
"; check file format");
168 for (
auto& orbit : orbits)
Hold a value for an Attribute.
Provides functions for parsing and extracting data from Comma Separated Value (CSV) formatted text fi...
bool GetValue(std::size_t columnIndex, T &value) const
Attempt to convert from the string data in the specified column to the specified data type.
std::size_t RowNumber() const
The number of lines that have been read.
std::size_t ColumnCount() const
Returns the number of columns in the csv data.
bool FetchNextRow()
Reads one line from the input until a new line is encountered.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
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.
double inc
Inclination of orbit (degrees).
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).
Helper class used to assign positions and mobility models to nodes.
keep track of a set of node pointers.
void Add(const NodeContainer &nc)
Append the contents of another NodeContainer to the end of this container.
Simulation virtual time values and global simulation resolution.
TimeWithUnit As(const Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
Hold an unsigned integer type.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
LeoOrbitNodeHelper class declaration.
Every class exported by the ns3 library is enclosed in the ns3 namespace.