A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
mobility
model
constant-velocity-helper.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2006,2007 INRIA
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
*/
20
#ifndef CONSTANT_VELOCITY_HELPER_H
21
#define CONSTANT_VELOCITY_HELPER_H
22
23
#include "ns3/nstime.h"
24
#include "ns3/vector.h"
25
#include "ns3/box.h"
26
27
namespace
ns3
{
28
29
class
Rectangle;
30
36
class
ConstantVelocityHelper
37
{
38
public
:
39
ConstantVelocityHelper
();
44
ConstantVelocityHelper
(
const
Vector &position);
50
ConstantVelocityHelper
(
const
Vector &position,
51
const
Vector &vel);
52
57
void
SetPosition
(
const
Vector &position);
62
Vector
GetCurrentPosition
(
void
)
const
;
67
Vector
GetVelocity
(
void
)
const
;
72
void
SetVelocity
(
const
Vector &vel);
76
void
Pause
(
void
);
80
void
Unpause
(
void
);
81
86
void
UpdateWithBounds
(
const
Rectangle
&rectangle)
const
;
91
void
UpdateWithBounds
(
const
Box
&bounds)
const
;
95
void
Update
(
void
)
const
;
96
private
:
97
mutable
Time
m_lastUpdate
;
98
mutable
Vector
m_position
;
99
Vector
m_velocity
;
100
bool
m_paused
;
101
};
102
103
}
// namespace ns3
104
105
#endif
/* CONSTANT_VELOCITY_HELPER_H */
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:102
ns3::ConstantVelocityHelper::GetCurrentPosition
Vector GetCurrentPosition(void) const
Get current position vector.
Definition:
constant-velocity-helper.cc:59
ns3::ConstantVelocityHelper
Utility class used to move node with constant velocity.
Definition:
constant-velocity-helper.h:36
ns3::ConstantVelocityHelper::m_velocity
Vector m_velocity
state variable for velocity
Definition:
constant-velocity-helper.h:99
ns3::Box
a 3d box
Definition:
box.h:34
ns3::ConstantVelocityHelper::Update
void Update(void) const
Update position, if not paused, from last position and time of last update.
Definition:
constant-velocity-helper.cc:80
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::ConstantVelocityHelper::UpdateWithBounds
void UpdateWithBounds(const Rectangle &rectangle) const
Update position, if not paused, from last position and time of last update.
Definition:
constant-velocity-helper.cc:98
ns3::ConstantVelocityHelper::SetVelocity
void SetVelocity(const Vector &vel)
Set new velocity vector.
Definition:
constant-velocity-helper.cc:72
ns3::ConstantVelocityHelper::m_position
Vector m_position
state variable for current position
Definition:
constant-velocity-helper.h:98
ns3::ConstantVelocityHelper::GetVelocity
Vector GetVelocity(void) const
Get velocity; if paused, will return a zero vector.
Definition:
constant-velocity-helper.cc:66
ns3::ConstantVelocityHelper::Unpause
void Unpause(void)
Resume mobility from current position at current velocity.
Definition:
constant-velocity-helper.cc:129
ns3::ConstantVelocityHelper::ConstantVelocityHelper
ConstantVelocityHelper()
Definition:
constant-velocity-helper.cc:30
ns3::ConstantVelocityHelper::m_paused
bool m_paused
state variable for paused
Definition:
constant-velocity-helper.h:100
ns3::ConstantVelocityHelper::SetPosition
void SetPosition(const Vector &position)
Set position vector.
Definition:
constant-velocity-helper.cc:50
ns3::ConstantVelocityHelper::m_lastUpdate
Time m_lastUpdate
time of last update
Definition:
constant-velocity-helper.h:97
ns3::ConstantVelocityHelper::Pause
void Pause(void)
Pause mobility at current position.
Definition:
constant-velocity-helper.cc:122
ns3::Rectangle
a 2d rectangle
Definition:
rectangle.h:34
Generated on Wed Nov 7 2018 10:02:05 for ns-3 by
1.8.14