A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
leo-satellite-example.cc
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 <ns3-leo@timschubert.net>
6// Additions & Modifications: Thiago Miyazaki <miyathiago@gmail.com> <t.miyazaki@unesp.br>
7// Additions & Modifications: Jesse Chiu <jessest94106@gmail.com>
8//
9/**
10 * @file
11 * @ingroup leo
12 * Unified LEO satellite example that combines three use cases into a single program,
13 * controlled by the --mode switch:
14 *
15 * - --mode=orbit Mobility tracing only (position + speed)
16 * - --mode=antenna Antenna pointing toward a ground station (no propagation)
17 * - --mode=channel Full 3GPP NTN propagation loss estimation
18 *
19 * This example sets up a LEO constellation (from a CSV file or a default orbit),
20 * places a ground station, and optionally steers each satellite's antenna toward
21 * the ground station. At each CourseChange event, it outputs CSV trace data.
22 *
23 * Common command-line options:
24 * - orbitFile: path to a CSV containing orbit parameters for satellites
25 * - traceFile: path to a CSV file to store trace data; if omitted or empty,
26 * traces are written to stdout
27 * - resolution: time interval between CourseChange notifications (seconds)
28 * - duration: total simulation time in seconds
29 *
30 * Mode-specific options:
31 * - mode: one of orbit, antenna, channel (default: antenna)
32 * - groundStation: ground station location as "lat,lon,alt" (e.g., "41.275,1.988,14")
33 * or "auto" to place it beneath the first satellite (default: auto)
34 * - scenario: NTN propagation scenario (channel mode only)
35 * NTN-DenseUrban, NTN-Urban, NTN-Suburban, NTN-Rural (default: NTN-Rural)
36 * - frequency: carrier frequency in Hz (channel mode only, default: 2e9)
37 * - antennaGain: satellite antenna gain in dBi (antenna/channel mode, default: 34.6)
38 * - antennaUpdatePeriod: antenna orientation update interval (default: 500 ms)
39 */
40
41#include "math.h"
42
43#include "ns3/channel-condition-model.h"
44#include "ns3/core-module.h"
45#include "ns3/geocentric-constant-position-mobility-model.h"
46#include "ns3/geocentric-ecef-mobility-model.h"
47#include "ns3/geographic-positions.h"
48#include "ns3/isotropic-antenna-model.h"
49#include "ns3/leo-orbit-node-helper.h"
50#include "ns3/mobility-module.h"
51#include "ns3/three-gpp-propagation-loss-model.h"
52#include "ns3/uniform-planar-array.h"
53
54#include <fstream>
55#include <map>
56#include <sstream>
57#include <utility>
58
59using namespace ns3;
60
61NS_LOG_COMPONENT_DEFINE("LeoSatelliteExample");
62
63/// Simulation mode selected via --mode
64enum class LeoMode
65{
66 Orbit, ///< Mobility tracing only
67 Antenna, ///< Antenna pointing toward ground station
68 Channel ///< Full 3GPP NTN propagation loss
69};
70
71/**
72 * @brief Ground station definition.
73 */
75{
76 Ptr<Node> node; ///< Ground station node
77 Vector posGEO; ///< Ground station geodetic position (latitude/longitude/altitude)
78 Vector posECEF; ///< Ground station ECEF position (x/y/z in meters)
79};
80
81/// Global ground station
83
84/// Global propagation loss model (used by tracer)
86
87/**
88 * @brief Helper class to trace LEO constellation mobility and/or antenna pointing.
89 *
90 * This tracer periodically updates satellite antenna orientation toward a
91 * fixed ground station, optionally computes propagation loss, and outputs
92 * trace data including satellite position, antenna pointing vector endpoints,
93 * path loss, slant distance, and elevation angle.
94 */
96{
97 public:
98 /**
99 * @brief Construct a LeoConstellationTracer.
100 *
101 * @param groundNode Pointer to the ground station node.
102 * @param mode The simulation mode.
103 * @param propagationLossModel The propagation loss model (can be null for non-channel modes).
104 * @param groundNodePosGEO Ground station geodetic position (lat/lon/alt).
105 * @param groundNodePosECEF Ground station ECEF position (x/y/z in meters).
106 * @param traceStream Output stream for trace data.
107 */
109 LeoMode mode,
111 Vector groundNodePosGEO,
112 Vector groundNodePosECEF,
113 std::ostream* traceStream)
114 : m_mode(mode),
115 m_groundNode(groundNode),
117 m_groundNodePosGEO(groundNodePosGEO),
118 m_groundNodePosECEF(groundNodePosECEF),
119 m_traceStream(traceStream)
120 {
121 }
122
123 /**
124 * @brief Compute a point along a satellite's antenna pointing direction.
125 *
126 * Given a satellite position in ECEF and its antenna azimuth and
127 * inclination angles, this function returns a second ECEF point at the
128 * end of the antenna orientation vector (whose length equals the
129 * satellite-to-ground-station distance). The two points can be used
130 * to visualize the antenna pointing direction.
131 *
132 * @param nodePosECEF the satellite node ECEF position.
133 * @param azimuth the antenna azimuth angle in radians.
134 * @param inclination the antenna inclination angle in radians.
135 * @return ECEF coordinate of the endpoint of the orientation vector.
136 */
137 Vector GeneratePoint(const Vector& nodePosECEF,
138 const double azimuth,
139 const double inclination) const;
140
141 /**
142 * @brief Periodically steer a satellite node's antenna toward the ground station.
143 *
144 * The antenna angles are computed from the relative position between the
145 * satellite and a fixed ground station, then applied to the node's uniform
146 * planar antenna array.
147 *
148 * @param node the satellite node.
149 * @param period the interval at which to update the antenna angles (seconds).
150 */
151 void UpdateAntennaOrientation(Ptr<Node> node, Time period) const;
152
153 /**
154 * @brief CourseChange callback that outputs trace data.
155 *
156 * The output columns depend on the mode:
157 * - orbit: Time,Satellite,x,y,z,Speed
158 * - antenna: Time,Satellite,x,y,z,x_2,y_2,z_2
159 * - channel: Time,Satellite,x,y,z,x_2,y_2,z_2,PathLoss_dB,SlantDistance_m,ElevationAngle_deg
160 *
161 * @param mob the satellite mobility model that changed course.
162 */
164
165 private:
166 LeoMode m_mode; ///< Simulation mode
167 Ptr<Node> m_groundNode; ///< Ground station node
169 Vector m_groundNodePosGEO; ///< Ground station geodetic position
170 Vector m_groundNodePosECEF; ///< Ground station ECEF position
171 std::ostream* m_traceStream; ///< Output stream for trace data
172};
173
174void
176{
177 auto mobility = node->GetObject<MobilityModel>();
178 const auto satelliteNodePositionECEF = mobility->GetPosition();
179
180 // Convert from ECEF (x [m], y [m], z [m]) to Geodetic/Geographic (lat [deg], lon [deg],
181 // alt [m])
182 const Vector satelliteNodePositionGEO =
185
186 // makes translation (origin == sat node) and converts to Topocentric
187 const Vector translatedTopo =
189 satelliteNodePositionGEO,
191
192 // provide target point in Topocentric
193 const Angles angles(translatedTopo);
194
195 // set antenna angles
196 auto satelliteNodeAntenna = node->GetObject<UniformPlanarArray>();
197 satelliteNodeAntenna->SetAlpha(angles.GetAzimuth());
198 satelliteNodeAntenna->SetBeta(angles.GetInclination());
199
200 // schedules itself again after a certain period
201 Simulator::Schedule(period,
203 this,
204 node,
205 period);
206}
207
208Vector
210 const double azimuth,
211 const double inclination) const
212{
213 // Convert from ECEF (x [m], y [m], z [m]) to Geodetic/Geographic (lat [deg], lon [deg],
214 // alt [m])
215 const Vector nodePosGEO =
218
219 // in the plot, this is the magnitude of the vector that represent the antenna orientation
220 // leaving the node and reaching the ground station
221 const double orientationVectorLength = (groundStation.posECEF - nodePosECEF).GetLength();
222
223 // pre-calculate sin(inclination)
224 double s = std::sin(inclination);
225
226 // newly generated point
227 const Vector newPointUnitVectorInTopo(s * std::cos(azimuth),
228 s * std::sin(azimuth),
229 std::cos(inclination));
230
231 // apply magnitude to the unit vector
232 const Vector newPointWithMagnitudeTopo = newPointUnitVectorInTopo * orientationVectorLength;
233
234 // convert from Topocentric/ENU to Geographic (2nd arg. must be in GEO)
235 const Vector newPointWithMagnitudeGEO =
237 nodePosGEO,
239
240 // convert from Geographic to Cartesian - the plot uses cartesian coordinates.
241 const Vector newPointWithMagnitudeECEF =
243 newPointWithMagnitudeGEO.y,
244 newPointWithMagnitudeGEO.z,
246
247 return newPointWithMagnitudeECEF;
248}
249
250void
252{
253 // Skip if ground node is not yet initialized
254 if (!m_groundNode)
255 {
256 return;
257 }
258
259 const Vector satPosECEF = mob->GetPosition();
260 Ptr<const Node> node = mob->GetObject<Node>();
261
262 // Print header based on mode
263 static bool headerPrinted = false;
264 if (!headerPrinted)
265 {
266 switch (m_mode)
267 {
268 case LeoMode::Orbit:
269 (*m_traceStream) << "Time,Satellite,x,y,z,Speed" << std::endl;
270 break;
271 case LeoMode::Antenna:
272 (*m_traceStream) << "Time,Satellite,x,y,z,x_2,y_2,z_2" << std::endl;
273 break;
274 case LeoMode::Channel:
275 (*m_traceStream)
276 << "Time,Satellite,x,y,z,x_2,y_2,z_2,PathLoss_dB,SlantDistance_m,ElevationAngle_deg"
277 << std::endl;
278 break;
279 }
280 headerPrinted = true;
281 }
282
283 // Compute antenna pointing endpoint for antenna/channel modes
284 Vector newP;
286 {
287 Ptr<UniformPlanarArray> ant = node->GetObject<UniformPlanarArray>();
288 if (ant)
289 {
290 newP = GeneratePoint(satPosECEF, ant->GetAlpha(), ant->GetBeta());
291 }
292 }
293
294 if (m_mode == LeoMode::Orbit)
295 {
296 // Mobility trace: position + speed
297 (*m_traceStream) << Simulator::Now() << "," << node->GetId() << "," << satPosECEF.x << ","
298 << satPosECEF.y << "," << satPosECEF.z << ","
299 << mob->GetVelocity().GetLength() << std::endl;
300 }
301 else if (m_mode == LeoMode::Antenna)
302 {
303 // Antenna trace: position + antenna pointing endpoint
304 (*m_traceStream) << Simulator::Now() << "," << node->GetId() << "," << satPosECEF.x << ","
305 << satPosECEF.y << "," << satPosECEF.z << "," << newP.x << "," << newP.y
306 << "," << newP.z << std::endl;
307 }
308 else if (m_mode == LeoMode::Channel)
309 {
310 // Channel trace: position + antenna pointing + propagation metrics
311 // Compute slant distance between satellite and ground station
312 double slantDistance = (satPosECEF - groundStation.posECEF).GetLength();
313
314 // Compute elevation angle from ground station to satellite
315 // Convert satellite position to geographic coordinates
316 Vector satPosGEO =
319
320 // Convert to topocentric coordinates (from ground station perspective)
321 Vector topoVector =
323 groundStation.posGEO,
325
326 // Calculate elevation angle (90 degrees - inclination angle)
327 Angles angles(topoVector);
328 double elevationAngle = 90.0 - RadiansToDegrees(angles.GetInclination());
329
330 // Compute propagation loss between satellite and ground station
331 double pathLossDb = 0.0;
333 {
334 Ptr<MobilityModel> groundMobility = groundStation.node->GetObject<MobilityModel>();
335
336 // Calculate path loss using CalcRxPower with reference tx power of 0 dBm
337 // Path loss = Tx Power - Rx Power
338 double txPowerDbm = 0.0;
339 double rxPowerDbm = m_propagationLossModel->CalcRxPower(txPowerDbm,
341 groundMobility);
342 pathLossDb = txPowerDbm - rxPowerDbm;
343 }
344
345 (*m_traceStream) << Simulator::Now() << "," << node->GetId() << "," << satPosECEF.x << ","
346 << satPosECEF.y << "," << satPosECEF.z << "," << newP.x << "," << newP.y
347 << "," << newP.z << "," << pathLossDb << "," << slantDistance << ","
348 << elevationAngle << std::endl;
349 }
350}
351
352/**
353 * @brief Parse a ground station location string "lat,lon,alt" into a Vector.
354 *
355 * @param locationStr string in "lat,lon,alt" format (degrees, degrees, meters).
356 * @return Vector with x=lat, y=lon, z=alt.
357 */
358static Vector
359ParseGroundStation(const std::string& locationStr)
360{
361 std::istringstream iss(locationStr);
362 std::string token;
363 std::vector<double> values;
364 while (std::getline(iss, token, ','))
365 {
366 values.push_back(std::stod(token));
367 }
368 NS_ABORT_MSG_IF(values.size() != 3, "Ground station must be in 'lat,lon,alt' format");
369 return Vector(values[0], values[1], values[2]);
370}
371
372int
373main(int argc, char* argv[])
374{
375 // Satellite antenna gain based on Starlink's report submitted to OFCOM:
376 // https://www.ofcom.org.uk/siteassets/resources/documents/consultations/category-3-4-weeks/281181-kepler-communications-inc-application/associated-documents/starlink-annex.pdf?v=393905
377 double satAntennaGainDb = 34.6; // dBi
378
379 CommandLine cmd(__FILE__);
380 std::string orbitFile;
381 std::string traceFile;
382 std::string mode = "antenna";
383 std::string groundStationStr = "41.275,1.988,14";
384 std::string scenario = "NTN-Rural";
385 double frequencyHz = 2.0e9; // Default frequency: 2 GHz
386 Time duration = Seconds(60);
387 Time orbitTimeStepResolution = Seconds(1);
388 Time antennaUpdatePeriod = MilliSeconds(500);
389 cmd.AddValue("orbitFile",
390 "CSV file with orbit parameters. "
391 "See LeoOrbitNodeHelper::CreateNodesAndInstallMobility() for documentation.",
392 orbitFile);
393 cmd.AddValue("traceFile", "CSV file to store trace data in; empty = stdout", traceFile);
394 cmd.AddValue("mode", "Mode: orbit, antenna, channel (default: antenna)", mode);
395 cmd.AddValue("groundStation",
396 "Ground station location as 'lat,lon,alt' or 'auto' (default: 41.275,1.988,14)",
397 groundStationStr);
398 cmd.AddValue("resolution",
399 "Mobility model time resolution step (seconds)",
400 orbitTimeStepResolution);
401 cmd.AddValue("duration", "Duration of the simulation in seconds", duration);
402 cmd.AddValue("scenario",
403 "NTN propagation scenario (NTN-DenseUrban, NTN-Urban, NTN-Suburban, NTN-Rural) "
404 "(default: NTN-Rural)",
405 scenario);
406 cmd.AddValue("frequency", "Carrier frequency in Hz (default: 2e9 Hz)", frequencyHz);
407 cmd.AddValue("antennaGain", "Satellite antenna gain in dBi (default: 34.6)", satAntennaGainDb);
408 cmd.AddValue("antennaUpdatePeriod",
409 "Antenna orientation update period (default: 500 ms)",
410 antennaUpdatePeriod);
411 cmd.Parse(argc, argv);
412
413 // Parse mode
414 LeoMode simMode;
415 if (mode == "orbit")
416 {
417 simMode = LeoMode::Orbit;
418 }
419 else if (mode == "antenna")
420 {
421 simMode = LeoMode::Antenna;
422 }
423 else if (mode == "channel")
424 {
425 simMode = LeoMode::Channel;
426 }
427 else
428 {
429 NS_LOG_WARN("Unknown mode: " << mode << ". Defaulting to antenna.");
430 simMode = LeoMode::Antenna;
431 }
432
433 // Validate that channel mode has all required options
434 if (simMode == LeoMode::Channel && groundStationStr == "auto")
435 {
436 NS_LOG_WARN("Channel mode with groundStation=auto requires a valid orbitFile. "
437 "Setting groundStation to auto will place it beneath the first satellite.");
438 }
439
440 LeoOrbitNodeHelper orbit(orbitTimeStepResolution);
441
442 // creates the satellite nodes and put them into a container
443 NodeContainer satellites;
444 if (!orbitFile.empty())
445 {
446 satellites = orbit.CreateNodesAndInstallMobility(orbitFile);
447 }
448 else
449 {
450 satellites = orbit.CreateNodesAndInstallMobility(LeoOrbitalShell(1180, 30, 1, 16));
451 }
452
453 // Parse ground station location
454 Vector gsPos;
455 if (groundStationStr == "auto")
456 {
457 // Place ground station beneath the first satellite (same lat/lon, altitude = 0)
458 auto firstSatelliteMobility = satellites.Get(0)->GetObject<MobilityModel>();
459 auto firstSatellitePositionGEO = GeographicPositions::CartesianToGeographicCoordinates(
460 firstSatelliteMobility->GetPosition(),
462 gsPos = Vector(firstSatellitePositionGEO.x, firstSatellitePositionGEO.y, 0);
463 }
464 else
465 {
466 gsPos = ParseGroundStation(groundStationStr);
467 }
468
469 // create node on the ground, create mobility, set position and aggregate mobility
471 Ptr<GeocentricEcefMobilityModel> groundNodeMobility =
473 groundNodeMobility->SetGeographicPosition(gsPos);
474
475 groundStation.posGEO = groundNodeMobility->GetGeographicPosition();
476 groundStation.posECEF = groundNodeMobility->GetGeocentricPosition();
478 "Ground Node Geocentric Position (ECEF x[m]/y[m]/z[m]): " << groundStation.posECEF);
480 "Ground Node GetPosition() (ECEF x[m]/y[m]/z[m]): " << groundNodeMobility->GetPosition());
481 NS_LOG_DEBUG("Satellite GetPosition() (ECEF x[m]/y[m]/z[m]): "
482 << satellites.Get(0)->GetObject<MobilityModel>()->GetPosition());
483 NS_ASSERT_MSG(groundStation.posECEF == groundNodeMobility->GetPosition(),
484 "ECEF position mismatch. Ensure SetGeographicPosition arguments "
485 "are latitude/longitude/altitude, not cartesian coordinates.");
486
487 groundStation.node->AggregateObject(groundNodeMobility);
488
489 // Open trace file
490 std::ofstream traceOs;
491 if (!traceFile.empty())
492 {
493 traceOs.open(traceFile);
494 }
495 std::ostream* traceStream = (traceOs.is_open()) ? &traceOs : &std::cout;
496
497 // Create propagation loss model for channel mode
498 Ptr<ThreeGppPropagationLossModel> propLossModel = nullptr;
499 if (simMode == LeoMode::Channel)
500 {
501 // Supported scenarios: NTN-DenseUrban, NTN-Urban, NTN-Suburban, NTN-Rural
502 std::map<std::string, std::pair<TypeId, TypeId>> propTidCondTid{
503 {"NTN-DenseUrban",
506 {"NTN-Urban",
509 {"NTN-Suburban",
512 {"NTN-Rural",
515
516 if (propTidCondTid.find(scenario) == propTidCondTid.end())
517 {
518 NS_LOG_WARN("Unknown NTN scenario: " << scenario << ". Defaulting to NTN-Rural.");
519 scenario = "NTN-Rural";
520 }
521
522 auto [propLossTid, chanCondTid] = propTidCondTid[scenario];
523 ObjectFactory propagationLossModelFactory;
524 propagationLossModelFactory.SetTypeId(propLossTid);
525 propLossModel = propagationLossModelFactory.Create<ThreeGppPropagationLossModel>();
526 propLossModel->SetAttribute("Frequency", DoubleValue(frequencyHz));
527 propLossModel->SetAttribute("ShadowingEnabled", BooleanValue(true));
528
529 ObjectFactory channelConditionModelFactory;
530 channelConditionModelFactory.SetTypeId(chanCondTid);
532 channelConditionModelFactory.Create<ThreeGppChannelConditionModel>();
533 propLossModel->SetChannelConditionModel(condModel);
534 }
535
537 simMode,
538 propLossModel,
539 groundStation.posGEO,
540 groundStation.posECEF,
541 traceStream);
542
543 // set up trace callback
545 "/NodeList/*/$ns3::MobilityModel/CourseChange",
547
548 // Install antennas and set up antenna orientation for antenna/channel modes
549 if (simMode == LeoMode::Antenna || simMode == LeoMode::Channel)
550 {
551 ObjectFactory antennaFactory;
552 antennaFactory.SetTypeId("ns3::UniformPlanarArray");
553 antennaFactory.Set("NumColumns", UintegerValue(1));
554 antennaFactory.Set("NumRows", UintegerValue(1));
555
556 ObjectFactory elementFactory;
557 elementFactory.SetTypeId("ns3::IsotropicAntennaModel");
558 elementFactory.Set("Gain", DoubleValue(satAntennaGainDb));
559
560 Ptr<Node> node;
561 for (uint32_t i = 0; i < satellites.GetN(); i++)
562 {
563 node = satellites.Get(i);
564 antennaFactory.Set("AntennaElement",
565 PointerValue(elementFactory.Create<AntennaModel>()));
566
567 node->AggregateObject(antennaFactory.Create<UniformPlanarArray>());
568
569 tracer.UpdateAntennaOrientation(node, antennaUpdatePeriod);
570 }
571 }
572
573 Simulator::Stop(duration);
576
577 if (traceOs.is_open())
578 {
579 traceOs.close();
580 }
581}
Helper class to trace LEO constellation mobility and/or antenna pointing.
Ptr< ThreeGppPropagationLossModel > m_propagationLossModel
Propagation loss model.
Vector m_groundNodePosGEO
Ground station geodetic position.
Ptr< Node > m_groundNode
Ground station node.
Vector GeneratePoint(const Vector &nodePosECEF, const double azimuth, const double inclination) const
Compute a point along a satellite's antenna pointing direction.
LeoConstellationTracer(Ptr< Node > groundNode, LeoMode mode, Ptr< ThreeGppPropagationLossModel > propagationLossModel, Vector groundNodePosGEO, Vector groundNodePosECEF, std::ostream *traceStream)
Construct a LeoConstellationTracer.
std::ostream * m_traceStream
Output stream for trace data.
Vector m_groundNodePosECEF
Ground station ECEF position.
void UpdateAntennaOrientation(Ptr< Node > node, Time period) const
Periodically steer a satellite node's antenna toward the ground station.
LeoMode m_mode
Simulation mode.
void CourseChange(Ptr< const MobilityModel > mob) const
CourseChange callback that outputs trace data.
Class holding the azimuth and inclination angles of spherical coordinates.
Definition angles.h:107
double GetInclination() const
Getter for inclination angle.
Definition angles.cc:236
double GetAzimuth() const
Getter for azimuth angle.
Definition angles.cc:230
interface for antenna radiation pattern models
Abstract Channel Base Class.
Definition channel.h:34
Parse command-line arguments.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition double.h:31
static Vector TopocentricToGeographicCoordinates(Vector pos, Vector refPoint, EarthSpheroidType sphType)
Conversion from topocentric to geographic.
static Vector GeographicToCartesianCoordinates(double latitude, double longitude, double altitude, EarthSpheroidType sphType)
Converts earth geographic/geodetic coordinates (latitude and longitude in degrees) with a given altit...
static Vector GeographicToTopocentricCoordinates(Vector pos, Vector refPoint, EarthSpheroidType sphType)
Conversion from geographic to topocentric coordinates.
static Vector CartesianToGeographicCoordinates(Vector pos, EarthSpheroidType sphType)
Inverse of GeographicToCartesianCoordinates using [1].
Builds a node container of nodes with LEO positions using a list of orbit definitions.
Orbit definition.
Keep track of the current position and velocity of an object.
Vector GetPosition() const
keep track of a set of node pointers.
uint32_t GetN() const
Get the number of Ptr<Node> stored in this container.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
A network Node.
Definition node.h:46
Instantiate subclasses of ns3::Object.
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
Definition object.h:518
AttributeValue implementation for Pointer.
Definition pointer.h:37
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition simulator.h:580
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition simulator.cc:125
static Time Now()
Return the current simulation virtual time.
Definition simulator.cc:191
static void Run()
Run the simulation.
Definition simulator.cc:161
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Definition simulator.cc:169
Base class for the 3GPP channel condition models.
Base class for the 3GPP propagation models.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:95
Hold an unsigned integer type.
Definition uinteger.h:34
Class implementing Uniform Planar Array (UPA) model.
void SetAlpha(double alpha)
Set the bearing angle This method sets the bearing angle and computes its cosine and sine.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition assert.h:75
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition callback.h:690
bool ConnectWithoutContextFailSafe(std::string path, const CallbackBase &cb)
Definition config.cc:956
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition abort.h:97
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:194
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition log.h:260
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition log.h:253
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:627
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1273
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1290
GroundStation groundStation
Global ground station.
LeoMode
Simulation mode selected via –mode.
@ Orbit
Mobility tracing only.
@ Channel
Full 3GPP NTN propagation loss.
@ Antenna
Antenna pointing toward ground station.
Ptr< ThreeGppPropagationLossModel > propagationLossModel
Global propagation loss model (used by tracer).
static Vector ParseGroundStation(const std::string &locationStr)
Parse a ground station location string "lat,lon,alt" into a Vector.
log2() macro definition; to deal with Bug 1467.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< T1 > ConstCast(const Ptr< T2 > &p)
Cast a Ptr.
Definition ptr.h:631
double RadiansToDegrees(double radians)
converts radians to degrees
Definition angles.cc:34
Ground station definition.
Vector posGEO
Ground station geodetic position (latitude/longitude/altitude).
Vector posECEF
Ground station ECEF position (x/y/z in meters).
Ptr< Node > node
Ground station node.