ns-3
|
Keep track of the current position and velocity of an object. More...
#include <mobility-model.h>
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 |
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.
double ns3::MobilityModel::GetDistanceFrom | ( | Ptr< const MobilityModel > | position | ) | const |
position | a reference to another mobility model |
References ns3::CalculateDistance().
Referenced by ns3::UanPropModelThorp::GetDelay(), ns3::UanPropModelIdeal::GetDelay(), ns3::ConstantSpeedPropagationDelayModel::GetDelay(), ns3::Cost231PropagationLossModel::GetLoss(), ns3::UanPropModelThorp::GetPathLossDb(), ns3::SimpleOfdmWimaxChannel::Send(), ns3::YansWifiChannel::Send(), and ns3::UanChannel::TxPacket().
Vector ns3::MobilityModel::GetPosition | ( | void | ) | const |
Referenced by GetTypeId(), ns3::HierarchicalMobilityModel::SetChild(), and ns3::HierarchicalMobilityModel::SetParent().
double ns3::MobilityModel::GetRelativeSpeed | ( | Ptr< const MobilityModel > | other | ) | const |
other | reference to another object's mobility model |
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:
Attributes defined for this type:
TraceSources defined for this type:
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().
Vector ns3::MobilityModel::GetVelocity | ( | void | ) | const |
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().
void ns3::MobilityModel::SetPosition | ( | const Vector & | position | ) |
position | the position to set. |
Referenced by GetTypeId(), ns3::MobilityHelper::Install(), ns3::HierarchicalMobilityModel::SetChild(), and ns3::HierarchicalMobilityModel::SetParent().