<< NL_I_NodeBufferExchange NL_I: Internet NL_I_NodeFirstPacket >>

NARVAL >> NL_I: Internet > NL_I_NodeBufferExtract

NL_I_NodeBufferExtract

Extract the current buffer occupancy of a node inside a network matrix.

Calling Sequence

[O,B] = NL_I_NodeBufferExtract(I,Net)

Arguments

I :

Node index.

Net :

Network matrix.

O :

Buffer occupancy.

B :

Buffer.

Description

NL_I_NodeBufferExtract extracts the current buffer B of the node I inside the network matrix Net. The length of B rates O.

Examples

n=100;//network size
bs=15;//constant buffer size
network=NL_I_NetworkMatrixInit(n,bs);//initialization of the reception network matrix 
networks=NL_I_NetworkMatrixInit(n,bs);//initialization of the emission network matrix
tpmax=n*bs;//maximal quantity of packets simultaneously supported by each network matrix 
rp=NL_I_PacketManagerInit(tpmax);//initialization of the packet manager
[nd,nf]=NL_F_RandIntNiNj(n);//generation of connection extreme nodes 
cs=6;//connection size
cpt=1;//connection type: TCP
[rp,ps,csn]=NL_I_PMAddConnections(rp,nd,nf,cpt,cs);//connection packets generation inside the packet manager
[bo,bi]=NL_I_NodeBufferExtract(nd,networks)//application of NL_I_NodeBufferExtract: initial buffer state of the node nd
[networks]=NL_I_NodeBufferExchange(nd,ps,networks);//add the connection packets inside the emission network matrix 
[bo,bi]=NL_I_NodeBufferExtract(nd,networks)//application of NL_I_NodeBufferExtract: new buffer state of the node nd

Report an issue
<< NL_I_NodeBufferExchange NL_I: Internet NL_I_NodeFirstPacket >>