Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
unlink(".RData")
unlink(".RHistory")
rm(list=ls())
pdf("result4.pdf", 8.5, 11)
error.bar <- function(x, y, upper, lower=upper, length=0.075, ...) {
if(length (x) != length (y) | length(y) != length(lower) | length(lower) != length(upper))
stop("vectors must be same length")
arrows(x, y+upper, x, y-lower, angle=90, code=3, length=length, ...)
}
par(mar=c(6.5,6.5,4.1,1.2), oma=c(0,0,4,0), xpd=NA, mfrow=c(3,1))
#---first row---
par(mgp=c(3,1,0))
a1 <- c(186.97,186.97,186.97,186.97,186.97)
a2 <- c(200.093,199.844,198.801,198.127,199.936)
a3 <- c(203.042,198.836,201.636,200.446,204.925)
a4 <- c(183.088,178.981,178.981,182.815,181.909)
a5 <- c(189.939,191.961,189.396,188.697,187.362)
a6 <- c(189.272,187.742,155.44,189.094,186.1)
b1 <- c(187.192,187.192,187.192,187.192,187.192)
b2 <- c(198.997,199.356,197.916,199.81,200.285)
b3 <- c(200.238,200.467,201.073,203.473,200.585)
b4 <- c(180.491,179.829,179.739,181.322,180.491)
b5 <- c(192.533,197.299,185.232,193.753,188.132)
b6 <- c(195.062,195.062,195.062,195.062,189.027)
c1 <- c(187.519,187.514,188.087,186.688,188.272)
c2 <- c(199.34,200.4,200.289,201.353,199.612)
c3 <- c(197.918,197.743,199.583,200.898,200.837)
c4 <- c(182.147,182.236,177.766,182.073,187.114)
c5 <- c(188.139,186.124,185.936,186.038,184.883)
c6 <- c(185.058,183.485,184.386,181.804,184.307)
d1 <- c(185.874,185.874,185.874,185.874,185.874)
d2 <- c(200.603,200.35,199.09,201.551,201.196)
d3 <- c(198.886,202.725,202.727,199.077,201.828)
d4 <- c(181.472,182.916,185.867,181.961,187.327)
d5 <- c(189.651,192.774,193.32,191.635,193.61)
d6 <- c(170.229,171.416,168.271,153.143,171.416)
e <- c(354,354,354,354,354)
stdevs <- c(sd(a1), sd(a2), sd(a3), sd(a4), sd(a5), sd(a6), sd(b1), sd(b2), sd(b3), sd(b4), sd(b5), sd(b6), sd(c1), sd(c2), sd(c3), sd(c4), sd(c5), sd(c6), sd(d1), sd(d2), sd(d3), sd(d4), sd(d5), sd(d6), sd(e))
means <- c(mean(a1), mean(a2), mean(a3), mean(a4), mean(a5), mean(a6), mean(b1), mean(b2), mean(b3), mean(b4), mean(b5), mean(b6), mean(c1), mean(c2), mean(c3), mean(c4), mean(c5), mean(c6), mean(d1), mean(d2), mean(d3), mean(d4), mean(d5), mean(d6), mean(e))
centers <- barplot(means, yaxt='n', cex.names=1.25, beside=F, names.arg=c(
NA, NA, " Balancing", NA, NA, NA,
NA, NA, " Sequential", NA, NA, NA,
NA, NA, " Random", NA, NA, NA,
NA, NA, " Groups", NA, NA, NA, "Always on")
, col=c("red", "blue", "green", "magenta", "orange", "brown", "red", "blue", "green", "magenta", "orange", "brown", "red", "blue", "green", "magenta", "orange", "brown", "red", "blue", "green", "magenta", "orange", "brown", "black"), space=c(3,0.5,0.5,0.5,0.5,0.5))
error.bar(centers, means, 1.96*stdevs/sqrt(5))
title(xlab="Initial node allocation technique", cex.lab=1.5)
par(mgp=c(3.5,1,0))
axis(2, las=1, cex.axis=1.5, tck=-.05)
title(ylab="Total consumption (MWh)", cex.lab=1.5)
title(main=expression(atop(paste(bold("64 total nodes, 8 allocated for each user, inactivity threshold=300 s, startup time=30 s")), paste(bold("evaluations done every 2 days, last 6 hours checked at every evaluation")))), cex.main=1.4, font.main = 2, line=4, bty="o", adj=0.5)
par(xpd=T)
legend("top", fill=c("red", "blue", "green", "magenta", "orange", "brown"), c("a", "b", "c", "d", "e", "f"), bty="n", ncol=3, cex=1.25, legend=c(
expression("S"[W]*"=1, T"[W]*"=0, E"[W]*"=0"),
expression("S"[W]*"=0.5, T"[W]*"=0.5, E"[W]*"=0"),
expression("S"[W]*"=0, T"[W]*"=1, E"[W]*"=0"),
expression("S"[W]*"=1, T"[W]*"=0, E"[W]*"=1"),
expression("S"[W]*"=0.5, T"[W]*"=0.5, E"[W]*"=1"),
expression("S"[W]*"=0, T"[W]*"=1, E"[W]*"=1")))
par(xpd=F)
par(new=F)
#---second row---
par(mar=c(11.0,6.5,0,1.2))
par(mgp=c(6,4,0))
a1 <- c(0.552,0.552,0.552,0.552,0.552)
a2 <- c(0.593,0.598,0.605,0.631,0.598)
a3 <- c(0.856,0.835,0.841,0.853,0.855)
a4 <- c(0.866,0.529,0.529,0.522,0.505)
a5 <- c(0.825,0.738,0.857,0.936,0.955)
a6 <- c(0.754,0.813,1.71,0.777,0.761)
b1 <- c(0.398,0.398,0.398,0.398,0.398)
b2 <- c(0.078,0.087,0.098,0.103,0.1)
b3 <- c(0.007,0.009,0.009,0.009,0.009)
b4 <- c(0.259,0.288,0.288,0.228,0.25)
b5 <- c(0.182,0.214,0.235,0.18,0.186)
b6 <- c(0.152,0.178,0.114,0.152,0.162)
x <- 1:6
stdevs <- c(sd(a1), sd(a2), sd(a3), sd(a4), sd(a5), sd(a6))
stdevs2 <- c(sd(b1), sd(b2), sd(b3), sd(b4), sd(b5), sd(b6))
means <- c(mean(a1), mean(a2), mean(a3), mean(a4), mean(a5), mean(a6))
means2 <- c(mean(b1), mean(b2), mean(b3), mean(b4), mean(b5), mean(b6))
combined_means <- c(means[1], means2[1], means[2], means2[2], means[3], means2[3], means[4], means2[4], means[5], means2[5], means[6], means2[6])
combined_stdevs <- c(stdevs[1], stdevs2[1], stdevs[2], stdevs2[2], stdevs[3], stdevs2[3], stdevs[4], stdevs2[4], stdevs[5], stdevs2[5], stdevs[6], stdevs2[6])
centers <- barplot(combined_means, yaxt='n', cex.names=1.5, beside=TRUE,
names.arg=c(
expression(atop(" Balancing", paste(atop(" S"[W]*"=1, T"[W]*"=0", " E"[W]*"=0")))), NA,
expression(atop(" Balancing", paste(atop(" S"[W]*"=0.5, T"[W]*"=0.5", " E"[W]*"=0")))), NA,
expression(atop(" Balancing", paste(atop(" S"[W]*"=0, T"[W]*"=1", " E"[W]*"=0")))), NA,
expression(atop(" Balancing", paste(atop(" S"[W]*"=1, T"[W]*"=0", " E"[W]*"=1")))), NA,
expression(atop(" Balancing", paste(atop(" S"[W]*"=0.5, T"[W]*"=0.5", " E"[W]*"=1")))), NA,
expression(atop(" Balancing", paste(atop(" S"[W]*"=0, T"[W]*"=1", " E"[W]*"=1")))), NA),
col=c("blue", "darkgreen", "blue", "darkgreen", "blue", "darkgreen", "blue", "darkgreen", "blue", "darkgreen", "blue", "darkgreen"),
ylim=c(0,4),
space=c(1,0,1,0,1,0,1,0,1,0,1,0))
error.bar(centers, combined_means, 1.96*combined_stdevs/sqrt(5))
title(xlab="Initial node allocation technique", cex.lab=1.5)
par(xpd=F)
par(mgp=c(2.5,1,0))
axis(2, las=1, cex.axis=1.5, tck=-.05)
title(ylab="CV of storage space\n and on-time", cex.lab=1.5)
par(xpd=T)
legend("top", fill=c("blue","darkgreen"), c("CV of storage space", "CV of on-time"), bty="n", cex=1.25, ncol=2)
par(xpd=F)
par(new=F)
#---third row---
par(mar=c(11.0,6.5,0,1.2))
par(mgp=c(6,4,0))
a1 <- c(1.268494,1.268494,1.268494,1.268494,1.268494)
a2 <- c(1.112455,1.18711,1.021705,1.16399,1.06513)
a3 <- c(1.08835,1.11721,1.16871,1.17341,1.04951)
a4 <- c(1.48557,1.15399,1.15399,1.07659,1.09327)
a5 <- c(1.61517,1.39695,1.51246,1.38653,1.48794)
a6 <- c(1.18683,1.29984,0.98883,1.27691,1.25217)
stdevs <- c(sd(a1), sd(a2), sd(a3), sd(a4), sd(a5), sd(a6))
means <- c(mean(a1), mean(a2), mean(a3), mean(a4), mean(a5), mean(a6))
centers <- barplot(means, yaxt='n', cex.names=1.5, beside=TRUE,
names.arg=c(
expression(atop("Balancing", paste(atop("S"[W]*"=1, T"[W]*"=0", "E"[W]*"=0")))),
expression(atop("Balancing", paste(atop("S"[W]*"=0.5, T"[W]*"=0.5", "E"[W]*"=0")))),
expression(atop("Balancing", paste(atop("S"[W]*"=0, T"[W]*"=1", "E"[W]*"=0")))),
expression(atop("Balancing", paste(atop("S"[W]*"=1, T"[W]*"=0", "E"[W]*"=1")))),
expression(atop("Balancing", paste(atop("S"[W]*"=0.5, T"[W]*"=0.5", "E"[W]*"=1")))),
expression(atop("Balancing", paste(atop("S"[W]*"=0, T"[W]*"=1", "E"[W]*"=1"))))),
col=c("darkcyan", "darkcyan", "darkcyan", "darkcyan", "darkcyan", "darkcyan"), ylim=c(0,2))
error.bar(centers, means, 1.96*stdevs/sqrt(5))
title(xlab="Initial node allocation technique", cex.lab=1.5)
par(xpd=F)
par(mgp=c(3.5,1,0))
axis(2, las=1, cex.axis=1.5, tck=-.05)
title(ylab="Latency per\naccess (s)", cex.lab=1.5)
dev.off()