rx01.awk

来自「基于NS-2的车辆Ad Hoc网络(VANET)的一个应用层协议框架」· AWK 代码 · 共 34 行

AWK
34
字号
# -------------------------------------------------------------------# Vehicular Ad Hoc Networks: Regular Broadcasting of messages.# Skeleton for VANET-protocols. This should be considered as an# example to create other VANET protocols!# Apart from channel load, the "protocol" as it is now does not do# anything useful.## Dan Jungels (daniel.jungels@epfl.ch)# LCA - EPFL### example awk filter# Originally written for ns2.29## 2005-12-15: release of first version (dj)# 2005-12-23: update and cleanup, public release (dj)# -------------------------------------------------------------------BEGIN{    sim_end = 80;    i=0;    while (i<=sim_end) {sec[i]=0; i+=1;};}{    if ($1=="r" && $7=="VanetRBC" && $3=="_1_") {        sec[int($2)]+=$8;    };}END{    i=0;    while (i<=sim_end) {print i " " sec[i]*8; i+=1;};}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?