RandomWaypointMobility

Package: inet.mobility.single

RandomWaypointMobility

simple module

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 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 fuer Funkverbindungen in 4G-Netzen fuer OMNeT++" (Efficient model for radio links in 4G networks for OMNeT++) at Institut fuer Telematik, Universitaet Karlsruhe (Institute for Telematics, University Karlsruhe, Germany), 2005-06-21.

Author: Georg Lutz

RandomWaypointMobility

Inheritance diagram

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Extends

Name Type Description
MovingMobilityBase simple module

Abstract base module for mobility models.

Parameters

Name Type Default value Description
subjectModule string "^"

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

coordinateSystemModule string ""

module path of the geographic coordinate system module

displayStringTextFormat string "p: %p\nv: %v"

format string for the mobility module's display string text

updateDisplayString bool true

enables continuous update of the subject module's position via the display string

constraintAreaMinX double -inf m

min x position of the constraint area, unconstrained by default (negative infinity)

constraintAreaMinY double -inf m

min y position of the constraint area, unconstrained by default (negative infinity)

constraintAreaMinZ double -inf m

min z position of the constraint area, unconstrained by default (negative infinity)

constraintAreaMaxX double inf m

max x position of the constraint area, unconstrained by default (positive infinity)

constraintAreaMaxY double inf m

max y position of the constraint area, unconstrained by default (positive infinity)

constraintAreaMaxZ double inf m

max z position of the constraint area, 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
display i=block/cogwheel
class RandomWaypointMobility

Signals

Name Type Unit
mobilityStateChanged inet::MobilityBase

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 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 fuer Funkverbindungen in 4G-Netzen fuer
// OMNeT++" (Efficient model for radio links in 4G networks for OMNeT++)
// at Institut fuer Telematik, Universitaet 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