A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
constant-acceleration-mobility-model.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: GPL-2.0-only
3 *
4 * Author: Gustavo Carneiro <gjc@inescporto.pt>
5 */
6#ifndef CONSTANT_ACCELERATION_MOBILITY_MODEL_H
7#define CONSTANT_ACCELERATION_MOBILITY_MODEL_H
8
9#include "mobility-model.h"
10
11#include "ns3/nstime.h"
12
13namespace ns3
14{
15
16/**
17 * @ingroup mobility
18 *
19 * @brief Mobility model for which the current acceleration does not change once it has been set and
20 * until it is set again explicitly to a new value.
21 */
23{
24 public:
25 /**
26 * Register this type with the TypeId system.
27 * @return the object TypeId
28 */
29 static TypeId GetTypeId();
30 /**
31 * Create position located at coordinates (0,0,0) with
32 * speed (0,0,0).
33 */
36
37 // Inherited from MobilityModel
38 Ptr<MobilityModel> Copy() const override
39 {
41 }
42
43 /**
44 * Set the model's velocity and acceleration
45 * @param velocity the velocity (m/s)
46 * @param acceleration the acceleration (m/s^2)
47 */
48 void SetVelocityAndAcceleration(const Vector& velocity, const Vector& acceleration);
49
50 private:
51 Vector DoGetPosition() const override;
52 void DoSetPosition(const Vector& position) override;
53 Vector DoGetVelocity() const override;
54
55 Time m_baseTime; //!< the base time
56 Vector m_basePosition; //!< the base position
57 Vector m_baseVelocity; //!< the base velocity
58 Vector m_acceleration; //!< the acceleration
59};
60
61} // namespace ns3
62
63#endif /* CONSTANT_ACCELERATION_MOBILITY_MODEL_H */
void SetVelocityAndAcceleration(const Vector &velocity, const Vector &acceleration)
Set the model's velocity and acceleration.
static TypeId GetTypeId()
Register this type with the TypeId system.
ConstantAccelerationMobilityModel()
Create position located at coordinates (0,0,0) with speed (0,0,0).
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
Simulation virtual time values and global simulation resolution.
Definition nstime.h:96
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.