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
- Public Member Functions inherited from ns3::Object
virtual TypeId GetInstanceTypeId (void) const
template<typename T >
Ptr< T > GetObject (void) const
template<typename T >
Ptr< T > GetObject (TypeId tid) const
void Dispose (void)
void AggregateObject (Ptr< Object > other)
AggregateIterator GetAggregateIterator (void) const
void Start (void)
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount (const SimpleRefCount &o)
SimpleRefCountoperator= (const SimpleRefCount &o)
void Ref (void) const
void Unref (void) const
uint32_t GetReferenceCount (void) const
- Public Member Functions inherited from ns3::ObjectBase
void SetAttribute (std::string name, const AttributeValue &value)
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
void GetAttribute (std::string name, AttributeValue &value) const
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)

Static Public Member Functions

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

Protected Member Functions

void NotifyCourseChange (void) const
- Protected Member Functions inherited from ns3::Object
virtual void NotifyNewAggregate (void)
virtual void DoStart (void)
virtual void DoDispose (void)
 Object (const Object &o)

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.

TypeId ns3::MobilityModel::GetTypeId ( void  )
static

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

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::BuildingsMobilityModel, 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().

Vector ns3::MobilityModel::GetVelocity ( void  ) const
Returns:
the current velocity.

Referenced by GetRelativeSpeed(), and GetTypeId().

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: