Extract the first packet of a node inside a network matrix and remove it from its buffer.
[nb,fp]=NARVAL_I_FirstBPacket(i,net)
node index.
network matrix.
first packet of the node buffer.
new buffer.
NARVAL_I_FirstBPacket extracts the first buffer packet fp of the node i inside the network matrix net. Its new buffer state nb consists of the remaining packets.
n=100;//network size [nd,nf]=NARVAL_F_Random_i_j(n);//generation of connection extreme nodes bs=15;//constant buffer size network=NARVAL_I_EmptyBufferNet(n,bs);//initialization of the reception network matrix networks=NARVAL_I_EmptyBufferNet(n,bs);//initialization of the emission network matrix tpmax=n*bs;//maximal quantity of packets simultaneously supported by each network matrix rp=NARVAL_I_EmptyPacketMan(tpmax);//initialization of the packet manager cpt=1;//connection type: TCP cpmax=6;//quantity of connection packets [rp,ps,npn]=NARVAL_I_AddConnections(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]=NARVAL_I_AddPackets2Net(ps(ip),networks,rp);//emission network matrix update with connection packets end networks(nd,:)//initial buffer state of the node nd [nb,fp]=NARVAL_I_FirstBPacket(nd,networks);//application of NARVAL_I_FirstBPacket fp nb | ![]() | ![]() |