A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
mobility
model
random-walk-2d-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) 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 RANDOM_WALK_2D_MOBILITY_MODEL_H
21
#define RANDOM_WALK_2D_MOBILITY_MODEL_H
22
23
#include "ns3/object.h"
24
#include "ns3/nstime.h"
25
#include "ns3/event-id.h"
26
#include "ns3/rectangle.h"
27
#include "ns3/random-variable-stream.h"
28
#include "
mobility-model.h
"
29
#include "
constant-velocity-helper.h
"
30
31
namespace
ns3
{
32
33
46
class
RandomWalk2dMobilityModel
:
public
MobilityModel
47
{
48
public
:
53
static
TypeId
GetTypeId
(
void
);
55
enum
Mode
{
56
MODE_DISTANCE
,
57
MODE_TIME
58
};
59
60
private
:
65
void
Rebound
(
Time
timeLeft);
70
void
DoWalk
(
Time
timeLeft);
74
void
DoInitializePrivate
(
void
);
75
virtual
void
DoDispose
(
void
);
76
virtual
void
DoInitialize
(
void
);
77
virtual
Vector
DoGetPosition
(
void
)
const
;
78
virtual
void
DoSetPosition
(
const
Vector &position);
79
virtual
Vector
DoGetVelocity
(
void
)
const
;
80
virtual
int64_t
DoAssignStreams
(int64_t);
81
82
ConstantVelocityHelper
m_helper
;
83
EventId
m_event
;
84
enum
Mode
m_mode
;
85
double
m_modeDistance
;
86
Time
m_modeTime
;
87
Ptr<RandomVariableStream>
m_speed
;
88
Ptr<RandomVariableStream>
m_direction
;
89
Rectangle
m_bounds
;
90
};
91
92
93
}
// namespace ns3
94
95
#endif
/* RANDOM_WALK_2D_MOBILITY_MODEL_H */
ns3::RandomWalk2dMobilityModel::m_modeDistance
double m_modeDistance
Change direction and speed after this distance.
Definition:
random-walk-2d-mobility-model.h:85
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:102
ns3::Ptr< RandomVariableStream >
ns3::RandomWalk2dMobilityModel::MODE_TIME
Definition:
random-walk-2d-mobility-model.h:57
ns3::RandomWalk2dMobilityModel::MODE_DISTANCE
Definition:
random-walk-2d-mobility-model.h:56
ns3::ConstantVelocityHelper
Utility class used to move node with constant velocity.
Definition:
constant-velocity-helper.h:36
ns3::RandomWalk2dMobilityModel::m_event
EventId m_event
stored event ID
Definition:
random-walk-2d-mobility-model.h:83
ns3::MobilityModel
Keep track of the current position and velocity of an object.
Definition:
mobility-model.h:39
ns3::RandomWalk2dMobilityModel
2D random walk mobility model.
Definition:
random-walk-2d-mobility-model.h:46
ns3::RandomWalk2dMobilityModel::m_helper
ConstantVelocityHelper m_helper
helper for this object
Definition:
random-walk-2d-mobility-model.h:82
ns3::RandomWalk2dMobilityModel::Mode
Mode
An enum representing the different working modes of this module.
Definition:
random-walk-2d-mobility-model.h:55
ns3::RandomWalk2dMobilityModel::DoSetPosition
virtual void DoSetPosition(const Vector &position)
Definition:
random-walk-2d-mobility-model.cc:166
constant-velocity-helper.h
ns3::RandomWalk2dMobilityModel::Rebound
void Rebound(Time timeLeft)
Performs the rebound of the node if it reaches a boundary.
Definition:
random-walk-2d-mobility-model.cc:132
ns3::RandomWalk2dMobilityModel::m_modeTime
Time m_modeTime
Change current direction and speed after this delay.
Definition:
random-walk-2d-mobility-model.h:86
ns3::RandomWalk2dMobilityModel::DoGetVelocity
virtual Vector DoGetVelocity(void) const
Definition:
random-walk-2d-mobility-model.cc:174
ns3::RandomWalk2dMobilityModel::GetTypeId
static TypeId GetTypeId(void)
Register this type with the TypeId system.
Definition:
random-walk-2d-mobility-model.cc:36
mobility-model.h
ns3::RandomWalk2dMobilityModel::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition:
random-walk-2d-mobility-model.cc:154
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::RandomWalk2dMobilityModel::m_speed
Ptr< RandomVariableStream > m_speed
rv for picking speed
Definition:
random-walk-2d-mobility-model.h:87
ns3::RandomWalk2dMobilityModel::m_mode
enum Mode m_mode
whether in time or distance mode
Definition:
random-walk-2d-mobility-model.h:84
ns3::RandomWalk2dMobilityModel::DoWalk
void DoWalk(Time timeLeft)
Walk according to position and velocity, until distance is reached, time is reached, or intersection with the bounding box.
Definition:
random-walk-2d-mobility-model.cc:109
ns3::RandomWalk2dMobilityModel::DoGetPosition
virtual Vector DoGetPosition(void) const
Definition:
random-walk-2d-mobility-model.cc:160
ns3::RandomWalk2dMobilityModel::DoInitialize
virtual void DoInitialize(void)
Initialize() implementation.
Definition:
random-walk-2d-mobility-model.cc:78
ns3::EventId
An identifier for simulation events.
Definition:
event-id.h:53
ns3::RandomWalk2dMobilityModel::m_direction
Ptr< RandomVariableStream > m_direction
rv for picking direction
Definition:
random-walk-2d-mobility-model.h:88
ns3::RandomWalk2dMobilityModel::DoInitializePrivate
void DoInitializePrivate(void)
Perform initialization of the object before MobilityModel::DoInitialize ()
Definition:
random-walk-2d-mobility-model.cc:85
ns3::RandomWalk2dMobilityModel::m_bounds
Rectangle m_bounds
Bounds of the area to cruise.
Definition:
random-walk-2d-mobility-model.h:89
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
ns3::Rectangle
a 2d rectangle
Definition:
rectangle.h:34
ns3::RandomWalk2dMobilityModel::DoAssignStreams
virtual int64_t DoAssignStreams(int64_t)
The default implementation does nothing but return the passed-in parameter.
Definition:
random-walk-2d-mobility-model.cc:179
Generated on Wed Nov 7 2018 10:02:05 for ns-3 by
1.8.14