<< NL_M_GraphRD NL_M: Mobility NL_M_GraphRWP >>

NARVAL >> NL_M: Mobility > NL_M_GraphRW

NL_M_GraphRW

Random Walk mobility model.

Calling Sequence

[G,F,A] = NL_M_GraphRW(G,F,V,A,R)

Arguments

G :

Graph.

F :

Graph handle.

V :

Speed vector.

A :

Angle vector.

R :

Communication range.

Description

NL_M_GraphRW simulates the random walk 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 follows its direction with its constant speed . A reflection is done when the node touches each border of the network square area.

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
//n=3;
//cr=250;
//nx=[100 200 300];
//ny=[100 300 100];
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
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
a=2*%pi*rand(1,n);//angle for each node
for i=1:200
    [g,f,a]=NL_M_GraphRW(g,f,v,a,cr);//application of NL_M_GraphRW
end

Dependency

NL_M_NodeRW, NL_M_Locality

Report an issue
<< NL_M_GraphRD NL_M: Mobility NL_M_GraphRWP >>