author | Tom Henderson <tomh@tomh.org> |
Fri, 25 Feb 2011 16:06:17 -0800 | |
changeset 6839 | 34074e4ed93b |
parent 6471 | src/mobility/steady-state-random-waypoint-mobility-model.h@a2028222c362 |
child 7385 | 10beb0e53130 |
permissions | -rw-r--r-- |
5979 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2009 IITP RAS |
|
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: Denis Fakhriev <fakhriev@iitp.ru> |
|
19 |
*/ |
|
20 |
#ifndef STEADY_STATE_RANDOM_WAYPOINT_MOBILITY_MODEL_H |
|
21 |
#define STEADY_STATE_RANDOM_WAYPOINT_MOBILITY_MODEL_H |
|
22 |
||
23 |
#include "constant-velocity-helper.h" |
|
24 |
#include "mobility-model.h" |
|
25 |
#include "position-allocator.h" |
|
26 |
#include "ns3/ptr.h" |
|
27 |
#include "ns3/random-variable.h" |
|
28 |
||
29 |
namespace ns3 { |
|
30 |
||
31 |
/** |
|
6471
a2028222c362
Doxygen cleanup in mobility module
Pavel Boyko <boyko@iitp.ru>
parents:
5979
diff
changeset
|
32 |
* \ingroup mobility |
a2028222c362
Doxygen cleanup in mobility module
Pavel Boyko <boyko@iitp.ru>
parents:
5979
diff
changeset
|
33 |
* \brief Steady-state random waypoint mobility model. |
5979 | 34 |
* |
35 |
* This model based on random waypoint mobility (RWM) model for case when |
|
36 |
* speed, pause and position are uniformly distributed random variables. |
|
37 |
* The difference is that the initial values of this parameters are not |
|
38 |
* from uniform distribution but from stationary distribution of RWM model. |
|
39 |
* The implementation of this model is 2d-specific and with nonzero nodes speeds. |
|
40 |
* |
|
41 |
* Based on NS-2 implementation by Toilers Research Group -- Colorado |
|
42 |
* School of Mines (http://toilers.mines.edu). |
|
43 |
* The papers related to this code are: |
|
44 |
* W. Navidi and T. Camp, Stationary Distributions for the Random |
|
45 |
* Waypoint Mobility Model, IEEE Transactions on Mobile Computing, |
|
46 |
* vol. 3, no. 1, pp. 99-108, January-March 2004. |
|
47 |
* W. Navidi, T. Camp, and N. Bauer, Improving the Accuracy of |
|
48 |
* Random Waypoint Simulations Through Steady-State Initialization, |
|
49 |
* Proceedings of the 15th International Conference on Modeling and |
|
50 |
* Simulation (MS '04), pp. 319-326, March 2004. |
|
51 |
*/ |
|
52 |
class SteadyStateRandomWaypointMobilityModel : public MobilityModel |
|
53 |
{ |
|
54 |
public: |
|
55 |
static TypeId GetTypeId (void); |
|
56 |
SteadyStateRandomWaypointMobilityModel (); |
|
57 |
protected: |
|
58 |
virtual void DoStart (void); |
|
59 |
private: |
|
60 |
void SteadyStateStart (void); |
|
61 |
void SteadyStateBeginWalk (const Vector &destination); |
|
62 |
void Start (void); |
|
63 |
void BeginWalk (void); |
|
64 |
virtual Vector DoGetPosition (void) const; |
|
65 |
virtual void DoSetPosition (const Vector &position); |
|
66 |
virtual Vector DoGetVelocity (void) const; |
|
67 |
||
68 |
ConstantVelocityHelper m_helper; |
|
69 |
double m_maxSpeed; |
|
70 |
double m_minSpeed; |
|
71 |
UniformVariable m_speed; |
|
72 |
double m_minX; |
|
73 |
double m_maxX; |
|
74 |
double m_minY; |
|
75 |
double m_maxY; |
|
76 |
Ptr<RandomRectanglePositionAllocator> m_position; |
|
77 |
double m_minPause; |
|
78 |
double m_maxPause; |
|
79 |
UniformVariable m_pause; |
|
80 |
EventId m_event; |
|
81 |
bool alreadyStarted; |
|
82 |
}; |
|
83 |
||
84 |
} // namespace ns3 |
|
85 |
||
86 |
#endif /* STEADY_STATE_RANDOM_WAYPOINT_MOBILITY_MODEL_H */ |