A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::RandomWalk2dMobilityModel Class Reference

2D random walk mobility model. More...

#include <random-walk-2d-mobility-model.h>

+ Inheritance diagram for ns3::RandomWalk2dMobilityModel:
+ Collaboration diagram for ns3::RandomWalk2dMobilityModel:

Public Types

enum  Mode { MODE_DISTANCE, MODE_TIME }

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::RandomWalk2dMobilityModel.

Private Member Functions

virtual int64_t DoAssignStreams (int64_t)
virtual void DoDispose (void)
virtual Vector DoGetPosition (void) const
virtual Vector DoGetVelocity (void) const
virtual void DoSetPosition (const Vector &position)
virtual void DoStart (void)
void DoStartPrivate (void)
void DoWalk (Time timeLeft)
void Rebound (Time timeLeft)

Private Attributes

Rectangle m_bounds
Ptr< RandomVariableStreamm_direction
EventId m_event
ConstantVelocityHelper m_helper
enum Mode m_mode
double m_modeDistance
Time m_modeTime
Ptr< RandomVariableStreamm_speed

Additional Inherited Members

- Public Member Functions inherited from ns3::MobilityModel
 MobilityModel ()
virtual ~MobilityModel ()=0
int64_t AssignStreams (int64_t stream)
double GetDistanceFrom (Ptr< const MobilityModel > position) const
Vector GetPosition (void) const
double GetRelativeSpeed (Ptr< const MobilityModel > other) const
Vector GetVelocity (void) const
void SetPosition (const Vector &position)
- Protected Member Functions inherited from ns3::MobilityModel
void NotifyCourseChange (void) const

Detailed Description

2D random walk mobility model.

Each instance moves with a speed and direction choosen at random with the user-provided random variables until either a fixed distance has been walked or until a fixed amount of time. If we hit one of the boundaries (specified by a rectangle), of the model, we rebound on the boundary with a reflexive angle and speed. This model is often identified as a brownian motion model.

Definition at line 46 of file random-walk-2d-mobility-model.h.

Member Enumeration Documentation

Enumerator:
MODE_DISTANCE 
MODE_TIME 

Definition at line 51 of file random-walk-2d-mobility-model.h.

Member Function Documentation

int64_t ns3::RandomWalk2dMobilityModel::DoAssignStreams ( int64_t  stream)
privatevirtual

Definition at line 179 of file random-walk-2d-mobility-model.cc.

References m_direction, m_speed, and ns3::RandomVariableStream::SetStream().

+ Here is the call graph for this function:

void ns3::RandomWalk2dMobilityModel::DoDispose ( void  )
privatevirtual

Definition at line 154 of file random-walk-2d-mobility-model.cc.

Vector ns3::RandomWalk2dMobilityModel::DoGetPosition ( void  ) const
privatevirtual
Vector ns3::RandomWalk2dMobilityModel::DoGetVelocity ( void  ) const
privatevirtual

Definition at line 174 of file random-walk-2d-mobility-model.cc.

References ns3::ConstantVelocityHelper::GetVelocity(), and m_helper.

+ Here is the call graph for this function:

void ns3::RandomWalk2dMobilityModel::DoSetPosition ( const Vector position)
privatevirtual
void ns3::RandomWalk2dMobilityModel::DoStart ( void  )
privatevirtual

Definition at line 78 of file random-walk-2d-mobility-model.cc.

References DoStartPrivate().

+ Here is the call graph for this function:

void ns3::RandomWalk2dMobilityModel::DoStartPrivate ( void  )
private
TypeId ns3::RandomWalk2dMobilityModel::GetTypeId ( void  )
static

This method returns the TypeId associated to ns3::RandomWalk2dMobilityModel.

This object is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/$ns3::MobilityModel/$ns3::RandomWalk2dMobilityModel

Attributes defined for this type:

  • Bounds: Bounds of the area to cruise.
  • Time: Change current direction and speed after moving for this delay.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +1000000000.0ns
    • Flags: construct write read
  • Distance: Change current direction and speed after moving for this distance.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 1
    • Flags: construct write read
  • Mode: The mode indicates the condition used to change the current speed and direction
    • Set with class: ns3::EnumValue
    • Underlying type: Distance|Time
    • Initial value: Distance
    • Flags: construct write read
  • Direction: A random variable used to pick the direction (gradients).
  • Speed: A random variable used to pick the speed (m/s).

Attributes defined in parent class ns3::MobilityModel:

  • Position: The current position of the mobility model.
  • Velocity: The current velocity of the mobility model.

No TraceSources defined for this type.
TraceSources defined in parent class ns3::MobilityModel:

  • CourseChange: The value of the position and/or velocity vector changed

Reimplemented from ns3::MobilityModel.

Definition at line 36 of file random-walk-2d-mobility-model.cc.

References m_bounds, m_direction, m_mode, m_modeDistance, m_modeTime, m_speed, ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), MODE_DISTANCE, MODE_TIME, ns3::Seconds(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

Member Data Documentation

Rectangle ns3::RandomWalk2dMobilityModel::m_bounds
private
Ptr<RandomVariableStream> ns3::RandomWalk2dMobilityModel::m_direction
private

Definition at line 73 of file random-walk-2d-mobility-model.h.

Referenced by DoAssignStreams(), DoStartPrivate(), and GetTypeId().

EventId ns3::RandomWalk2dMobilityModel::m_event
private

Definition at line 68 of file random-walk-2d-mobility-model.h.

Referenced by DoSetPosition(), and DoWalk().

ConstantVelocityHelper ns3::RandomWalk2dMobilityModel::m_helper
private
enum Mode ns3::RandomWalk2dMobilityModel::m_mode
private

Definition at line 69 of file random-walk-2d-mobility-model.h.

Referenced by DoStartPrivate(), and GetTypeId().

double ns3::RandomWalk2dMobilityModel::m_modeDistance
private

Definition at line 70 of file random-walk-2d-mobility-model.h.

Referenced by DoStartPrivate(), and GetTypeId().

Time ns3::RandomWalk2dMobilityModel::m_modeTime
private

Definition at line 71 of file random-walk-2d-mobility-model.h.

Referenced by DoStartPrivate(), and GetTypeId().

Ptr<RandomVariableStream> ns3::RandomWalk2dMobilityModel::m_speed
private

Definition at line 72 of file random-walk-2d-mobility-model.h.

Referenced by DoAssignStreams(), DoStartPrivate(), and GetTypeId().


The documentation for this class was generated from the following files: