23 #ifndef RANDOM_WALK_2D_OUTDOOR_MOBILITY_MODEL_H
24 #define RANDOM_WALK_2D_OUTDOOR_MOBILITY_MODEL_H
26 #include "ns3/object.h"
27 #include "ns3/nstime.h"
28 #include "ns3/event-id.h"
29 #include "ns3/rectangle.h"
30 #include "ns3/random-variable-stream.h"
31 #include "ns3/mobility-model.h"
32 #include "ns3/constant-velocity-helper.h"
33 #include "ns3/building.h"
102 std::pair<bool, Ptr<Building> >
IsLineClearOfBuildings (Vector currentPosition, Vector nextPosition )
const;
Utility class used to move node with constant velocity.
An identifier for simulation events.
Keep track of the current position and velocity of an object.
2D random walk mobility model which avoids buildings.
virtual Vector DoGetPosition(void) const
void AvoidBuilding(Time delayLeft, Vector intersectPosition)
Avoid a building.
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.
void DoInitializePrivate(void)
Perform initialization of the object before MobilityModel::DoInitialize ()
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 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
virtual void DoInitialize(void)
Initialize() implementation.
virtual void DoDispose(void)
Destructor implementation.
virtual Vector DoGetVelocity(void) const
double m_epsilon
Tolerance for the intersection point with buildings.
virtual int64_t DoAssignStreams(int64_t)
The default implementation does nothing but return the passed-in parameter.
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).
enum Mode m_mode
whether in time or distance mode
virtual void DoSetPosition(const Vector &position)
Time m_modeTime
Change current direction and speed after this delay.
static TypeId GetTypeId(void)
Register this type with the TypeId system.
Ptr< RandomVariableStream > m_speed
rv for picking speed
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.