📄 maketopoplots
字号:
#! /bin/bash# Extract information from the run output, .stat and .nodes files# It assumes that only one file of the type xxx-<seed> since it uses wildcards.# This creates intermediate files with extensions:# .fgrep, .src, .intermediate, .arrow## The final output file is <seed>-topo.jpgif [ $# -ne 2 ]; then echo "usage: $0 <fileName> <analyzerPath>" echo "<analyzerPath> is something like ../../analyzer/bin" exit 1;fi#seedList="4 5 7 98 101 564 840 1532 2100 3692"seedList="4"for seed in $seedList; do echo "-------------------- $seed --------------------" # extract source nodes from output file grep transmissions *-$seed > temp awk '{ printf( "^%d\\>\n", $2)}' temp > fgrep.in rm temp # create gnuplot data files containing either source nodes... grep -f fgrep.in *-$seed.nodes > srcFile # ...or intermediate nodes grep -v -f fgrep.in *-$seed.nodes > nodeFile rm fgrep.in # create gnuplot command file that defines an arrow for each link $2/connectivity *-$seed.stat *-$seed.nodes arrowFile # create gnuplot command file that draws the topology cat > topo.dem <<EOFset term jpeg medium size 1280, 960set output "$seed-topo.jpg"set key offload "arrowFile"plot [0:2000] [0:2000] "nodeFile" using 2:3 with points pt 4, "srcFile" using 2:3 with points pt 5EOF # create the plot gnuplot topo.dem # clean up rm arrowFile srcFile nodeFile topo.demdone
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -