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 * Set the model's velocity and acceleration
38 * \param velocity the velocity (m/s)
39 * \param acceleration the acceleration (m/s^2)
40 */
41 void SetVelocityAndAcceleration(const Vector& velocity, const Vector& acceleration);
42
43 private:
44 Vector DoGetPosition() const override;
45 void DoSetPosition(const Vector& position) override;
46 Vector DoGetVelocity() const override;
47
48 Time m_baseTime; //!< the base time
49 Vector m_basePosition; //!< the base position
50 Vector m_baseVelocity; //!< the base velocity
51 Vector m_acceleration; //!< the acceleration
52};
53
54} // namespace ns3
55
56#endif /* CONSTANT_ACCELERATION_MOBILITY_MODEL_H */
Mobility model for which the current acceleration does not change once it has been set and until it i...
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).
Keep track of the current position and velocity of an object.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.