21 #include "ns3/abort.h"
22 #include "ns3/simulator.h"
23 #include "ns3/uinteger.h"
25 #include "ns3/boolean.h"
27 #include "ns3/config.h"
41 static TypeId tid =
TypeId (
"ns3::WaypointMobilityModel")
43 .SetGroupName (
"Mobility")
45 .AddAttribute (
"NextWaypoint",
"The next waypoint used to determine position.",
49 MakeWaypointChecker ())
50 .AddAttribute (
"WaypointsLeft",
"The number of waypoints remaining.",
54 MakeUintegerChecker<uint32_t> ())
55 .AddAttribute (
"LazyNotify",
"Only call NotifyCourseChange when position is calculated.",
58 MakeBooleanChecker ())
59 .AddAttribute (
"InitialPositionIsWaypoint",
"Calling SetPosition with no waypoints creates a waypoint.",
62 MakeBooleanChecker ())
71 m_initialPositionIsWaypoint (false)
93 "Waypoints must be added in ascending time order");
118 bool newWaypoint =
false;
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
virtual Vector DoGetVelocity(void) const
double x
x coordinate of vector
keep track of time values and allow control of global simulation resolution
virtual ~WaypointMobilityModel()
void AddWaypoint(const Waypoint &waypoint)
#define NS_ASSERT(condition)
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
virtual Vector DoGetPosition(void) const
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
std::deque< Waypoint > m_waypoints
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
The attribute can be read.
Keep track of the current position and velocity of an object.
virtual void DoSetPosition(const Vector &position)
void NotifyCourseChange(void) const
Must be invoked by subclasses when the course of the position changes to notify course change listene...
Hold an unsigned integer type.
NS_LOG_COMPONENT_DEFINE("WaypointMobilityModel")
static TypeId GetTypeId(void)
double y
y coordinate of vector
static Time Now(void)
Return the "current simulation time".
void EndMobility(void)
Clear any existing waypoints and set the current waypoint time to infinity.
Waypoint-based mobility model.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if cond is true.
WaypointMobilityModel()
Create a path with no waypoints at location (0,0,0).
Waypoint GetNextWaypoint(void) const
Get the waypoint that this object is traveling towards.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
bool m_initialPositionIsWaypoint
uint32_t WaypointsLeft(void) const
Get the number of waypoints left for this object, excluding the next one.
hold objects of type ns3::Waypoint
double z
z coordinate of vector