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
16
19{
20 static TypeId tid = TypeId("ns3::ConstantVelocityMobilityModel")
22 .SetGroupName("Mobility")
23 .AddConstructor<ConstantVelocityMobilityModel>();
24 return tid;
25}
26
30
34
35void
37{
38 m_helper.Update();
39 m_helper.SetVelocity(speed);
40 m_helper.Unpause();
42}
43
44Vector
46{
47 m_helper.Update();
48 return m_helper.GetCurrentPosition();
49}
50
51void
53{
54 m_helper.SetPosition(position);
56}
57
58Vector
60{
61 return m_helper.GetVelocity();
62}
63
64} // namespace ns3
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
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:49
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.