Simple Module RandomWPMobility

Package: inet.mobility.single
File: src/inet/mobility/single/RandomWPMobility.ned

C++ definition

Random Waypoint mobility model.

The node moves in line segments. For each line segment, a random destination position (distributed uniformly over the constraint area) 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 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. Slightly modified by Andras Varga 2005.06.22.

Author: Georg Lutz

RandomWPMobility

Usage diagram:

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.

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
coordinateSystemModule string ""

module path of the geographic coordinate system module

visualizeMobility bool true

false means this mobility module does no visualization

visualRepresentation string "^"

determines the module that is moved by this mobility

constraintAreaMinX double -1m/0

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

constraintAreaMinY double -1m/0

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

constraintAreaMinZ double -1m/0

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

constraintAreaMaxX double 1m/0

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

constraintAreaMaxY double 1m/0

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

constraintAreaMaxZ double 1m/0

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

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
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 RandomWPMobility

Signals:

Name Type Unit
mobilityStateChanged MobilityBase

Source code:

//
// Random Waypoint mobility model.
//
// The node moves in line segments. For each line segment, a random destination
// position (distributed uniformly over the constraint area) 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 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. Slightly modified
// by Andras Varga 2005.06.22.
//
// @author Georg Lutz
//
simple RandomWPMobility 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);
        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(RandomWPMobility);
}