A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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
namespace
ns3 {
30
84
class
WaypointMobilityModel
:
public
MobilityModel
85
{
86
public
:
87
static
TypeId
GetTypeId
(
void
);
88
92
WaypointMobilityModel
();
93
virtual
~WaypointMobilityModel
();
94
104
void
AddWaypoint
(
const
Waypoint
&waypoint);
105
109
Waypoint
GetNextWaypoint
(
void
)
const
;
110
115
uint32_t
WaypointsLeft
(
void
)
const
;
116
123
void
EndMobility
(
void
);
124
125
private
:
126
friend
class
WaypointMobilityModelNotifyTest
;
// To allow Update() calls and access to m_current
127
128
void
Update
(
void
)
const
;
129
virtual
void
DoDispose
(
void
);
130
virtual
Vector
DoGetPosition
(
void
)
const
;
131
virtual
void
DoSetPosition
(
const
Vector
&position);
132
virtual
Vector
DoGetVelocity
(
void
)
const
;
133
134
bool
m_first
;
135
bool
m_lazyNotify
;
136
bool
m_initialPositionIsWaypoint
;
137
mutable
std::deque<Waypoint>
m_waypoints
;
138
mutable
Waypoint
m_current
;
139
mutable
Waypoint
m_next
;
140
mutable
Vector
m_velocity
;
141
};
142
143
}
// namespace ns3
144
145
#endif
/* WAYPOINT_MOBILITY_MODEL_H */
146
ns3::WaypointMobilityModel::DoDispose
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Definition:
waypoint-mobility-model.cc:78
ns3::WaypointMobilityModel::DoGetVelocity
virtual Vector DoGetVelocity(void) const
Definition:
waypoint-mobility-model.cc:212
ns3::WaypointMobilityModel::~WaypointMobilityModel
virtual ~WaypointMobilityModel()
Definition:
waypoint-mobility-model.cc:74
ns3::WaypointMobilityModel::m_lazyNotify
bool m_lazyNotify
Definition:
waypoint-mobility-model.h:135
ns3::WaypointMobilityModel::AddWaypoint
void AddWaypoint(const Waypoint &waypoint)
Definition:
waypoint-mobility-model.cc:83
ns3::WaypointMobilityModel::m_velocity
Vector m_velocity
Definition:
waypoint-mobility-model.h:140
ns3::WaypointMobilityModel::DoGetPosition
virtual Vector DoGetPosition(void) const
Definition:
waypoint-mobility-model.cc:176
ns3::WaypointMobilityModel::m_waypoints
std::deque< Waypoint > m_waypoints
Definition:
waypoint-mobility-model.h:137
ns3::Vector3D
a 3d vector
Definition:
vector.h:31
ns3::WaypointMobilityModelNotifyTest
Definition:
waypoint-mobility-model-test.cc:29
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
Definition:
waypoint-mobility-model.h:134
ns3::WaypointMobilityModel::DoSetPosition
virtual void DoSetPosition(const Vector &position)
Definition:
waypoint-mobility-model.cc:182
ns3::WaypointMobilityModel::Update
void Update(void) const
Definition:
waypoint-mobility-model.cc:115
mobility-model.h
ns3::WaypointMobilityModel::GetTypeId
static TypeId GetTypeId(void)
Definition:
waypoint-mobility-model.cc:39
ns3::WaypointMobilityModel::m_next
Waypoint m_next
Definition:
waypoint-mobility-model.h:139
ns3::WaypointMobilityModel::EndMobility
void EndMobility(void)
Clear any existing waypoints and set the current waypoint time to infinity.
Definition:
waypoint-mobility-model.cc:204
waypoint.h
ns3::WaypointMobilityModel::m_current
Waypoint m_current
Definition:
waypoint-mobility-model.h:138
ns3::WaypointMobilityModel
Waypoint-based mobility model.
Definition:
waypoint-mobility-model.h:84
ns3::WaypointMobilityModel::WaypointMobilityModel
WaypointMobilityModel()
Create a path with no waypoints at location (0,0,0).
Definition:
waypoint-mobility-model.cc:68
ns3::WaypointMobilityModel::GetNextWaypoint
Waypoint GetNextWaypoint(void) const
Get the waypoint that this object is traveling towards.
Definition:
waypoint-mobility-model.cc:103
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::Waypoint
a (time, location) pair.
Definition:
waypoint.h:34
ns3::WaypointMobilityModel::m_initialPositionIsWaypoint
bool m_initialPositionIsWaypoint
Definition:
waypoint-mobility-model.h:136
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:109
src
mobility
model
waypoint-mobility-model.h
Generated on Sat Apr 19 2014 14:07:04 for ns-3 by
1.8.6