A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
mobility
model
waypoint-mobility-model.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 Phillip Sitbon
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: Phillip Sitbon <phillip@sitbon.net>
19
*/
20
#ifndef WAYPOINT_MOBILITY_MODEL_H
21
#define WAYPOINT_MOBILITY_MODEL_H
22
23
#include <stdint.h>
24
#include <deque>
25
#include "
mobility-model.h
"
26
#include "ns3/vector.h"
27
#include "
waypoint.h
"
28
29
class
WaypointMobilityModelNotifyTest
;
30
31
namespace
ns3
{
32
86
class
WaypointMobilityModel
:
public
MobilityModel
87
{
88
public
:
93
static
TypeId
GetTypeId
(
void
);
94
98
WaypointMobilityModel
();
99
virtual
~WaypointMobilityModel
();
100
110
void
AddWaypoint
(
const
Waypoint
&waypoint);
111
115
Waypoint
GetNextWaypoint
(
void
)
const
;
116
121
uint32_t
WaypointsLeft
(
void
)
const
;
122
129
void
EndMobility
(
void
);
130
131
private
:
132
friend
class ::WaypointMobilityModelNotifyTest;
// To allow Update() calls and access to m_current
133
137
virtual
void
Update
(
void
)
const
;
143
virtual
void
DoDispose
(
void
);
148
virtual
Vector
DoGetPosition
(
void
)
const
;
153
virtual
void
DoSetPosition
(
const
Vector &position);
158
virtual
Vector
DoGetVelocity
(
void
)
const
;
159
160
protected
:
164
bool
m_first
;
169
bool
m_lazyNotify
;
173
bool
m_initialPositionIsWaypoint
;
177
mutable
std::deque<Waypoint>
m_waypoints
;
181
mutable
Waypoint
m_current
;
185
mutable
Waypoint
m_next
;
189
mutable
Vector
m_velocity
;
190
};
191
192
}
// namespace ns3
193
194
#endif
/* WAYPOINT_MOBILITY_MODEL_H */
195
ns3::WaypointMobilityModel::DoDispose
virtual void DoDispose(void)
The dispose method.
Definition:
waypoint-mobility-model.cc:77
ns3::WaypointMobilityModel::DoGetVelocity
virtual Vector DoGetVelocity(void) const
Returns the current velocity of a node.
Definition:
waypoint-mobility-model.cc:211
WaypointMobilityModelNotifyTest
Waypoint Mobility Model Notify Test.
Definition:
waypoint-mobility-model-test.cc:35
ns3::WaypointMobilityModel::~WaypointMobilityModel
virtual ~WaypointMobilityModel()
Definition:
waypoint-mobility-model.cc:73
ns3::WaypointMobilityModel::m_lazyNotify
bool m_lazyNotify
If true, course change updates are only notified when position is calculated.
Definition:
waypoint-mobility-model.h:169
ns3::WaypointMobilityModel::AddWaypoint
void AddWaypoint(const Waypoint &waypoint)
Definition:
waypoint-mobility-model.cc:82
ns3::WaypointMobilityModel::m_velocity
Vector m_velocity
The current velocity vector.
Definition:
waypoint-mobility-model.h:189
ns3::WaypointMobilityModel::m_waypoints
std::deque< Waypoint > m_waypoints
The double ended queue containing the ns3::Waypoint objects.
Definition:
waypoint-mobility-model.h:177
ns3::WaypointMobilityModel::WaypointsLeft
uint32_t WaypointsLeft(void) const
Get the number of waypoints left for this object, excluding the next one.
Definition:
waypoint-mobility-model.cc:108
ns3::MobilityModel
Keep track of the current position and velocity of an object.
Definition:
mobility-model.h:39
ns3::WaypointMobilityModel::m_first
bool m_first
This variable is set to true if there are no waypoints in the std::deque.
Definition:
waypoint-mobility-model.h:164
ns3::WaypointMobilityModel::DoSetPosition
virtual void DoSetPosition(const Vector &position)
Sets a new position for the node
Definition:
waypoint-mobility-model.cc:181
mobility-model.h
ns3::WaypointMobilityModel::Update
virtual void Update(void) const
Update the underlying state corresponding to the stored waypoints.
Definition:
waypoint-mobility-model.cc:114
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WaypointMobilityModel::GetTypeId
static TypeId GetTypeId(void)
Register this type with the TypeId system.
Definition:
waypoint-mobility-model.cc:38
ns3::WaypointMobilityModel::m_next
Waypoint m_next
The next ns3::Waypoint in the deque.
Definition:
waypoint-mobility-model.h:185
ns3::WaypointMobilityModel::DoGetPosition
virtual Vector DoGetPosition(void) const
Get current position.
Definition:
waypoint-mobility-model.cc:175
ns3::WaypointMobilityModel::GetNextWaypoint
Waypoint GetNextWaypoint(void) const
Get the waypoint that this object is traveling towards.
Definition:
waypoint-mobility-model.cc:102
ns3::WaypointMobilityModel::EndMobility
void EndMobility(void)
Clear any existing waypoints and set the current waypoint time to infinity.
Definition:
waypoint-mobility-model.cc:203
waypoint.h
ns3::WaypointMobilityModel::m_current
Waypoint m_current
The ns3::Waypoint currently being used.
Definition:
waypoint-mobility-model.h:181
ns3::WaypointMobilityModel
Waypoint-based mobility model.
Definition:
waypoint-mobility-model.h:86
ns3::WaypointMobilityModel::WaypointMobilityModel
WaypointMobilityModel()
Create a path with no waypoints at location (0,0,0).
Definition:
waypoint-mobility-model.cc:67
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
ns3::Waypoint
a (time, location) pair.
Definition:
waypoint.h:35
ns3::WaypointMobilityModel::m_initialPositionIsWaypoint
bool m_initialPositionIsWaypoint
If true, calling SetPosition with no waypoints creates a waypoint.
Definition:
waypoint-mobility-model.h:173
Generated on Wed Nov 7 2018 10:02:05 for ns-3 by
1.8.14