11#ifndef RANDOM_WALK_2D_OUTDOOR_MOBILITY_MODEL_H
12#define RANDOM_WALK_2D_OUTDOOR_MOBILITY_MODEL_H
16#include "ns3/constant-velocity-helper.h"
17#include "ns3/event-id.h"
18#include "ns3/mobility-model.h"
19#include "ns3/nstime.h"
20#include "ns3/object.h"
21#include "ns3/random-variable-stream.h"
22#include "ns3/rectangle.h"
97 Vector nextPosition)
const;
108 const Box boundaries)
const;
Utility class used to move node with constant velocity.
An identifier for simulation events.
Smart pointer class similar to boost::intrusive_ptr.
2D random walk mobility model which avoids buildings.
void AvoidBuilding(Time delayLeft, Vector intersectPosition)
Avoid a building.
void DoInitializePrivate()
Perform initialization of the object before MobilityModel::DoInitialize ()
int64_t DoAssignStreams(int64_t) override
The default implementation does nothing but return the passed-in parameter.
double m_modeDistance
Change direction and speed after this distance.
ConstantVelocityHelper m_helper
helper for this object
Mode
An enum representing the different working modes of this module.
Rectangle m_bounds
Bounds of the area to cruise.
Vector m_prevPosition
Store the previous position in case a step back is needed.
void Rebound(Time timeLeft)
Performs the rebound of the node if it reaches a boundary.
uint32_t m_maxIter
Maximum number of tries to find the next position.
Vector DoGetPosition() const override
Vector CalculateIntersectionFromOutside(const Vector ¤t, const Vector &next, const Box boundaries) const
Compute the intersecting point of the box represented by boundaries and the line between current and ...
EventId m_event
stored event ID
Ptr< RandomVariableStream > m_direction
rv for picking direction
void DoDispose() override
Destructor implementation.
Mode m_mode
whether in time or distance mode
double m_epsilon
Tolerance for the intersection point with buildings.
void DoWalk(Time delayLeft)
Walk according to position and velocity, until distance is reached, time is reached,...
std::pair< bool, Ptr< Building > > IsLineClearOfBuildings(Vector currentPosition, Vector nextPosition) const
Check if there is a building between two positions (or if the nextPosition is inside a building).
static TypeId GetTypeId()
Register this type with the TypeId system.
Vector DoGetVelocity() const override
void DoInitialize() override
Initialize() implementation.
Time m_modeTime
Change current direction and speed after this delay.
Ptr< RandomVariableStream > m_speed
rv for picking speed
void DoSetPosition(const Vector &position) override
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.