genplotth.awk
来自「this is source code for adhoc network us」· AWK 代码 · 共 44 行
AWK
44 行
/*compute the throughput mean of each <speed, nHops, throughput> point*/NR == 2 { speed = $1; hops = $2; th = $3; samples = 1; }NR > 2 { if( (speed != $1) || (hops != $2) ) { /* print the computed <speed, nHops, th> point */ printf"%d \t %f\n",hops, th/samples; /* print an empty row for gnuplot compatibility */ if(speed != $1) printf"\n\n"; /* reinitialize the variables */ samples = 1; speed = $1; hops = $2; th = $3; } else { samples ++; th += $3; } }END { /* print the last row that otherwise wouldn't be printed */ printf"%d \t %f\n", hops, th/samples; }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?