A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
steady-state-random-waypoint-mobility-model.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 IITP RAS
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Denis Fakhriev <fakhriev@iitp.ru>
7
*/
8
#ifndef STEADY_STATE_RANDOM_WAYPOINT_MOBILITY_MODEL_H
9
#define STEADY_STATE_RANDOM_WAYPOINT_MOBILITY_MODEL_H
10
11
#include "
constant-velocity-helper.h
"
12
#include "
mobility-model.h
"
13
#include "
position-allocator.h
"
14
15
#include "ns3/ptr.h"
16
#include "ns3/random-variable-stream.h"
17
18
namespace
ns3
19
{
20
21
/**
22
* @ingroup mobility
23
* @brief Steady-state random waypoint mobility model.
24
*
25
* This model based on random waypoint mobility (RWM) model for case when
26
* speed, pause and position are uniformly distributed random variables.
27
* The difference is that the initial values of this parameters are not
28
* from uniform distribution but from stationary distribution of RWM model.
29
* The implementation of this model is 2D-specific and with nonzero nodes speeds.
30
* In the 3D ns-3 coordinate system, the movement occurs on the
31
* \f$ z=\overline{Z} \f$ plane, where \f$ \overline{Z} \f$ is a constant which
32
* can be configured using the Z attribute.
33
*
34
* Based on NS-2 implementation by Toilers Research Group -- Colorado
35
* School of Mines (http://toilers.mines.edu).
36
* The papers related to this code are:
37
* W. Navidi and T. Camp, Stationary Distributions for the Random
38
* Waypoint Mobility Model, IEEE Transactions on Mobile Computing,
39
* vol. 3, no. 1, pp. 99-108, January-March 2004.
40
* W. Navidi, T. Camp, and N. Bauer, Improving the Accuracy of
41
* Random Waypoint Simulations Through Steady-State Initialization,
42
* Proceedings of the 15th International Conference on Modeling and
43
* Simulation (MS '04), pp. 319-326, March 2004.
44
*/
45
class
SteadyStateRandomWaypointMobilityModel
:
public
MobilityModel
46
{
47
public
:
48
/**
49
* Register this type with the TypeId system.
50
* @return the object TypeId
51
*/
52
static
TypeId
GetTypeId
();
53
SteadyStateRandomWaypointMobilityModel
();
54
~SteadyStateRandomWaypointMobilityModel
()
override
;
55
56
protected
:
57
void
DoInitialize
()
override
;
58
59
private
:
60
/**
61
* Configure random variables based on attributes; calculate the steady
62
* state probability that node is initially paused; schedule either end
63
* of pause time or initial motion of the node.
64
*/
65
void
DoInitializePrivate
();
66
/**
67
* Use provided destination to calculate travel delay, and schedule a
68
* Start() event at that time.
69
* @param destination the destination to move to
70
*/
71
void
SteadyStateBeginWalk
(
const
Vector& destination);
72
/**
73
* Start a pause period and schedule the ending of the pause
74
*/
75
void
Start
();
76
/**
77
* Start a motion period and schedule the ending of the motion
78
*/
79
void
BeginWalk
();
80
Vector
DoGetPosition
()
const override
;
81
void
DoSetPosition
(
const
Vector& position)
override
;
82
Vector
DoGetVelocity
()
const override
;
83
int64_t
DoAssignStreams
(int64_t)
override
;
84
85
ConstantVelocityHelper
m_helper
;
//!< helper for velocity computations
86
double
m_maxSpeed
;
//!< maximum speed value (m/s)
87
double
m_minSpeed
;
//!< minimum speed value (m/s)
88
Ptr<UniformRandomVariable>
m_speed
;
//!< random variable for speed values
89
double
m_minX
;
//!< minimum x value of traveling region (m)
90
double
m_maxX
;
//!< maximum x value of traveling region (m)
91
double
m_minY
;
//!< minimum y value of traveling region (m)
92
double
m_maxY
;
//!< maximum y value of traveling region (m)
93
double
m_z
;
//!< z value of traveling region
94
Ptr<RandomBoxPositionAllocator>
m_position
;
//!< position allocator
95
double
m_minPause
;
//!< minimum pause value (s)
96
double
m_maxPause
;
//!< maximum pause value (s)
97
Ptr<UniformRandomVariable>
m_pause
;
//!< random variable for pause values
98
EventId
m_event
;
//!< current event ID
99
bool
alreadyStarted
;
//!< flag for starting state
100
Ptr<UniformRandomVariable>
m_x1_r
;
//!< rv used in rejection sampling phase
101
Ptr<UniformRandomVariable>
m_y1_r
;
//!< rv used in rejection sampling phase
102
Ptr<UniformRandomVariable>
m_x2_r
;
//!< rv used in rejection sampling phase
103
Ptr<UniformRandomVariable>
m_y2_r
;
//!< rv used in rejection sampling phase
104
Ptr<UniformRandomVariable>
m_u_r
;
//!< rv used in step 5 of algorithm
105
Ptr<UniformRandomVariable>
m_x
;
//!< rv used for position allocator
106
Ptr<UniformRandomVariable>
m_y
;
//!< rv used for position allocator
107
};
108
109
}
// namespace ns3
110
111
#endif
/* STEADY_STATE_RANDOM_WAYPOINT_MOBILITY_MODEL_H */
ns3::ConstantVelocityHelper
Utility class used to move node with constant velocity.
Definition
constant-velocity-helper.h:27
ns3::EventId
An identifier for simulation events.
Definition
event-id.h:45
ns3::MobilityModel::MobilityModel
MobilityModel()
Definition
mobility-model.cc:47
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:66
ns3::SteadyStateRandomWaypointMobilityModel::m_u_r
Ptr< UniformRandomVariable > m_u_r
rv used in step 5 of algorithm
Definition
steady-state-random-waypoint-mobility-model.h:104
ns3::SteadyStateRandomWaypointMobilityModel::DoSetPosition
void DoSetPosition(const Vector &position) override
Definition
steady-state-random-waypoint-mobility-model.cc:279
ns3::SteadyStateRandomWaypointMobilityModel::DoAssignStreams
int64_t DoAssignStreams(int64_t) override
The default implementation does nothing but return the passed-in parameter.
Definition
steady-state-random-waypoint-mobility-model.cc:296
ns3::SteadyStateRandomWaypointMobilityModel::DoInitialize
void DoInitialize() override
Initialize() implementation.
Definition
steady-state-random-waypoint-mobility-model.cc:99
ns3::SteadyStateRandomWaypointMobilityModel::m_maxSpeed
double m_maxSpeed
maximum speed value (m/s)
Definition
steady-state-random-waypoint-mobility-model.h:86
ns3::SteadyStateRandomWaypointMobilityModel::m_minPause
double m_minPause
minimum pause value (s)
Definition
steady-state-random-waypoint-mobility-model.h:95
ns3::SteadyStateRandomWaypointMobilityModel::m_minX
double m_minX
minimum x value of traveling region (m)
Definition
steady-state-random-waypoint-mobility-model.h:89
ns3::SteadyStateRandomWaypointMobilityModel::m_y2_r
Ptr< UniformRandomVariable > m_y2_r
rv used in rejection sampling phase
Definition
steady-state-random-waypoint-mobility-model.h:103
ns3::SteadyStateRandomWaypointMobilityModel::m_pause
Ptr< UniformRandomVariable > m_pause
random variable for pause values
Definition
steady-state-random-waypoint-mobility-model.h:97
ns3::SteadyStateRandomWaypointMobilityModel::m_x2_r
Ptr< UniformRandomVariable > m_x2_r
rv used in rejection sampling phase
Definition
steady-state-random-waypoint-mobility-model.h:102
ns3::SteadyStateRandomWaypointMobilityModel::SteadyStateBeginWalk
void SteadyStateBeginWalk(const Vector &destination)
Use provided destination to calculate travel delay, and schedule a Start() event at that time.
Definition
steady-state-random-waypoint-mobility-model.cc:216
ns3::SteadyStateRandomWaypointMobilityModel::DoGetVelocity
Vector DoGetVelocity() const override
Definition
steady-state-random-waypoint-mobility-model.cc:290
ns3::SteadyStateRandomWaypointMobilityModel::m_y
Ptr< UniformRandomVariable > m_y
rv used for position allocator
Definition
steady-state-random-waypoint-mobility-model.h:106
ns3::SteadyStateRandomWaypointMobilityModel::m_speed
Ptr< UniformRandomVariable > m_speed
random variable for speed values
Definition
steady-state-random-waypoint-mobility-model.h:88
ns3::SteadyStateRandomWaypointMobilityModel::m_z
double m_z
z value of traveling region
Definition
steady-state-random-waypoint-mobility-model.h:93
ns3::SteadyStateRandomWaypointMobilityModel::m_maxX
double m_maxX
maximum x value of traveling region (m)
Definition
steady-state-random-waypoint-mobility-model.h:90
ns3::SteadyStateRandomWaypointMobilityModel::DoGetPosition
Vector DoGetPosition() const override
Definition
steady-state-random-waypoint-mobility-model.cc:272
ns3::SteadyStateRandomWaypointMobilityModel::GetTypeId
static TypeId GetTypeId()
Register this type with the TypeId system.
Definition
steady-state-random-waypoint-mobility-model.cc:22
ns3::SteadyStateRandomWaypointMobilityModel::m_maxPause
double m_maxPause
maximum pause value (s)
Definition
steady-state-random-waypoint-mobility-model.h:96
ns3::SteadyStateRandomWaypointMobilityModel::m_minSpeed
double m_minSpeed
minimum speed value (m/s)
Definition
steady-state-random-waypoint-mobility-model.h:87
ns3::SteadyStateRandomWaypointMobilityModel::m_x1_r
Ptr< UniformRandomVariable > m_x1_r
rv used in rejection sampling phase
Definition
steady-state-random-waypoint-mobility-model.h:100
ns3::SteadyStateRandomWaypointMobilityModel::DoInitializePrivate
void DoInitializePrivate()
Configure random variables based on attributes; calculate the steady state probability that node is i...
Definition
steady-state-random-waypoint-mobility-model.cc:106
ns3::SteadyStateRandomWaypointMobilityModel::BeginWalk
void BeginWalk()
Start a motion period and schedule the ending of the motion.
Definition
steady-state-random-waypoint-mobility-model.cc:240
ns3::SteadyStateRandomWaypointMobilityModel::m_minY
double m_minY
minimum y value of traveling region (m)
Definition
steady-state-random-waypoint-mobility-model.h:91
ns3::SteadyStateRandomWaypointMobilityModel::Start
void Start()
Start a pause period and schedule the ending of the pause.
Definition
steady-state-random-waypoint-mobility-model.cc:262
ns3::SteadyStateRandomWaypointMobilityModel::m_x
Ptr< UniformRandomVariable > m_x
rv used for position allocator
Definition
steady-state-random-waypoint-mobility-model.h:105
ns3::SteadyStateRandomWaypointMobilityModel::SteadyStateRandomWaypointMobilityModel
SteadyStateRandomWaypointMobilityModel()
Definition
steady-state-random-waypoint-mobility-model.cc:78
ns3::SteadyStateRandomWaypointMobilityModel::m_helper
ConstantVelocityHelper m_helper
helper for velocity computations
Definition
steady-state-random-waypoint-mobility-model.h:85
ns3::SteadyStateRandomWaypointMobilityModel::m_y1_r
Ptr< UniformRandomVariable > m_y1_r
rv used in rejection sampling phase
Definition
steady-state-random-waypoint-mobility-model.h:101
ns3::SteadyStateRandomWaypointMobilityModel::alreadyStarted
bool alreadyStarted
flag for starting state
Definition
steady-state-random-waypoint-mobility-model.h:99
ns3::SteadyStateRandomWaypointMobilityModel::~SteadyStateRandomWaypointMobilityModel
~SteadyStateRandomWaypointMobilityModel() override
Definition
steady-state-random-waypoint-mobility-model.cc:93
ns3::SteadyStateRandomWaypointMobilityModel::m_event
EventId m_event
current event ID
Definition
steady-state-random-waypoint-mobility-model.h:98
ns3::SteadyStateRandomWaypointMobilityModel::m_maxY
double m_maxY
maximum y value of traveling region (m)
Definition
steady-state-random-waypoint-mobility-model.h:92
ns3::SteadyStateRandomWaypointMobilityModel::m_position
Ptr< RandomBoxPositionAllocator > m_position
position allocator
Definition
steady-state-random-waypoint-mobility-model.h:94
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:49
constant-velocity-helper.h
mobility-model.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
position-allocator.h
src
mobility
model
steady-state-random-waypoint-mobility-model.h
Generated on Wed Jun 11 2025 13:15:35 for ns-3 by
1.13.2