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

📄 genplotlat.awk

📁 OMNET++仿真三色算法的源码,三色算法是无线传感器中一个典型的分簇算法
💻 AWK
字号:
/*compute the latency mean of each <speed, nHops, latency> point*/NR == 2		{			speed = $1;			hops = $2;			lat = $3;			samples = 1;		}NR > 2		{			if( (speed != $1) || (hops != $2) )			{				/* print the computed <speed, nHops, latency> point */								printf"%d \t %f\n", hops, lat/samples;							/* create a new graph index for gnuplot compatibility */				if(speed != $1)					printf"\n\n";				/* reinitialize the variables  */				samples = 1;				speed = $1;				hops = $2;				lat = $3;			}			else			{				samples ++;				lat += $3;			}		}END		{			/* print the last row that otherwise wouldn't be printed */						printf"%d \t %f\n", hops, lat/samples;									}						

⌨️ 快捷键说明

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