<< NL_I_NetworkState NL_I: Internet NL_I_NodeBufferExtract >>

NARVAL >> NL_I: Internet > NL_I_NodeBufferExchange

NL_I_NodeBufferExchange

Exchange the buffer of a node inside a network matrix in respect with its new content.

Calling Sequence

[Net] = NL_I_NodeBufferExchange(I,B,Net)

Arguments

I :

Node index.

B :

Buffer.

Net :

Network matrix.

Description

NL_I_NodeBufferExchange exchanges the current buffer of the node I inside the network matrix Net by its new content B.

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
rp(1:cs,:)//initial state of the packet manager
networks(nd,:)//initial buffer state of the node nd
[networks]=NL_I_NodeBufferExchange(nd,ps,networks);//application of NL_I_NodeBufferExchange
networks(nd,:)//new buffer state of the node nd

Report an issue
<< NL_I_NetworkState NL_I: Internet NL_I_NodeBufferExtract >>