diff --git a/src/mobility/model/random-waypoint-mobility-model.cc b/src/mobility/model/random-waypoint-mobility-model.cc index 7d6b906ca..743a0db6c 100644 --- a/src/mobility/model/random-waypoint-mobility-model.cc +++ b/src/mobility/model/random-waypoint-mobility-model.cc @@ -59,6 +59,7 @@ RandomWaypointMobilityModel::BeginWalk (void) { m_helper.Update (); Vector m_current = m_helper.GetCurrentPosition (); + NS_ASSERT_MSG (m_position, "No position allocator added before using this model"); Vector destination = m_position->GetNext (); double speed = m_speed.GetValue (); double dx = (destination.x - m_current.x); diff --git a/src/mobility/model/random-waypoint-mobility-model.h b/src/mobility/model/random-waypoint-mobility-model.h index 1e9389686..b24f41851 100644 --- a/src/mobility/model/random-waypoint-mobility-model.h +++ b/src/mobility/model/random-waypoint-mobility-model.h @@ -32,10 +32,17 @@ namespace ns3 { * \ingroup mobility * \brief Random waypoint mobility model. * - * Each object chooses a random destination "waypoint", a random speed, - * and a random pause time: it then pauses for the specified pause time, - * and starts moving towards the specified destination with the specified - * speed. Once the destination is reached the process starts again. + * Each object starts by pausing at time zero for the duration governed + * by the random variable "Pause". After pausing, the object will pick + * a new waypoint (via the PositionAllocator) and a new random speed + * via the random variable "Speed", and will begin moving towards the + * waypoint at a constant speed. When it reaches the destination, + * the process starts over (by pausing). + * + * This mobility model enforces no bounding box by itself; the + * PositionAllocator assigned to this object will bound the movement. + * If the user fails to provide a pointer to a PositionAllocator to + * be used to pick waypoints, the simulation program will assert. * * The implementation of this model is not 2d-specific. i.e. if you provide * a 3d random waypoint position model to this mobility model, the model