A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
constant-velocity-mobility-model.h
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 */
8#ifndef CONSTANT_VELOCITY_MOBILITY_MODEL_H
9#define CONSTANT_VELOCITY_MOBILITY_MODEL_H
10
12#include "mobility-model.h"
13
14#include "ns3/nstime.h"
15
16#include <stdint.h>
17
18namespace ns3
19{
20
21/**
22 * @ingroup mobility
23 *
24 * @brief Mobility model for which the current speed does not change once it has been set and until
25 * it is set again explicitly to a new value.
26 */
28{
29 public:
30 /**
31 * Register this type with the TypeId system.
32 * @return the object TypeId
33 */
34 static TypeId GetTypeId();
35 /**
36 * Create position located at coordinates (0,0,0) with
37 * speed (0,0,0).
38 */
41
42 // Inherited from MobilityModel
43 Ptr<MobilityModel> Copy() const override
44 {
46 }
47
48 /**
49 * @param speed the new speed to set.
50 *
51 * Set the current speed now to (dx,dy,dz)
52 * Unit is meters/s
53 */
54 void SetVelocity(const Vector& speed);
55
56 private:
57 Vector DoGetPosition() const override;
58 void DoSetPosition(const Vector& position) override;
59 Vector DoGetVelocity() const override;
60 ConstantVelocityHelper m_helper; //!< helper object for this model
61};
62
63} // namespace ns3
64
65#endif /* CONSTANT_VELOCITY_POSITION */
Utility class used to move node with constant velocity.
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
Ptr< MobilityModel > Copy() const override
Copy function allows one to copy the underlying MobilityModel from a MobilityModel pointer,...
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:67
a unique identifier for an interface.
Definition type-id.h:49
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
Every class exported by the ns3 library is enclosed in the ns3 namespace.