A Discrete-Event Network Simulator
API
Public Member Functions | Private Attributes | List of all members
ns3::ConstantVelocityHelper Class Reference

Utility class used to move node with constant velocity. More...

#include "constant-velocity-helper.h"

Public Member Functions

 ConstantVelocityHelper ()
 
 ConstantVelocityHelper (const Vector &position)
 Create object and set position. More...
 
 ConstantVelocityHelper (const Vector &position, const Vector &vel)
 Create object and set position and velocity. More...
 
Vector GetCurrentPosition (void) const
 Get current position vector. More...
 
Vector GetVelocity (void) const
 Get velocity; if paused, will return a zero vector. More...
 
void Pause (void)
 Pause mobility at current position. More...
 
void SetPosition (const Vector &position)
 Set position vector. More...
 
void SetVelocity (const Vector &vel)
 Set new velocity vector. More...
 
void Unpause (void)
 Resume mobility from current position at current velocity. More...
 
void Update (void) const
 Update position, if not paused, from last position and time of last update. More...
 
void UpdateWithBounds (const Rectangle &rectangle) const
 Update position, if not paused, from last position and time of last update. More...
 
void UpdateWithBounds (const Box &bounds) const
 Update position, if not paused, from last position and time of last update. More...
 

Private Attributes

Time m_lastUpdate
 time of last update More...
 
bool m_paused
 state variable for paused More...
 
Vector m_position
 state variable for current position More...
 
Vector m_velocity
 state variable for velocity More...
 

Detailed Description

Utility class used to move node with constant velocity.

Definition at line 36 of file constant-velocity-helper.h.

Constructor & Destructor Documentation

◆ ConstantVelocityHelper() [1/3]

ns3::ConstantVelocityHelper::ConstantVelocityHelper ( )

Definition at line 30 of file constant-velocity-helper.cc.

References NS_LOG_FUNCTION.

◆ ConstantVelocityHelper() [2/3]

ns3::ConstantVelocityHelper::ConstantVelocityHelper ( const Vector &  position)

Create object and set position.

Parameters
positionthe position vector

Definition at line 35 of file constant-velocity-helper.cc.

References NS_LOG_FUNCTION.

◆ ConstantVelocityHelper() [3/3]

ns3::ConstantVelocityHelper::ConstantVelocityHelper ( const Vector &  position,
const Vector &  vel 
)

Create object and set position and velocity.

Parameters
positionthe position vector
velthe velocity vector

Definition at line 41 of file constant-velocity-helper.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ GetCurrentPosition()

Vector ns3::ConstantVelocityHelper::GetCurrentPosition ( void  ) const

◆ GetVelocity()

Vector ns3::ConstantVelocityHelper::GetVelocity ( void  ) const

◆ Pause()

void ns3::ConstantVelocityHelper::Pause ( void  )

◆ SetPosition()

void ns3::ConstantVelocityHelper::SetPosition ( const Vector &  position)

◆ SetVelocity()

void ns3::ConstantVelocityHelper::SetVelocity ( const Vector &  vel)

◆ Unpause()

void ns3::ConstantVelocityHelper::Unpause ( void  )

◆ Update()

void ns3::ConstantVelocityHelper::Update ( void  ) const

◆ UpdateWithBounds() [1/2]

void ns3::ConstantVelocityHelper::UpdateWithBounds ( const Rectangle rectangle) const

◆ UpdateWithBounds() [2/2]

void ns3::ConstantVelocityHelper::UpdateWithBounds ( const Box bounds) const

Update position, if not paused, from last position and time of last update.

Parameters
bounds3D bounding box for resulting position; object will not move outside the box

Definition at line 109 of file constant-velocity-helper.cc.

References m_position, max, min, NS_LOG_FUNCTION, Update(), ns3::Box::xMax, ns3::Box::xMin, ns3::Box::yMax, ns3::Box::yMin, ns3::Box::zMax, and ns3::Box::zMin.

Member Data Documentation

◆ m_lastUpdate

Time ns3::ConstantVelocityHelper::m_lastUpdate
mutableprivate

time of last update

Definition at line 97 of file constant-velocity-helper.h.

Referenced by SetPosition(), SetVelocity(), and Update().

◆ m_paused

bool ns3::ConstantVelocityHelper::m_paused
private

state variable for paused

Definition at line 100 of file constant-velocity-helper.h.

Referenced by GetVelocity(), Pause(), Unpause(), and Update().

◆ m_position

Vector ns3::ConstantVelocityHelper::m_position
mutableprivate

state variable for current position

Definition at line 98 of file constant-velocity-helper.h.

Referenced by GetCurrentPosition(), SetPosition(), Update(), and UpdateWithBounds().

◆ m_velocity

Vector ns3::ConstantVelocityHelper::m_velocity
private

state variable for velocity

Definition at line 99 of file constant-velocity-helper.h.

Referenced by GetVelocity(), SetPosition(), SetVelocity(), and Update().


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