<< NL_M_GraphRWP NL_M: Mobility NL_M_LocalityHT >>

NARVAL >> NL_M: Mobility > NL_M_Locality

NL_M_Locality

Optimized calculation of network links in a moving topology.

Calling Sequence

[H,T] = NL_M_Locality(X,Y,R)

Arguments

X :

X-coordinate vector.

Y :

Y-coordinate vector.

R :

Communication range.

H :

Head link vector.

T :

Tail link vector.

Description

NL_M_Locality extracts the links of the network graph G in a moving topology. Coordinates of nodes are stored in [X,Y]. A link is available if the distance between two distinct nodes is smaller than their communication range R. Links information is stored in [H,T], where H (respectivelly T) gives the initial (respectivelly final) node of each link.

Examples

n=100;
cr=50;
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

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