A Discrete-Event Network Simulator
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 Dan Broyles
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
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: Dan Broyles <dbroyl01@ku.edu>
19  * Thanks to Kevin Peters, faculty advisor James P.G. Sterbenz, and the ResiliNets
20  * initiative at The University of Kansas, https://wiki.ittc.ku.edu/resilinets
21  */
26 #include "mobility-model.h"
27 #include "position-allocator.h"
28 #include "ns3/ptr.h"
29 #include "ns3/object.h"
30 #include "ns3/nstime.h"
31 #include "ns3/event-id.h"
32 #include "ns3/box.h"
33 #include "ns3/random-variable-stream.h"
35 namespace ns3 {
81 {
82 public:
87  static TypeId GetTypeId (void);
89 private:
93  void Start (void);
98  void DoWalk (Time timeLeft);
99  virtual void DoDispose (void);
100  virtual Vector DoGetPosition (void) const;
101  virtual void DoSetPosition (const Vector &position);
102  virtual Vector DoGetVelocity (void) const;
103  virtual int64_t DoAssignStreams (int64_t);
106  double m_alpha;
107  double m_meanVelocity;
109  double m_meanPitch;
110  double m_Velocity;
111  double m_Direction;
112  double m_Pitch;
121 };
123 } // namespace ns3
ConstantVelocityHelper m_helper
constant velocity helper
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
Time m_timeStep
duraiton after which direction and speed should change
EventId m_event
event id of scheduled start
Ptr< RandomVariableStream > m_rndMeanDirection
rv used to assign avg direction
void DoWalk(Time timeLeft)
Perform a walk operation.
Utility class used to move node with constant velocity.
a 3d box
Definition: box.h:34
Keep track of the current position and velocity of an object.
virtual int64_t DoAssignStreams(int64_t)
The default implementation does nothing but return the passed-in parameter.
Ptr< RandomVariableStream > m_rndMeanVelocity
rv used to assign avg velocity
virtual void DoSetPosition(const Vector &position)
double m_alpha
tunable constant in the model
virtual void DoDispose(void)
Destructor implementation.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< RandomVariableStream > m_rndMeanPitch
rv used to assign avg.
Ptr< NormalRandomVariable > m_normalDirection
Gaussian rv for next direction value.
double m_meanVelocity
current mean velocity
virtual Vector DoGetPosition(void) const
void Start(void)
Initialize the model and calculate new velocity, direction, and pitch.
virtual Vector DoGetVelocity(void) const
An identifier for simulation events.
Definition: event-id.h:53
Gauss-Markov mobility model.
static TypeId GetTypeId(void)
Register this type with the TypeId system.
Ptr< NormalRandomVariable > m_normalVelocity
Gaussian rv used to for next velocity.
Ptr< NormalRandomVariable > m_normalPitch
Gaussian rv for next pitch.
a unique identifier for an interface.
Definition: type-id.h:58
double m_meanDirection
current mean direction