A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
constant-acceleration-mobility-model.h
Go to the documentation of this file.
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License version 2 as
4 * published by the Free Software Foundation;
5 *
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14 *
15 * Author: Gustavo Carneiro <gjc@inescporto.pt>
16 */
17#ifndef CONSTANT_ACCELERATION_MOBILITY_MODEL_H
18#define CONSTANT_ACCELERATION_MOBILITY_MODEL_H
19
20#include "mobility-model.h"
21
22#include "ns3/nstime.h"
23
24namespace ns3
25{
26
27/**
28 * \ingroup mobility
29 *
30 * \brief Mobility model for which the current acceleration does not change once it has been set and
31 * until it is set again explicitly to a new value.
32 */
34{
35 public:
36 /**
37 * Register this type with the TypeId system.
38 * \return the object TypeId
39 */
40 static TypeId GetTypeId();
41 /**
42 * Create position located at coordinates (0,0,0) with
43 * speed (0,0,0).
44 */
47 /**
48 * Set the model's velocity and acceleration
49 * \param velocity the velocity (m/s)
50 * \param acceleration the acceleration (m/s^2)
51 */
52 void SetVelocityAndAcceleration(const Vector& velocity, const Vector& acceleration);
53
54 private:
55 Vector DoGetPosition() const override;
56 void DoSetPosition(const Vector& position) override;
57 Vector DoGetVelocity() const override;
58
59 Time m_baseTime; //!< the base time
60 Vector m_basePosition; //!< the base position
61 Vector m_baseVelocity; //!< the base velocity
62 Vector m_acceleration; //!< the acceleration
63};
64
65} // namespace ns3
66
67#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:105
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.