27 #include <ns3/simulator.h>
28 #include <ns3/singleton.h>
32 NS_LOG_COMPONENT_DEFINE(
"SatTracedMobilityModel");
37 NS_OBJECT_ENSURE_REGISTERED(SatTracedMobilityModel);
43 TypeId(
"ns3::SatTracedMobilityModel")
45 .AddConstructor<SatTracedMobilityModel>()
46 .AddAttribute(
"ReferenceEllipsoid",
47 "Reference Ellipsoid model to use when reading coordinates",
49 MakeEnumAccessor<GeoCoordinate::ReferenceEllipsoid_t>(
57 .AddAttribute(
"UpdateInterval",
58 "Interval at which the position should update",
59 TimeValue(MilliSeconds(1)),
61 MakeTimeChecker(FemtoSeconds(1)));
82 NS_FATAL_ERROR(
"SatTracedMobilityModel default constructor should not be used");
86 const std::string& filename,
87 Ptr<SatAntennaGainPatternContainer> agp)
89 m_traceFilename(filename),
90 m_updateInterval(MilliSeconds(1)),
92 m_geoPosition(0.0, 0.0, 0.0),
93 m_velocity(0.0, 0.0, 0.0),
94 m_antennaGainPatterns(agp)
96 NS_LOG_FUNCTION(
this);
103 NS_LOG_FUNCTION(
this);
109 NS_LOG_FUNCTION(
this);
117 NS_LOG_FUNCTION(
this << position);
121 m_velocity = Vector(distance.x / time, distance.y / time, distance.z / time);
123 NS_LOG_INFO(
"Changing position from " <<
m_geoPosition <<
" to " << position <<
". Velocity is "
133 NS_LOG_FUNCTION(
this);
141 NS_LOG_FUNCTION(
this);
144 Singleton<SatPositionInputTraceContainer>::Get()->GetPosition(
m_traceFilename,
GeoCoordinate class is used to store and operate with geodetic coordinates.
Vector ToVector() const
Converts Geodetic coordinates to Cartesian coordinates.
Keep track of the current position and velocity of an object in satellite network.
void NotifyGeoCourseChange(void) const
void SetSatId(uint32_t satId)
Set the satellite ID linked to this node.
static TypeId GetTypeId(void)
Get the type ID.
uint32_t GetBestBeamId(bool ignoreNan=false) const
Return the best beam ID based on the current position.
Ptr< SatAntennaGainPatternContainer > m_antennaGainPatterns
virtual ~SatTracedMobilityModel()
Destructor for SatMobilityModel.
uint32_t GetSatId(void) const
Return the satellite ID linked to this node.
virtual Vector DoGetVelocity(void) const
GeoCoordinate m_geoPosition
virtual void DoDispose()
Dispose of this class instance.
void UpdateGeoPositionFromFile(void)
SatTracedMobilityModel()
Default constructor.
virtual GeoCoordinate DoGetGeoPosition(void) const
virtual void DoSetGeoPosition(const GeoCoordinate &position)
TypeId GetInstanceTypeId(void) const
GeoCoordinate::ReferenceEllipsoid_t m_refEllipsoid
std::string m_traceFilename
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.