<< NARVAL_M_Random_i_j_nf NARVAL NARVAL_M_XYExtractionB >>

NARVAL >> NARVAL > NARVAL_M_XYExtraction

NARVAL_M_XYExtraction

Extract the coordinates of network nodes from a graphic window when n moving nodes are defined after nf fixed nodes.

Calling Sequence

[nx,ny] = NARVAL_M_XYExtraction(f,n,nf)

Parameters

f :

graphic window ID.

n :

quantity of moving nodes

nf :

quantity of fixed nodes.

nx :

nodes x-coordinates

ny :

nodes y-coordinates

Description

NARVAL_M_XYExtraction extracts the coordinates of network nodes (nx,ny) from the graphic window defined by its handle f when n moving nodes are defined after nf fixed nodes.

Examples

w=1;
scf(w);//creation of a graphic window
clf(w);
f=gcf();
f.figure_name='MANET' ;
f.pixmap='on'; //set the pixmap mode
//creation of the network boundaries
plot2d(0,0,-1,"011"," ",style=5,rect=[0,0,1000,1000]);
xgrid;
//simulation scenario
r=10;//display radius of moving nodes
rf=15;//display radius of fixed nodes
rs=20;//display radius of the moving nodes belonging to the connection under studies
n=50;//quantity of moving nodes
nf=5;//quantity of fixed nodes
[ndep,nfin]=NARVAL_M_Random_i_j_nf(n,nf);//connection extremal nodes
L=1000;//network square area side
ts=20;//maximum time break
vm=20;//maximum speed
v=vm*rand(1,n);//velocity
Tlim=1000;//simulation duration
nodex=L*rand(1,n+nf);//current x-coordinate of all nodes
nodey=L*rand(1,n+nf);//current y-coordinate of all nodes
destx=L*rand(1,n+nf);//destination x-coordinate of all nodes(not used for fixed nodes)
desty=L*rand(1,n+nf);//destination y-coordinate of all nodes(not used for fixed nodes)
d=sqrt((nodex-destx).^2+(nodey-desty).^2);//initialization of the distance vector
//display the initial state
NARVAL_M_Graph2Plot(nodex(nf+1:$),nodey(nf+1:$),r,5,w);//fixed nodes in red (5)
NARVAL_M_Graph2Plot(nodex(1:nf),nodey(1:nf),rf,2,w);//fixed nodes in blue (3)
show_pixmap();//display
f=gcf();//get the figure properties
i=ndep-nf;//emission node in purple (6)
f.children.children($-1).children(n-i+1).data(3:4)=[rs rs];//node i
f.children.children($-1).children(n-i+1).foreground=6;//node i 
f.children.children($-1).children(n-i+1).background=6;//node i
show_pixmap();//display
[nodx1,nody1]=NARVAL_M_XYExtraction(f,n,nf);//application of NARVAL_M_XYExtraction
Tnodes=zeros(1,n);//initialization of breaking time parameters
Tmax=100;//maximal waiting time
dmax=180;//Locality radius for the links attribution
he=[];//link head vector
ta=[];//link tail vector 
col=[3 5 2];
cb=1;
//displacement of nodes 
for i=1:n
fr=f.children.children($-1).children(n-i+1);//node i 
[fr.data(1) fr.data(2) destx(i) desty(i) d(i) v(i) Tnodes(i)]=NARVAL_M_NodeRWP(fr.data(1),fr.data(2),destx(i),desty(i),d(i),v(i),Tnodes(i),Tmax,vm,L);
//displacement of the node i			
end
[nodx2,nody2]=NARVAL_M_XYExtraction(f,n,nf);//application of MobilityXYExtraction
f.pixmap='off';
[nodx1 ;nodx2]
[nody1 ;nody2]

Authors

Foued Melakessou

Contact

Dr. Foued Melakessou

Research Associate

Interdisciplinary Centre for Security, Reliability and Trust

Room F106

University of Luxembourg

6, rue Coudenhove Kalergi

L-1359 Luxembourg-Kirchberg

E-mail: foued.melakessou@uni.lu

Tel: (+352) 46 66 44 5346

Home Page


<< NARVAL_M_Random_i_j_nf NARVAL NARVAL_M_XYExtractionB >>