## draw the time axis on the left
axis(2, labels=TRUE)
- mtext("Time (s)", side=2, line=2.5)
+ mtext("Simulated Time (s)", side=2, line=2.5)
title(xlab="Algorithms")
mtext("Data amount (relative)", side=4, line=2.5)
## finally, set title
- t <- paste0(dset$Mode[1], dset$Distrib[1], " / ", dset$Ratio[1], " / ",
+ t <- paste0(dset$Mode[1], dset$Distrib[1], " / ",
+ dset$Ratio[1], " / ",
dset$Platform[1], " / ", dset$Topo[1])
title(main=t)
## restore the graphical parameters
par(p)
+ return(dset)
+}
+
+draw2 <- function(dset) {
+ ## Extract useful data
+ x.1 <- data.frame(Algo=dset$Algo, Size=dset$Size,
+ Idle_avg=dset$Idle_avg,
+ Conv_avg=dset$Conv_avg,
+ Conv_max=dset$Conv_max)
+
+ ## Reshape data -> wide
+ x.2 <- reshape(x.1, direction="wide", idvar="Algo", timevar="Size")
+
+ ## Rename rows
+ rownames(x.2) <- x.2$Algo
+ #colnames(x.2) <- sub("^[^.]*\\.", "", colnames(x.2))
+
+ ## Remove first column ("Algo")
+ x.3 <- as.matrix(x.2[-1])
+
+ x.4 <- x.3[, c(FALSE,FALSE,TRUE)]
+ barplot(x.4, beside=TRUE,
+ names.arg=sub("^[^.]*\\.", "", colnames(x.4)),
+ col=rainbow(nrow(x.3), s=.5))
+
+ x.4 <- x.3[, c(FALSE,TRUE,FALSE)]
+ barplot(x.4, beside=TRUE,
+ axes=FALSE, axisnames=FALSE, add=TRUE,
+ legend.text=TRUE,
+ col=rainbow(nrow(x.3)))
+
+ x.4 <- x.3[, c(TRUE,FALSE,FALSE)]
+ barplot(x.4, beside=TRUE,
+ axes=FALSE, axisnames=FALSE, add=TRUE,
+ col=rainbow(nrow(x.3), v=.5))
+
+ ## finally, set titles
+ t <- paste0(dset$Mode[1], dset$Distrib[1], " / ",
+ dset$Ratio[1], " / ",
+ dset$Platform[1], " / ", dset$Topo[1])
+ title(xlab="Platform Size",
+ ylab="Simulated Time (s)",
+ main=t)
+
}
msg <- function(text,
}
msg("First test, with algorithms \"plain\"...", wait = FALSE);
-draw(subset(ds, grepl("[lt]_plain", Algo)))
+xx <- draw(subset(ds, grepl("[lt]_plain", Algo)),
+ draw_distrib="N")
+
+msg("... with draw2()...")
+draw2(xx)
msg("Second test, with algorithms \"bookkeeping\"...");
-draw(subset(ds, grepl("[lt]_bookkeeping", Algo)))
+xx <- draw(subset(ds, grepl("[lt]_bookkeeping", Algo)),
+ draw_distrib="N")
+
+msg("... with draw2()...")
+draw2(xx)
msg("Third test, with all algorithms...");
-draw()
+xx <- draw(draw_distrib="N")
+
+msg("... with draw2()...")
+draw2(xx)