#Copyright (c) 2006 EPFL/Switzernet/Intarnet by Emin Gabrielyan reset; print "Drawing..."; commands network-config.txt; commands diagramshp-config.txt; shell "rmdir /s /q diagram"; shell "mkdir diagram"; shell "del /q diagram\*"; shell "copy randomwalk-config.txt diagram > nul"; printf "%%!PS\n" > (ps); printf " [/View [/XYZ null null 1]\n" > (ps); printf " /Page 1\n" > (ps); printf " /PageMode /FullScreen\n" > (ps); printf " /DOCVIEW pdfmark\n" > (ps); printf "/Courier findfont %f scalefont setfont\n",fontsz > (ps); table params IN "ODBC" "data/randomwalk.mdb": [], x_max, y_max, coverage, source_node, sink_node, N, T; read table params; table coordinates IN "ODBC" "data/randomwalk.mdb": [Timeframe,NODES], x,y; read table coordinates; data data/LINKS.txt; table flow IN "ODBC" "data/shortestpath.mdb": PATH <- [frame,link_entry,link_exit], flow; read table flow; for{t in 1..T} { # coverages printf "gsave\n" > (ps); printf "%f 0 translate\n",page_bar > (ps); printf "%f dup translate\n",nodesz > (ps); printf "%s setrgbcolor\n","1 0.95 0.8" > (ps); for{i in NODES} { printf "newpath %f %f %f 0 360 arc fill\n",x[t,i],y[t,i],coverage/2 > (ps); } printf "grestore\n" > (ps); #information bar printf "gsave 0 %f translate\n",page_height > (ps); printf "0 %f translate 0 0 moveto ( frame: %d) show\n", -fontsz,t > (ps); printf "0 %f translate 0 0 moveto ( links: %d) show\n", -fontsz,card(LINKS[t]) > (ps); printf "0 %f translate 0 0 moveto ( nodes: %d) show\n", -fontsz,N > (ps); printf "grestore\n" > (ps); printf "%f 0 translate\n",page_bar > (ps); printf "%f dup translate\n",nodesz > (ps); # not used random walk links printf "[%f %f] 0 setdash 0.5 setgray %f setlinewidth\n",linewidth*2,linewidth*3,linewidth > (ps); for{(i,j) in LINKS[t]: i (ps); } # links followed by the flow printf "[ ] 0 setdash 1 0 0 setrgbcolor %f setlinewidth\n",linewidth > (ps); for{(t,i,j) in PATH} { printf "%f %f moveto %f %f lineto stroke\n",x[t,i],y[t,i],x[t,j],y[t,j] > (ps); } # nodes printf "0.5 setgray\n" > (ps); for{i in NODES diff {source_node,sink_node}} { printf "newpath %f %f %f 0 360 arc fill\n",x[t,i],y[t,i],nodesz > (ps); } # parties (end nodes) printf "%s setrgbcolor\n","1 0 0" > (ps); for{i in {source_node,sink_node}} { printf "newpath %f %f %f 0 360 arc fill\n",x[t,i],y[t,i],nodesz > (ps); } printf "showpage\n" > (ps); } close (ps); table page OUT "ODBC" "data/diagram.xls": [], page_width, page_height; write table page;