A Discrete-Event Network Simulator
API
random-waypoint-mobility-model.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007 INRIA
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18  */
19 #ifndef RANDOM_WAYPOINT_MOBILITY_MODEL_H
20 #define RANDOM_WAYPOINT_MOBILITY_MODEL_H
21 
23 #include "mobility-model.h"
24 #include "position-allocator.h"
25 
26 #include "ns3/ptr.h"
27 #include "ns3/random-variable-stream.h"
28 
29 namespace ns3
30 {
31 
54 {
55  public:
60  static TypeId GetTypeId();
61 
62  protected:
63  void DoInitialize() override;
64 
65  private:
69  void BeginWalk();
73  void DoInitializePrivate();
74  Vector DoGetPosition() const override;
75  void DoSetPosition(const Vector& position) override;
76  Vector DoGetVelocity() const override;
77  int64_t DoAssignStreams(int64_t) override;
78 
84 };
85 
86 } // namespace ns3
87 
88 #endif /* RANDOM_WAYPOINT_MOBILITY_MODEL_H */
Utility class used to move node with constant velocity.
An identifier for simulation events.
Definition: event-id.h:55
Keep track of the current position and velocity of an object.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
void BeginWalk()
Get next position, begin moving towards it, schedule future pause event.
ConstantVelocityHelper m_helper
helper for velocity computations
void DoInitializePrivate()
Begin current pause event, schedule future walk event.
int64_t DoAssignStreams(int64_t) override
The default implementation does nothing but return the passed-in parameter.
Ptr< PositionAllocator > m_position
pointer to position allocator
Ptr< RandomVariableStream > m_speed
random variable to generate speeds
void DoInitialize() override
Initialize() implementation.
static TypeId GetTypeId()
Register this type with the TypeId system.
Ptr< RandomVariableStream > m_pause
random variable to generate pauses
EventId m_event
event ID of next scheduled event
void DoSetPosition(const Vector &position) override
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.