23 #include <ns3/boolean.h>
25 #include <ns3/trace-source-accessor.h>
33 NS_OBJECT_ENSURE_REGISTERED(SatMobilityModel);
39 TypeId(
"ns3::SatMobilityModel")
40 .SetParent<MobilityModel>()
41 .AddAttribute(
"SatPosition",
42 "The current position of the mobility model.",
43 TypeId::ATTR_SET | TypeId::ATTR_GET,
48 .AddAttribute(
"AsGeoCoordinates",
49 "SetPosition method takes Geodetic coordinates in given Vector, "
50 "x=longitude, y=latitude, z=altitude",
54 .AddTraceSource(
"SatCourseChange",
55 "The value of the position and/or velocity coordinate changed",
57 "ns3::SatMobilityModel::CourseChangeCallback");
68 : m_cartesianPositionOutdated(false),
69 m_GetAsGeoCoordinates(true)
93 Vector oPosition = other->DoGetGeoPosition().ToVector();
95 return CalculateDistance(position, oPosition);
102 NotifyCourseChange();
GeoCoordinate class is used to store and operate with geodetic coordinates.
Vector ToVector() const
Converts Geodetic coordinates to Cartesian coordinates.
hold objects of type ns3::GeoCoordinate
virtual ~SatMobilityModel()=0
Destructor for SatMobilityModel.
bool m_GetAsGeoCoordinates
TypeId GetInstanceTypeId(void) const
virtual GeoCoordinate DoGetGeoPosition(void) const =0
Vector m_cartesianPosition
bool m_cartesianPositionOutdated
static TypeId GetTypeId(void)
Get the type ID.
virtual void DoSetGeoPosition(const GeoCoordinate &position)=0
void DoSetCartesianPosition(const Vector &position) const
This method is used to force update of cartesian position.
double GetDistanceFrom(Ptr< const SatMobilityModel > position) const
virtual Vector DoGetPosition(void) const
SatMobilityModel()
Default constructor.
GeoCoordinate GetGeoPosition(void) const
virtual void DoSetPosition(const Vector &position)
ns3::TracedCallback< Ptr< const SatMobilityModel > > m_satCourseChangeTrace
Used to alert subscribers that a change in direction, velocity, or position has occurred.
void SetGeoPosition(const GeoCoordinate &position)
void NotifyGeoCourseChange(void) const
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Ptr< const AttributeChecker > MakeGeoCoordinateChecker(void)