<< NL_M_GraphAnimation NL_M: Mobility NL_M_GraphDisplayUpdate >>

NARVAL >> NL_M: Mobility > NL_M_GraphBS

NL_M_GraphBS

Boundless Simulation Area mobility model.

Calling Sequence

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

Arguments

G :

Network graph.

F :

Graph handle.

V :

Speed vector.

A :

Angle vector.

R :

Communication range.

Description

NL_N_GraphBS simulates the boundless simulation area mobility model. The initial graph G is represented by its window handle F. Each node randomly selects a speed inside the range . V gathers the selected speed for each node. Each node follows its direction with its constant speed . If a node reaches the boundary of a simulation area then it continues travelling and reappears from the opposite side of the 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
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 NARVAL_M_Area
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]=NL_M_GraphBS(g,f,v,a,cr);//application of NL_M_GraphBS
end

Dependency

NL_M_NodeBS, NL_M_Locality

Report an issue
<< NL_M_GraphAnimation NL_M: Mobility NL_M_GraphDisplayUpdate >>