ns-3
ns3::MobilityModel Class Reference

Keep track of the current position and velocity of an object. More...

#include <mobility-model.h>

Inheritance diagram for ns3::MobilityModel:
Collaboration diagram for ns3::MobilityModel:

List of all members.

Public Member Functions

Vector GetPosition (void) const
void SetPosition (const Vector &position)
Vector GetVelocity (void) const
double GetDistanceFrom (Ptr< const MobilityModel > position) const
double GetRelativeSpeed (Ptr< const MobilityModel > other) const

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::MobilityModel.

Protected Member Functions

void NotifyCourseChange (void) const

Detailed Description

Keep track of the current position and velocity of an object.

All space coordinates in this class and its subclasses are understood to be meters or meters/s. i.e., they are all metric international units.

This is a base class for all specific mobility models.


Member Function Documentation

double ns3::MobilityModel::GetRelativeSpeed ( Ptr< const MobilityModel other) const
Parameters:
otherreference to another object's mobility model
Returns:
the relative speed between the two objects. Unit is meters/s.

References GetVelocity(), ns3::Vector3D::x, ns3::Vector3D::y, and ns3::Vector3D::z.

This method returns the TypeId associated to ns3::MobilityModel.

This object is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/$ns3::MobilityModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::HierarchicalMobilityModel/Child
  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::HierarchicalMobilityModel/Parent
  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::MobilityModel
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::HierarchicalMobilityModel/Child
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::HierarchicalMobilityModel/Parent
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::MobilityModel

Attributes defined for this type:

  • Position: The current position of the mobility model.
  • Velocity: The current velocity of the mobility model.

TraceSources defined for this type:

  • CourseChange: The value of the position and/or velocity vector changed

Reimplemented from ns3::Object.

Reimplemented in ns3::WaypointMobilityModel, ns3::GaussMarkovMobilityModel, ns3::HierarchicalMobilityModel, ns3::SteadyStateRandomWaypointMobilityModel, ns3::RandomWalk2dMobilityModel, ns3::RandomWaypointMobilityModel, ns3::RandomDirection2dMobilityModel, ns3::ConstantVelocityMobilityModel, ns3::ConstantPositionMobilityModel, and ns3::ConstantAccelerationMobilityModel.

References ns3::TypeId::ATTR_GET, ns3::TypeId::ATTR_SET, GetPosition(), GetVelocity(), ns3::MakeTraceSourceAccessor(), ns3::TypeId::SetParent(), and SetPosition().

Returns:
the current velocity.

Referenced by GetRelativeSpeed(), GetTypeId(), and ns3::JakesFadingLossModel::SetValue().

void ns3::MobilityModel::NotifyCourseChange ( void  ) const [protected]

Must be invoked by subclasses when the course of the position changes to notify course change listeners.

Referenced by ns3::ConstantVelocityMobilityModel::SetVelocity().


The documentation for this class was generated from the following files: