Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1088761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:07:07+00:00 2026-05-16T23:07:07+00:00

Just started reading on random way point mobility for MANET. I found a lot

  • 0

Just started reading on random way point mobility for MANET. I found a lot of work implements this model. Hence, I assumed the Matlab code will be available which I could look into to understand it better. Unfortunately, I found none.

Any body can suggest any good tutorial or codes available on random way point ? Help appreciated.

UPDATE:

Random Waypoint (RWP) model is a commonly used synthetic model for mobility, e.g., in Ad Hoc networks. It is an elementary model which describes the movement pattern of independent nodes by simple terms.

Briefly, in the RWP model:

Each node moves along a zigzag line from one waypoint to the next
The waypoints are uniformly distributed over the given convex area, e.g. unit disk.
At the start of each leg a random velocity is drawn from the velocity distribution
(in the basic case the velocity is constant 1)
Optionally, the nodes may have so-called “thinking times” when they reach each waypoint before continuing on the next leg, where durations are independent and identically distributed random variables

![1. Common Problems with Random Waypoint Model][1]

Zig-zag trajectories: RWP model is elementary and it is easy to argue about the paths being unnatural. Then again, any practical protocol or mechanism should be robust and give a reasonable performance with a wide range of moving patterns, including movement similar to RWP model.
Velocity distribution: The most common problem with simulation studies using random waypoint model is a poor choice of velocity distribution [4], e.g., uniform distribution U(0,Vmax). Such velocity distributions (which seem to be common with NS-2 simulations!) lead to a situation where at the stationary state each node stops moving. In order to avoid this the velocity distribution should be such that
1/E[1/V] > 0
Note that the mean time a node spends on a single leg is proportional to 1/E[1/V].
2. Random Waypoint on the Border (RWPB)

In the (standard) RWP model the waypoints are uniformly distributed over the given domain. Alternatively, the waypoints can be uniformly distributed on the border of the domain and this model is referred to as the “Random waypoint on the border” (RWPB) model. The spatial node density resulting from RWPB model is quite different from the RWP model, i.e. the probability mass shifts from the center of the area to the borders. In particular, if the border contains a straight line segment, then there is a positive probability that a random leg resides on the line segment (resulting in a 1-dimension pdf on each line segment on the border).

[1]: https://i.stack.imgur.com/VKobC.gif [source:http://www.netlab.tkk.fi/~esa/java/rwp/rwp-model.shtml%5D

This is what I found a good source. How can I implement this model in MATLAB?

UPDATE

RANDOM NETWORK TOPOLOGY:

 maxx=1000;
 maxy=1000;
 maxn=100;
%node generation
 node = rand(maxn,2);
 node(:,1) = node(:,1)*maxx;
 node(:,2) = node(:,2)*maxy;
 maxd=2;
 noded = rand(maxd,2);
 noded(:,1) = noded(:,1)*maxx;
 noded(:,2) = noded(:,2)*maxy;
 maxs=4;
 nodes = rand(maxs,2);
 nodes(:,1) = nodes(:,1)*maxx;
 nodes(:,2) = nodes(:,2)*maxy;
    % make background white, run only once
    colordef none,  whitebg
    figure(1);
    axis equal
    hold on 
    box on;
    plot(node(:, 1), node(:, 2), 'k.', 'MarkerSize', 25);
    hold on 

   % plot(noded(:, 1), noded(:, 2), 'r.', 'MarkerSize', 25);
    hold on
  %  plot(nodes(:, 1), nodes(:, 2), 'b.', 'MarkerSize', 25);
    hold on
    title('Network topology');
    xlabel('X');
    ylabel('Y'); 
    grid on
    Xminor grid on 
    axis([0, maxx, 0, maxy]);
    set(gca, 'XTick', [0; maxx]);
    set(gca, 'YTick', [maxy]);

Result:

RANDOM WAY POINT MOBILITY:

clear;
hold on;
X = 1500;
Y = 500;

MINSPEED = 0;
MAXSPEED = 20;
PAUSETIME = 2;
TIME = 900;
N = 10;
AMOSTRAS = 30;
nodes = zeros(N,6);
nodes_speed = zeros(N,TIME);
nodes_speed_mean = zeros (AMOSTRAS,TIME);

for a=1:AMOSTRAS
    for i=1:N
        j=1;
        x = rand*X;
        y = rand*Y;
        waypointX = rand*X;
        waypointY = rand*Y;
        speed = MINSPEED+(MAXSPEED - MINSPEED)*rand;
        time = 1;
        node = [x y speed waypointX waypointY time];
        nodes(j,:) =node;
        while time <= TIME
            node = nodes(j,:);
            x = node(1);
            y = node(2);
            speed = node(3);
            waypointX = node(4);
            waypointY = node(5);
            dist = sqrt((x-waypointX)^2+(y-waypointY)^2);
            new_waypointX = rand*X;
            new_waypointY = rand*Y;
            new_speed =  MINSPEED+(MAXSPEED - MINSPEED)*rand;
            time = time + dist/speed + PAUSETIME;
            node = [waypointX waypointY new_speed new_waypointX new_waypointY time];
            j=j+1;
            nodes(j,:) =node;
        end
        for k=1:j-1
            node_ant = nodes(k,:);
            speed = node_ant(3);
            time_ant = node_ant(6);
            node_next = nodes(k+1,:);
            time_next = node_next(6);
            if time_next >TIME
                time_next = TIME;
            end
            times = ceil(time_ant):floor(time_next);
            if ~isempty(times)
                nodes_speed(i,times) = speed ;
            end
        end
    end
    nodes_speed_mean(a,:) = mean(nodes_speed);
end
plot (mean(nodes_speed_mean),'r');
grid on 

![alt text][3]

  1. I generated the network topology which is static in the first code. In the second code I generated RWP mobility. Now, my question is, Can I do like this:

    The generates the network randomly prints it . Next the mobility model is applied the network. I shall plot the network again and see the nodes have moved. Lat I plot the spedd as (figure 2.).

Thanks for the help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T23:07:08+00:00Added an answer on May 16, 2026 at 11:07 pm

    So at each step you need to generate 3 random numbers:

    1. to represent the time that the actor
      stays at the current location.

    2. to represent the x-coordinate of the
      actor’s next step.

    3. to represent the y-coordinate of the
      actor’s next step.

    (You might replace the x- and y-coordinates with a velocity vector, but you still need 2 random numbers.)

    Now all you have to do is figure out what distributions to draw the random numbers from to fit your model. A very naive Matlab approach would be to execute:

    rand(10,3)-0.5
    

    to represent the starting point and the first 9 steps taken by one of your actors. As well as selecting your distributions carefully, you’ll want to scale the steps taken.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started reading Effective C++ today and got to the point where the
We have a bunch of data on S3 (images) but just started reading about
I just have started to learn Haskell and combine reading books and tutorials with
Just started getting a bunch of errors on our C# .Net app that seemed
Have just started using Google Chrome , and noticed in parts of our site,
I just started thinking about creating/customizing a web crawler today, and know very little
Have just started using Visual Studio Professional's built-in unit testing features, which as I
I just started using GNU Emacs as my text editor and I am concerned
I just started using the WPF WebBrowser that is included in Net 3.5 SP1.
I just started to learn Ruby and as a .Net developer, I'm wondering if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.