<< NL_M_GraphRW NL_M: Mobility NL_M_Locality >>

NARVAL >> NL_M: Mobility > NL_M_GraphRWP

NL_M_GraphRWP

Random way point mobility model.

Calling Sequence

[G,F,X,Y,D,V,T] = NL_M_GraphRWP(G,F,X,Y,D,V,T,TM,VM)

Arguments

G :

Graph.

F :

Graph handle.

X :

X-coordinate of destinations.

Y :

Y-coordinate of destinations.

D :

Distance vector between nodes current destination and their destination.

V :

Speed vector.

T :

Pause duration vector.

:

Maximal pause duration.

:

Maximal speed.

Description

NL_M_GraphRWP simulates the random way point mobility model. The initial graph G is represented by its window handle F. Each node randomly selects a speed between . V gathers the selected speed for each node. Each node moves to its destination located in with its constant speed . The distance between the current location and the destination is . When the node reaches its destination, it waits there during T(i) time steps, and then it selects a new destination and a new speed. Then the node moves only when T(i)==0. When the node reaches its destinations, T(i) is randomly selected between . T is decremented after each simulation step (time incremental). The process is repeated until the end of the simulation.

Examples

n=100;
cr=120;
L=1000;
nx=L*rand(1,n);//current x-coordinate of all nodes
ny=L*rand(1,n);//current y-coordinate of all nodes
name='mobility';
t=[];
h=[];
[g]=NL_G_MakeGraph(name,n,t,h,nx,ny);//creation of a network graph
[h,t]=NL_M_Locality(g.node_x,g.node_y,cr);//application of NL_M_Locality
g.head=h;
g.tail=t;
i=1;//window index
name="mobility";//name
f=NL_M_Background(i,name);//application of NL_M_Background
r=10;//radius
c=1;//color
t=0; 
f=NL_M_GraphDisplayUpdate(g,i,r,c);
vm=10;
v=vm*rand(1,n);//velocity for each node
destx=L*rand(1,n);//destination x-coordinate of all nodes
desty=L*rand(1,n);//destination y-coordinate of all nodes
Tnodes=zeros(1,n);//all nodes are moving
d=sqrt((g.node_x-destx).^2+(g.node_y-desty).^2);//initialization of the distance vector
Tmax=50;//max waiting time
for i=1:300
    [g,f,destx,desty,d,v,Tnodes]=NL_M_GraphRWP(g,f,destx,desty,d,v,Tnodes,Tmax,vm);//application of NL_M_GraphRWP
end

Dependency

NL_M_NodeRWP, NL_M_Locality

Report an issue
<< NL_M_GraphRW NL_M: Mobility NL_M_Locality >>