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" 101 std::pair<bool, Ptr<Building> >
IsLineClearOfBuildings (Vector currentPosition, Vector nextPosition )
const;
Simulation virtual time values and global simulation resolution.
virtual Vector DoGetVelocity(void) const
virtual void DoDispose(void)
Destructor implementation.
double m_epsilon
Tolerance for the intersection point with buildings.
Utility class used to move node with constant velocity.
Mode
An enum representing the different working modes of this module.
Keep track of the current position and velocity of an object.
void DoInitializePrivate(void)
Perform initialization of the object before MobilityModel::DoInitialize ()
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)...
virtual void DoInitialize(void)
Initialize() implementation.
Ptr< RandomVariableStream > m_direction
rv for picking direction
virtual Vector DoGetPosition(void) const
2D random walk mobility model which avoids buildings.
static TypeId GetTypeId(void)
Register this type with the TypeId system.
Ptr< RandomVariableStream > m_speed
rv for picking speed
Every class exported by the ns3 library is enclosed in the ns3 namespace.
EventId m_event
stored event ID
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 ...
void DoWalk(Time timeLeft)
Walk according to position and velocity, until distance is reached, time is reached, or intersection with the bounding box, or building.
uint32_t m_maxIter
Maximum number of tries to find the next position.
ConstantVelocityHelper m_helper
helper for this object
enum Mode m_mode
whether in time or distance mode
An identifier for simulation events.
void Rebound(Time timeLeft)
Performs the rebound of the node if it reaches a boundary.
Time m_modeTime
Change current direction and speed after this delay.
void AvoidBuilding(Time delayLeft, Vector intersectPosition)
Avoid a building.
double m_modeDistance
Change direction and speed after this distance.
Rectangle m_bounds
Bounds of the area to cruise.
virtual void DoSetPosition(const Vector &position)
a unique identifier for an interface.
Vector m_prevPosition
Store the previous position in case a step back is needed.
virtual int64_t DoAssignStreams(int64_t)
The default implementation does nothing but return the passed-in parameter.