a random waypoint mobility model More...
#include <random-waypoint-mobility-model.h>
Public Member Functions | |
RandomWaypointMobilityModel () | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::RandomWaypointMobilityModel. | |
Private Member Functions | |
void | Start (void) |
void | BeginWalk (void) |
virtual Vector | DoGetPosition (void) const |
virtual void | DoSetPosition (const Vector &position) |
virtual Vector | DoGetVelocity (void) const |
Private Attributes | |
StaticSpeedHelper | m_helper |
Ptr< PositionAllocator > | m_position |
RandomVariable | m_speed |
RandomVariable | m_pause |
EventId | m_event |
a 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.
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 will still work. There is no 3d position allocator for now but it should be trivial to add one.
Definition at line 44 of file random-waypoint-mobility-model.h.
ns3::RandomWaypointMobilityModel::RandomWaypointMobilityModel | ( | ) |
Definition at line 55 of file random-waypoint-mobility-model.cc.
void ns3::RandomWaypointMobilityModel::BeginWalk | ( | void | ) | [private] |
Definition at line 61 of file random-waypoint-mobility-model.cc.
References ns3::CalculateDistance(), ns3::StaticSpeedHelper::GetCurrentPosition(), ns3::RandomVariable::GetValue(), m_event, m_helper, m_position, m_speed, ns3::MobilityModel::NotifyCourseChange(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::StaticSpeedHelper::SetVelocity(), Start(), ns3::StaticSpeedHelper::Unpause(), ns3::StaticSpeedHelper::Update(), ns3::Vector::x, ns3::Vector::y, and ns3::Vector::z.
Referenced by Start().
Vector ns3::RandomWaypointMobilityModel::DoGetPosition | ( | void | ) | const [private, virtual] |
Concrete subclasses of this base class must implement this method.
Implements ns3::MobilityModel.
Definition at line 91 of file random-waypoint-mobility-model.cc.
References ns3::StaticSpeedHelper::GetCurrentPosition(), m_helper, and ns3::StaticSpeedHelper::Update().
Vector ns3::RandomWaypointMobilityModel::DoGetVelocity | ( | void | ) | const [private, virtual] |
Concrete subclasses of this base class must implement this method.
Implements ns3::MobilityModel.
Definition at line 104 of file random-waypoint-mobility-model.cc.
void ns3::RandomWaypointMobilityModel::DoSetPosition | ( | const Vector & | position | ) | [private, virtual] |
position | the position to set. |
Concrete subclasses of this base class must implement this method.
Implements ns3::MobilityModel.
Definition at line 97 of file random-waypoint-mobility-model.cc.
TypeId ns3::RandomWaypointMobilityModel::GetTypeId | ( | void | ) | [static] |
This method returns the TypeId associated to ns3::RandomWaypointMobilityModel.
This object is accessible through the following paths with Config::Set and Config::Connect:
Attributes defined for this type:
Attributes defined in parent class ns3::MobilityModel:
No TraceSources defined for this type.
TraceSources defined in parent class ns3::MobilityModel:
Reimplemented from ns3::MobilityModel.
Definition at line 30 of file random-waypoint-mobility-model.cc.
References ns3::TypeId::AddConstructor(), m_pause, m_position, m_speed, and ns3::TypeId::SetParent().
void ns3::RandomWaypointMobilityModel::Start | ( | void | ) | [private] |
Definition at line 81 of file random-waypoint-mobility-model.cc.
References BeginWalk(), ns3::RandomVariable::GetValue(), m_event, m_helper, m_pause, ns3::MobilityModel::NotifyCourseChange(), ns3::StaticSpeedHelper::Pause(), ns3::Simulator::Schedule(), ns3::Seconds(), and ns3::StaticSpeedHelper::Update().
Referenced by BeginWalk().
Definition at line 60 of file random-waypoint-mobility-model.h.
Referenced by BeginWalk(), and Start().
Definition at line 56 of file random-waypoint-mobility-model.h.
Referenced by BeginWalk(), DoGetPosition(), and Start().
Definition at line 59 of file random-waypoint-mobility-model.h.
Referenced by GetTypeId(), and Start().
Definition at line 57 of file random-waypoint-mobility-model.h.
Referenced by BeginWalk(), and GetTypeId().
Definition at line 58 of file random-waypoint-mobility-model.h.
Referenced by BeginWalk(), and GetTypeId().