Extract the first packet of a node inside a network matrix and remove it from its buffer.
[B,P] = NL_I_NodeFirstPacket(I,Net)
Node index.
Network matrix.
First packet of the node buffer.
New buffer.
NL_I_NodeFirstPacket extracts the first buffer packet P of the node I inside the network matrix Net. Its new buffer state B consists of the remaining packets.
n=100;//network size [nd,nf]=NL_F_RandIntNiNj(n);//generation of connection extreme nodes 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 cpt=1;//connection type: TCP cpmax=6;//quantity of connection packets [rp,ps,npn]=NL_I_PMAddConnections(rp,nd,nf,cpt,cpmax);//packet manager update with connection packets ip=[]; for k=1:length(npn) ip=ip($)+1:sum(npn(1:k)); [networks,rp]=NL_I_AddPackets2Network(ps(ip),networks,rp);//emission network matrix update with connection packets end networks(nd,:)//initial buffer state of the node nd [nb,fp]=NL_I_NodeFirstPacket(nd,networks)//application of NL_I_NodeFirstPacket | ![]() | ![]() |