RandomWaypointMobility

Package: inet.mobility.single

simple module RandomWaypointMobility

Implements the Random Waypoint mobility model.

The node moves in line segments. For each line segment, a random destination position (distributed uniformly over the constraint area or volume) and a random speed is chosen. You can define a speed as a variate from which a new value will be drawn for each line segment; it is customary to specify it as uniform(minSpeed, maxSpeed). When the node reaches the target position, it waits for the time waitTime which can also be defined as a variate. After this time, the algorithm calculates a new random position, etc.

This model was originally written by Georg Lutz (GeorgLutz AT gmx DOT de) for his diploma thesis “Effizientes Modell für Funkverbindungen in 4G-Netzen für OMNeT++” (Efficient model for radio links in 4G networks for OMNeT++) at Institut für Telematik, Universität Karlsruhe (Institute for Telematics, University Karlsruhe, Germany), 2005-06-21.

Author: Georg Lutz

inet.mobility.single.RandomWaypointMobilityRandomWaypointMobilitysimple

Inheritance diagram

Extends

Name

Type

Description

MovingMobilityBase

simple module

Abstract base module for mobility models.

Parameters

Name

Type

Default value

Description

displayStringTextFormat

string

“p: {position}\nv: {velocity}”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

subjectModule

string

“^”

The module path that determines the subject module, the motion of which this mobility model describes. The default value is the parent module

coordinateSystemModule

string

“”

The module path of the geographic coordinate system module; optional, empty disables geographic conversion (and the {geo_position} directive)

updateDisplayString

bool

true

Enables continuous update of the subject module’s position by modifying its display string

constraintAreaMinX

double

-inf m

The minimum x position of the constraint area. It is unconstrained by default (negative infinity)

constraintAreaMinY

double

-inf m

The minimum y position of the constraint area. It is unconstrained by default (negative infinity)

constraintAreaMinZ

double

-inf m

The minimum z position of the constraint area. It is unconstrained by default (negative infinity)

constraintAreaMaxX

double

inf m

The maximum x position of the constraint area. It is unconstrained by default (positive infinity)

constraintAreaMaxY

double

inf m

The maximum y position of the constraint area. It is unconstrained by default (positive infinity)

constraintAreaMaxZ

double

inf m

The maximum z position of the constraint area. It is unconstrained by default (positive infinity)

updateInterval

double

0.1s

The simulation time interval used to regularly signal mobility state changes and update the display

faceForward

bool

true

initialX

double

uniform(this.constraintAreaMinX, this.constraintAreaMaxX)

initialY

double

uniform(this.constraintAreaMinY, this.constraintAreaMaxY)

initialZ

double

nanToZero(uniform(this.constraintAreaMinZ, this.constraintAreaMaxZ))

initFromDisplayString

bool

true

Enables one-time initialization from the subject module’s display string

speed

double

mps

Use uniform(minSpeed, maxSpeed) or another distribution

waitTime

double

0s

Wait time between reaching a target and choosing a new one

Properties

Name

Value

Description

class

RandomWaypointMobility

display

i=block/cogwheel

Signals

Name

Type

Unit

Description

mobilityStateChanged

inet::MobilityBase

It works in inet, but not in the extended module in another namespace

Source code

//
// Implements the Random Waypoint mobility model.
//
// The node moves in line segments. For each line segment, a random destination
// position (distributed uniformly over the constraint area or volume) and a
// random speed is chosen. You can define a speed as a variate from which a new
// value will be drawn for each line segment; it is customary to specify it as
// `uniform(minSpeed, maxSpeed)`. When the node reaches the target position,
// it waits for the time `waitTime` which can also be defined as a variate.
// After this time, the algorithm calculates a new random position, etc.
//
// This model was originally written by Georg Lutz (GeorgLutz AT gmx DOT de) for
// his diploma thesis "Effizientes Modell für Funkverbindungen in 4G-Netzen für
// OMNeT++" (Efficient model for radio links in 4G networks for OMNeT++)
// at Institut für Telematik, Universität Karlsruhe (Institute for
// Telematics, University Karlsruhe, Germany), 2005-06-21.
//
// @author Georg Lutz
//
simple RandomWaypointMobility extends MovingMobilityBase
{
    parameters:
        double initialX @unit(m) = default(uniform(this.constraintAreaMinX, this.constraintAreaMaxX));
        double initialY @unit(m) = default(uniform(this.constraintAreaMinY, this.constraintAreaMaxY));
        double initialZ @unit(m) = default(nanToZero(uniform(this.constraintAreaMinZ, this.constraintAreaMaxZ)));
        bool initFromDisplayString = default(true); // Enables one-time initialization from the subject module's display string
        volatile double speed @unit(mps) = default(mps); // Use uniform(minSpeed, maxSpeed) or another distribution
        volatile double waitTime @unit(s) = default(0s); // Wait time between reaching a target and choosing a new one
        @class(RandomWaypointMobility);
}

File: src/inet/mobility/single/RandomWaypointMobility.ned