BEGIN{ i=1; while (i<10) { nSentPackets[i] = 0; nReceivedPackets[i] = 0; rTotalDelay[i] = 0.0; i += 1; }; } { strEvent = $1 ; rTime = $2 ; strAgt = $4 ; idPacket = $6 ; strType = $7 ; hop = $20 ; if ( strAgt == "AGT" && strType == "cbr" ) { if ( strEvent == "s" ) { nSentPackets[hop] += 1 ; rSentTime[ idPacket ] = rTime ; } if ( strEvent == "r" ) { nReceivedPackets[hop] += 1 ; rTotalDelay[hop] += rTime - rSentTime[ idPacket ]; } } } END{ ### i=1; ### while (i<10) { ### rThroughput[i] = nReceivedPackets[i] * 256 ; ### print i " " rThroughput[i]; ### i += 1; ### } ### print " "; i=1; while (i<10) { if (nSentPackets[i] != 0) rPacketDeliveryRatio[i] = nReceivedPackets[i] / nSentPackets[i] ; print i " " rPacketDeliveryRatio[i]; i += 1; } print " "; i=1; while (i<10) { if ( nReceivedPackets[i] != 0 ) rAverageDelay[i] = rTotalDelay[i] / nReceivedPackets[i] ; print i " " rAverageDelay[i]; i += 1; } }