ns3::MobilityModel Class Reference

keep track of the current position of an object More...

#include <mobility-model.h>

Inheritance diagram for ns3::MobilityModel:

Inheritance graph
[legend]
Collaboration diagram for ns3::MobilityModel:

Collaboration graph
[legend]

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

Static Public Member Functions

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

Protected Member Functions

void NotifyCourseChange (void) const

Private Member Functions

virtual Vector DoGetPosition (void) const =0
virtual void DoSetPosition (const Vector &position)=0
virtual Vector DoGetVelocity (void) const =0

Private Attributes

TracedCallback< Ptr< const
MobilityModel > > 
m_courseChangeTrace


Detailed Description

keep track of the current position 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.


Member Function Documentation

virtual Vector ns3::MobilityModel::DoGetPosition ( void   )  const [private, pure virtual]

virtual Vector ns3::MobilityModel::DoGetVelocity ( void   )  const [private, pure virtual]

virtual void ns3::MobilityModel::DoSetPosition ( const Vector position  )  [private, pure virtual]

double ns3::MobilityModel::GetDistanceFrom ( Ptr< const MobilityModel position  )  const

Parameters:
position a reference to another mobility model
Returns:
the distance between the two objects. Unit is meters.

Vector ns3::MobilityModel::GetPosition ( void   )  const

Returns:
the current position

static 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::ConstantAccelerationMobilityModel, ns3::ConstantPositionMobilityModel, ns3::ConstantVelocityMobilityModel, ns3::HierarchicalMobilityModel, ns3::RandomDirection2dMobilityModel, ns3::RandomWalk2dMobilityModel, and ns3::RandomWaypointMobilityModel.

Vector ns3::MobilityModel::GetVelocity ( void   )  const

Returns:
the current velocity.

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

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

void ns3::MobilityModel::SetPosition ( const Vector position  ) 

Parameters:
position the position to set.


Member Data Documentation

Used to alert subscribers that a change in direction, velocity, or position has occurred.


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

Generated on Fri Apr 9 15:01:10 2010 for NS-3 by  doxygen 1.5.8