<< NL_G_GraphSize NL_G: Graph NL_G_GraphUnion >>

NARVAL >> NL_G: Graph > NL_G_GraphStructure

NL_G_GraphStructure

Initialize a graph structure.

Calling Sequence

[G] = NL_G_GraphStructure(N,R,M,X,Y)

Arguments

N :

Graph size.

R :

Communication range vector.

M :

Placement mode.

X :

Nodes' x-coordinate vector.

Y :

Nodes' y-coordinate vector.

G :

Graph structure.

Description

NL_G_GraphStructure initializes the graph structure G, composed by N nodes defined by their x-coordinate node.x, their y-coordinate node.y, their communication range node.cr, their speed node.v, their neighbors node.neigh, their destination coordinates [node.destx node.desty] and their energy node.en. There are 2 modes of nodes placement. If the mode M is 0, then nodes are randomly placed inside a square of side L=1000. If M=1, then the nodes are placed in the given position [X,Y].

Examples

n=100;
crk=50;
cr=crk*ones(1,n);
m=0;
[N]=NL_G_GraphStructure(n,cr,m,[],[]);//application of NL_G_GraphStructure
N(1)
m=1;
[M]=NL_G_GraphStructure(3,cr,m,[100 200 300],[100 200 300]);//application of NL_G_GraphStructure
M(1)

Dependency


Report an issue
<< NL_G_GraphSize NL_G: Graph NL_G_GraphUnion >>