getRatio.awk
资源名称:ns2-aodv.rar [点击查看]
上传用户:yjhhw123
上传日期:2014-05-29
资源大小:1824k
文件大小:1k
源码类别:
网络
开发平台:
Others
- BEGIN {
- sendLine = 0;
- recvLine = 0;
- fowardLine = 0;
- sendline1 = 0;
- fowardLine1 = 0;
- }
- $0 ~/^s.* AGT/ {
- sendLine ++ ;
- }
- $0 ~/^r.* AGT/ {
- recvLine ++ ;
- }
- $0 ~/^f.* RTR/ {
- fowardLine ++ ;
- }
- $0 ~/^s.* AODV/ {
- sendLine1 ++ ;
- }
- $0 ~/^f.* AODV/ {
- fowardLine1 ++ ;
- }
- END {
- printf "s:%d r:%d ndeliverate:%.4f nf:%d nmeanhop:%.4f nload:%.4f n", sendLine, recvLine, (recvLine/sendLine),fowardLine,(sendLine+fowardLine)/sendLine,(sendLine1+fowardLine1)/recvLine;
- }