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
class
WaypointMobilityModelNotifyTest
;
30
31
namespace
ns3 {
32
86
class
WaypointMobilityModel
:
public
MobilityModel
87
{
88
public
:
89
static
TypeId
GetTypeId
(
void
);
90
94
WaypointMobilityModel
();
95
virtual
~WaypointMobilityModel
();
96
106
void
AddWaypoint
(
const
Waypoint
&waypoint);
107
111
Waypoint
GetNextWaypoint
(
void
)
const
;
112
117
uint32_t
WaypointsLeft
(
void
)
const
;
118
125
void
EndMobility
(
void
);
126
127
private
:
128
friend
class ::WaypointMobilityModelNotifyTest;
// To allow Update() calls and access to m_current
129
130
void
Update
(
void
)
const
;
131
virtual
void
DoDispose
(
void
);
132
virtual
Vector
DoGetPosition
(
void
)
const
;
133
virtual
void
DoSetPosition
(
const
Vector
&position);
134
virtual
Vector
DoGetVelocity
(
void
)
const
;
135
136
bool
m_first
;
137
bool
m_lazyNotify
;
138
bool
m_initialPositionIsWaypoint
;
139
mutable
std::deque<Waypoint>
m_waypoints
;
140
mutable
Waypoint
m_current
;
141
mutable
Waypoint
m_next
;
142
mutable
Vector
m_velocity
;
143
};
144
145
}
// namespace ns3
146
147
#endif
/* WAYPOINT_MOBILITY_MODEL_H */
148
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:77
ns3::WaypointMobilityModel::DoGetVelocity
virtual Vector DoGetVelocity(void) const
Definition:
waypoint-mobility-model.cc:211
WaypointMobilityModelNotifyTest
Definition:
waypoint-mobility-model-test.cc:29
ns3::WaypointMobilityModel::~WaypointMobilityModel
virtual ~WaypointMobilityModel()
Definition:
waypoint-mobility-model.cc:73
ns3::WaypointMobilityModel::m_lazyNotify
bool m_lazyNotify
Definition:
waypoint-mobility-model.h:137
ns3::WaypointMobilityModel::AddWaypoint
void AddWaypoint(const Waypoint &waypoint)
Definition:
waypoint-mobility-model.cc:82
ns3::WaypointMobilityModel::m_velocity
Vector m_velocity
Definition:
waypoint-mobility-model.h:142
ns3::WaypointMobilityModel::DoGetPosition
virtual Vector DoGetPosition(void) const
Definition:
waypoint-mobility-model.cc:175
ns3::WaypointMobilityModel::m_waypoints
std::deque< Waypoint > m_waypoints
Definition:
waypoint-mobility-model.h:139
ns3::Vector3D
a 3d vector
Definition:
vector.h:31
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:136
ns3::WaypointMobilityModel::DoSetPosition
virtual void DoSetPosition(const Vector &position)
Definition:
waypoint-mobility-model.cc:181
ns3::WaypointMobilityModel::Update
void Update(void) const
Definition:
waypoint-mobility-model.cc:114
mobility-model.h
ns3::WaypointMobilityModel::GetTypeId
static TypeId GetTypeId(void)
Definition:
waypoint-mobility-model.cc:38
ns3::WaypointMobilityModel::m_next
Waypoint m_next
Definition:
waypoint-mobility-model.h:141
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
Definition:
waypoint-mobility-model.h:140
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::WaypointMobilityModel::GetNextWaypoint
Waypoint GetNextWaypoint(void) const
Get the waypoint that this object is traveling towards.
Definition:
waypoint-mobility-model.cc:102
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:138
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
src
mobility
model
waypoint-mobility-model.h
Generated on Wed Sep 17 2014 23:33:36 for ns-3 by
1.8.6