addMobility
Class: wnet.Node
Namespace: wnet
Description
addMobility( applies random
waypoint mobility to the specified wireless node.wirelessNode)
addMobility(
sets mobility configuration parameters using one or more optional name-value arguments. For
example, wirelessNode,Name=Value)MobilityModel="constant-velocity" sets the mobility model to
"constant-velocity".
You can add a mobility model to multiple wireless nodes in a single
addMobility call, but the method applies the same mobility parameter
values to all the nodes.
Input Arguments
Wireless node, specified as an object of a subclass of wnet.Node or a
vector of objects of a subclass of wnet.Node.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: addMobility(wirelessNode,MobilityModel="constant-velocity")
sets the mobility model to "constant-velocity".
Mobility model, specified as "random-waypoint",
"random-walk", "constant-velocity", or an
object of a subclass of wnet.Mobility. When you provide a custom
mobility object, the method generates a copy of the mobility model object and
associates it with the node. Consequently, after the method assigns the mobility model
to the node, changes you make to the original mobility model object do not affect the
node.
If you specify a custom mobility model object, the function ignores any other mobility parameters provided as name-value arguments.
Speed range, specified as a two-element row vector. The function sets the speed of the wireless node according to a continuous uniform distribution based on this range. The first element of the vector specifies the minimum speed of the node, while the second specifies the maximum speed, in meters per second. 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.
Dependencies
To specify this argument, you must specify the
MobilityModel argument as
"random-waypoint" or "random-walk".
Data Types: double
Pause duration of the wireless node after reaching a target waypoint, specified as a nonnegative scalar. Units are in seconds.
Dependencies
To specify this argument, you must specify the
MobilityModel argument as
"random-waypoint".
Data Types: double
Shape of the node mobility area, specified as "rectangle" or
"circle".
Dependencies
To specify this argument, you must specify the
MobilityModel argument as
"random-waypoint" or "random-walk".
Center coordinates and dimensions of the node 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 ycurrent1010], where the first two elements specify the xy-coordinates of the current node position."circle"— Specify a three-element numeric vector of the form [xcenter ycenter radius]. The default value is [xcurrent ycurrent10], where the first two elements specify the xy-coordinates of the current node position.
Dependencies
To specify this argument, you must specify the
MobilityModel argument as
"random-waypoint" or "random-walk".
Data Types: double
Mode of random walk, specified as "time" or
"distance".
Dependencies
To specify this argument, you must specify the
MobilityModel argument as
"random-walk".
Time after which the speed and direction change, specified as a positive scalar. Units are in seconds.
Dependencies
To specify this argument, you must specify the WalkMode
argument as "time" and the MobilityModel
argument as "random-walk".
Data Types: double
Distance after which the speed and direction change, specified as a positive scalar. Units are in meters.
Dependencies
To specify this argument, you must specify the WalkMode
argument as "distance" and the MobilityModel
argument as "random-walk".
Data Types: double
Current node velocity in Cartesian x-, y-, and z-coordinates, specified as a numeric vector of the form [vx vy vz]. vx, vy, and vz are velocity components in the x-, y-, and z-directions, respectively. Units are in meters per second.
Dependencies
To specify this argument, you must specify the
MobilityModel argument as
"constant-velocity".
Data Types: double
Refresh Interval, specified as a nonnegative scalar. This argument specifies how
frequently the node updates its position and velocity information. A refresh occurs at
each fixed interval, but only when the node requests it. The units are in seconds. If
you set RefreshInterval to 0, the function
updates position and velocity information immediately whenever you request it.
Data Types: double
Version History
Introduced in R2026a
See Also
Classes
Functions
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)