주요 콘텐츠

nodeMobilityRandomWaypoint

Implement random waypoint mobility model

Since R2026a

    Description

    Use the nodeMobilityRandomWaypoint object to implement a random waypoint mobility model.

    Creation

    Description

    randomWaypointModel = nodeMobilityRandomWaypoint creates a default random waypoint mobility model.

    randomWaypointModel = nodeMobilityRandomWaypoint(PropertyName=Value) sets properties using one or more optional name-value arguments. For example, BoundaryShape="circle" sets the shape of node mobility area to "circle".

    Note that, in the random waypoint model, a wireless node starts by pausing for some duration at a location before moving toward its next random destination (waypoint) with a random speed. The node repeats this process at each waypoint. When you specify a custom mobility model, the position and velocity parameters of the mobility model determines the initial position and the initial velocity of the node.

    Properties

    expand all

    Speed range, specified as a two-element vector. The first element indicates the minimum speed and the second element indicates the maximum speed of the node, both drawn from a continuous uniform distribution. Units are in meters per second.

    To set the speed to a constant value, specify SpeedRange as a two-element row vector with identical values.

    Data Types: single | double

    Pause duration of the wireless node after reaching a target waypoint, specified as a nonnegative scalar. Units are in seconds.

    Data Types: single | double

    Shape of the node mobility area, specified as "rectangle" or "circle".

    Center coordinates and dimensions of the mobility area, specified as a three-element or four-element numeric vector, depending on the value of the BoundaryShape argument. Units are in meters.

    • "rectangle" — Specify a four-element numeric vector of the form [xcenter ycenter length width]. The default value is [xcurrent ycurrent 10 10], where the first two elements specify the x- and y-coordinates of current node position. You can also specify this value as a column vector.

    • "circle" — Specify a three-element numeric vector of the form [xcenter ycenter radius]. The default value is [xcurrent ycurrent 10], where the first two elements are the x- and y-coordinates of the current node position. You can also specify this value as a column vector.

    Data Types: single | double

    Refresh interval, specified as a nonnegative numeric scalar. The nodeMobilityRandomWaypoint object updates the position and velocity information once during this refresh interval, but only when a subclass of wnet.Node request it. The units are in seconds.

    Note that, if you set RefreshInterval to 0, the object updates position and velocity information immediately whenever a subclass of wnet.Node requests it.

    Data Types: single | double

    Examples

    collapse all

    This command creates the random mobility model with all default settings.

    randomWaypointModel = nodeMobilityRandomWaypoint
    randomWaypointModel = 
      nodeMobilityRandomWaypoint with properties:
    
             SpeedRange: [0.4150 1.6600]
          PauseDuration: 0
          BoundaryShape: "rectangle"
                 Bounds: [0 0 10 10]
        RefreshInterval: 0.1000
    
    

    This syntax sets specific properties for the random waypoint mobility model using name-value arguments.

    randomWaypointModel = nodeMobilityRandomWaypoint( ...
        BoundaryShape= "circle", ...
        Bounds=[0 0 20], ...           % Center at (0,0), radius 20
        SpeedRange=[1 2], ...          % Speed range between 1 and 2
        RefreshInterval= 0.1)          % Refresh every 0.1 seconds
    randomWaypointModel = 
      nodeMobilityRandomWaypoint with properties:
    
             SpeedRange: [1 2]
          PauseDuration: 0
          BoundaryShape: "circle"
                 Bounds: [0 0 20]
        RefreshInterval: 0.1000
    
    

    Version History

    Introduced in R2026a