Boundless Simulation Area mobility model.
[G,F] = NL_M_GraphBS(G,F,V,A,R)
Network graph.
Graph handle.
Speed vector.
Angle vector.
Communication range.
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.
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 | ![]() | ![]() |