A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
constant-velocity-mobility-model.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2006, 2007 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7 */
9
10#include "ns3/simulator.h"
11
12namespace ns3
13{
14
15NS_OBJECT_ENSURE_REGISTERED(ConstantVelocityMobilityModel);
16
17TypeId
19{
20 static TypeId tid = TypeId("ns3::ConstantVelocityMobilityModel")
22 .SetGroupName("Mobility")
23 .AddConstructor<ConstantVelocityMobilityModel>();
24 return tid;
25}
26
30
34
35void
43
44Vector
50
51void
53{
54 m_helper.SetPosition(position);
56}
57
58Vector
63
64} // namespace ns3
Vector GetCurrentPosition() const
Get current position vector.
Vector GetVelocity() const
Get velocity; if paused, will return a zero vector.
void Update() const
Update position, if not paused, from last position and time of last update.
void Unpause()
Resume mobility from current position at current velocity.
void SetPosition(const Vector &position)
Set position vector.
void SetVelocity(const Vector &vel)
Set new velocity vector.
Mobility model for which the current speed does not change once it has been set and until it is set a...
ConstantVelocityMobilityModel()
Create position located at coordinates (0,0,0) with speed (0,0,0).
void DoSetPosition(const Vector &position) override
static TypeId GetTypeId()
Register this type with the TypeId system.
ConstantVelocityHelper m_helper
helper object for this model
Keep track of the current position and velocity of an object.
void NotifyCourseChange() const
Must be invoked by subclasses when the course of the position changes to notify course change listene...
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Every class exported by the ns3 library is enclosed in the ns3 namespace.