Commit 73bbe1fe authored by Jorge Visca's avatar Jorge Visca

moved plotting to tools/

parent 15376b52
......@@ -43,8 +43,8 @@ end
-- Launch plotting (in background)
if conf.out_path then
print('plotting launched in background')
os.execute('gnuplot states.plot &')
os.execute('luajit parse_logs.lua '..conf.NRUNS..' &')
os.execute('cd tools; gnuplot states.plot &')
os.execute('luajit tools/parse_logs.lua '..conf.NRUNS..' &')
end
--]]
......@@ -51,5 +51,5 @@ end
frunlog:close()
print('generating contactapp.eps and contactappRe.eps')
os.execute('gnuplot contactapp.plot')
os.execute('cd tools; gnuplot contactapp.plot')
......@@ -51,5 +51,5 @@ end
frunlog:close()
print('generating contacttracing.eps and contacttracingRe.eps')
os.execute('gnuplot contacttracing.plot')
os.execute('cd tools; gnuplot contacttracing.plot')
......@@ -19,16 +19,16 @@ set term post size 5in, 5in eps enhanced color
#set term png size 700,400
set out "Ecount_extinction.eps"
plot "out/Ecount_extinction.txt" using 5:1:4:6:ytic(2) w xerrorbars t "med, quartile", \
"out/Ecount_extinction.txt" using 8:1 w p t "avg", \
plot "../out/Ecount_extinction.txt" using 5:1:4:6:ytic(2) w xerrorbars t "med, quartile", \
"../out/Ecount_extinction.txt" using 8:1 w p t "avg", \
set out "Ecount_outbreak.eps"
plot "out/Ecount_outbreak.txt" using 5:1:4:6:ytic(2) w xerrorbars t "med, quartile", \
"out/Ecount_outbreak.txt" using 8:1 w p t "avg", \
plot "../out/Ecount_outbreak.txt" using 5:1:4:6:ytic(2) w xerrorbars t "med, quartile", \
"../out/Ecount_outbreak.txt" using 8:1 w p t "avg", \
set out "Ecount_hit_stop.eps"
plot "out/Ecount_hit_stop.txt" using 5:1:4:6:ytic(2) w xerrorbars t "med, quartile", \
"out/Ecount_hit_stop.txt" using 8:1 w p t "avg", \
plot "../out/Ecount_hit_stop.txt" using 5:1:4:6:ytic(2) w xerrorbars t "med, quartile", \
"../out/Ecount_hit_stop.txt" using 8:1 w p t "avg", \
unset output
......@@ -19,16 +19,16 @@ set term post size 5in, 5in eps enhanced color
#set term png size 700,400
set out "Efirst_extinction.eps"
plot "out/Efirst_extinction.txt" using 5:1:4:6:ytic(2) w xerrorbars t "med, quartile", \
"out/Efirst_extinction.txt" using 8:1 w p t "avg", \
plot "../out/Efirst_extinction.txt" using 5:1:4:6:ytic(2) w xerrorbars t "med, quartile", \
"../out/Efirst_extinction.txt" using 8:1 w p t "avg", \
set out "Efirst_outbreak.eps"
plot "out/Efirst_outbreak.txt" using 5:1:4:6:ytic(2) w xerrorbars t "med, quartile", \
"out/Efirst_outbreak.txt" using 8:1 w p t "avg", \
plot "../out/Efirst_outbreak.txt" using 5:1:4:6:ytic(2) w xerrorbars t "med, quartile", \
"../out/Efirst_outbreak.txt" using 8:1 w p t "avg", \
set out "Efirst_hit_stop.eps"
plot "out/Efirst_hit_stop.txt" using 5:1:4:6:ytic(2) w xerrorbars t "med, quartile", \
"out/Efirst_hit_stop.txt" using 8:1 w p t "avg", \
plot "../out/Efirst_hit_stop.txt" using 5:1:4:6:ytic(2) w xerrorbars t "med, quartile", \
"../out/Efirst_hit_stop.txt" using 8:1 w p t "avg", \
unset output
......
......@@ -19,16 +19,16 @@ set term post size 5in, 5in eps enhanced color
#set term png size 700,400
set out "Zhit_extinction.eps"
plot "out/Zhit_extinction.txt" using 3:1:ytic(2) w p t "", \
plot "../out/Zhit_extinction.txt" using 3:1:ytic(2) w p t "", \
#using (0):($1-0.3):3:($1+0.3):ytic(2) w boxxyerrorbars t "", \
set out "Zhit_outbreak.eps"
plot "out/Zhit_outbreak.txt" using 3:1:ytic(2) w p t "", \
plot "../out/Zhit_outbreak.txt" using 3:1:ytic(2) w p t "", \
set out "Zhit_hit_stop.eps"
plot "out/Zhit_hit_stop.txt" using 3:1:ytic(2) w p t "", \
plot "../out/Zhit_hit_stop.txt" using 3:1:ytic(2) w p t "", \
unset output
......
......@@ -14,15 +14,15 @@ set ylabel 'Frequency'
set xlabel 'Recovered on Extinction'
set out "extinction_r_histo.eps"
plot "out/extinction_r_histo.txt" using 1:2 lc rgb"green" w boxes t ''
plot "../out/extinction_r_histo.txt" using 1:2 lc rgb"green" w boxes t ''
set xlabel 'Time to Extinction (days)'
set out "extinction_t_histo.eps"
plot "out/finished_extinction_t_histo.txt" using 1:2 lc rgb"green" w boxes t '', \
plot "../out/finished_extinction_t_histo.txt" using 1:2 lc rgb"green" w boxes t '', \
set xlabel 'Time to hit Montevideo (days)'
set out "hit_montevideo_t_histo.eps"
plot "out/finished_hit_stop_t_histo.txt" using 1:2 lc rgb"green" w boxes t '', \
plot "../out/finished_hit_stop_t_histo.txt" using 1:2 lc rgb"green" w boxes t '', \
unset output
d=read.table("out/finished_extinction_t.txt")
d=read.table("../out/finished_extinction_t.txt")
histo <- hist(d$V1, breaks=40, plot=FALSE)
hdata = data.frame(histo$mids, histo$density)
write.table(hdata, file="out/finished_extinction_t_histo.txt", col.names = FALSE, row.names = FALSE)
write.table(hdata, file="../out/finished_extinction_t_histo.txt", col.names = FALSE, row.names = FALSE)
#d=read.table("out/finished_hit_stop_t.txt")
#histo <- hist(d$V1, breaks=40, plot=FALSE)
......@@ -12,10 +12,10 @@ write.table(hdata, file="out/finished_extinction_t_histo.txt", col.names = FALSE
d=read.table("out/extinction_r.txt")
d=read.table("../out/extinction_r.txt")
histo <- hist(d$V1, breaks=40, plot=FALSE)
#print(cbind(histo$mids, histo$density))
hdata = data.frame(histo$mids, histo$density)
write.table(hdata, file="out/extinction_r_histo.txt", col.names = FALSE, row.names = FALSE)
write.table(hdata, file="../out/extinction_r_histo.txt", col.names = FALSE, row.names = FALSE)
local G = require('lib.graph')
G.load('in/nodes.csv', 'in/edges.csv')
local OUT_DOT = 'graph.dot'
local to_dot = function ()
--print ('Loading nodes:', fnamenodes)
local fout = assert(io.open(OUT_DOT, 'w'))
--fout:write('digraph graphname {\n')
fout:write('graph graphname {\n overlap=prism100;\n len=20;\n')
for _, n in pairs(G.N) do
if n.id~=1020 then
local gray = 1.0
n.trabajar_va = tonumber (n.trabajar_va) or 0
n.trabajar_viene = tonumber (n.trabajar_viene) or 0
if n.trabajar_va>0 or n.trabajar_viene>0 then
local line = 'n'..n.id..' [label="'..n.id..'"];'
fout:write(line, '\n')
end
end
end
local edge_added = {}
for _, edges in pairs(G.E) do
for _, edge in pairs(edges) do
local node_from = edge.node_from
local node_to = edge.node_to
if node_from.id~=1020 and node_to~=1020 then
if not edge_added[node_to.id..'--'..node_from.id] then
local w = edge.trabajan
if G.E[node_to] and G.E[node_to][node_from] then
w = w + G.E[node_to][node_from].trabajan
end
local line = 'n'..node_from.id..' -- n'..node_to.id..' [dir=none weight='..w..'];'
--local line = 'n'..node_from.id..' -> n'..node_to.id..' [weight=0.5 color="transparent"];'
edge_added[node_from.id..'--'..node_to.id] = true
fout:write(line, '\n')
end
end
end
end
fout:write('}\n')
fout:close()
local prog = 'neato '..OUT_DOT..' -Teps > '..OUT_DOT..'.eps'
print('executing: ', prog)
os.execute(prog)
end
to_dot()
......@@ -155,8 +155,8 @@ local function process_finished ()
f:close()
end
os.execute('Rscript finished_histo.r')
os.execute('gnuplot finished_histo.plot')
os.execute('cd tools; Rscript finished_histo.r')
os.execute('cd tools; gnuplot finished_histo.plot')
end
......@@ -199,7 +199,7 @@ local function process_Efirst ()
end
f:close()
end
os.execute('gnuplot Efirst.plot')
os.execute('cd tools; gnuplot Efirst.plot')
end
......@@ -245,7 +245,7 @@ local function process_Ecount ()
os.execute('gnuplot Ecount.plot')
os.execute('cd tools; gnuplot Ecount.plot')
end
......@@ -281,7 +281,7 @@ local function process_Zhit ()
end
os.execute('gnuplot Zhit.plot')
os.execute('cd tools; gnuplot Zhit.plot')
end
-------------------------------------------------------------------------------
......
......@@ -15,13 +15,13 @@ set term post size 5in, 2in eps enhanced color
set out "states.eps"
filename = 'out/states8.log'
filename = '../out/states8.log'
stats filename nooutput
#plot "out/states1.log" using 1:2 w steps, \
# "out/states1.log" using 1:3 w steps, \
# "out/states1.log" using 1:4 w steps, \
#plot "../out/states1.log" using 1:2 w steps, \
# "../out/states1.log" using 1:3 w steps, \
# "../out/states1.log" using 1:4 w steps, \
plot for [i=2:STATS_columns] filename using 1:i w steps
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment