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.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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)