⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hopcountdistribution

📁 大名鼎鼎的传感器网络仿真实验室平台SENSE
💻
字号:
#! /bin/bash## Show the distribution of hop counts by (source, destination) pairs.# This requires that the simulation be compiled with VISUAL_ROUTE defined.if [ $# -ne 1 ]; then    echo "usage: $0 <fileName>"    exit 1;fiinFile=$1temp=temp.$$grep VR $inFile > $temp.VRcat > $temp.awk <<EOFBEGIN {  FS = ";";}{ gsub(" ", "", \$2);split( \$2, ids, "->");if( ids[1] < ids[2]){  src = ids[1];  dest = ids[2];}else{  src = ids[2];  dest = ids[1];}HCArray[ src, dest, \$5]++;}END {  j = 1;  for( i in HCArray)  {    ind[j] = i;    j++;  }  n = asort( ind);  printf( "%d\n", n);  for( i = 1; i <= n; i++)    printf("%s %d\n", ind[i], HCArray[i]);}EOFawk -F\; -f $temp.awk $temp.VR > $1.HCDistrm $temp.VR #$temp.awk

⌨️ 快捷键说明

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