Permalink
Cannot retrieve contributors at this time
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?
energy_aware/create6
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
94 lines (79 sloc)
3.48 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unlink(".RData") | |
unlink(".RHistory") | |
rm(list=ls()) | |
pdf("result6.pdf", 8.5, 11) | |
error.bar <- function(x, y, upper, lower=upper, length=0.1, ...) { | |
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(7.5,7.5,4.1,1.2), oma=c(0,0,4,0), xpd=NA, mfrow=c(3,1)) | |
#---first row--- | |
par(mgp=c(4,2,0)) | |
a <- c(200.093,199.844,198.801,198.127,199.936) | |
b <- c(193.148,195.612,194.586,197.791,194.079) | |
c <- c(197.551,198.46,199.959,201.639,197.131) | |
d <- c(354,354,354,354,354) | |
stdevs <- c(sd(a), sd(b), sd(c), sd(d)) | |
means <- c(mean(a), mean(b), mean(c), mean(d)) | |
centers <- barplot(means, yaxt='n', cex.names=1.5, beside=TRUE, names.arg=c("6", "12", "24", "Always on"), | |
col=c("red", "red", "red", "black"), density=c(100, 100, 100, 100)) | |
error.bar(centers, means, 1.96*stdevs/sqrt(5)) | |
title(xlab="Control period (hours)", 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, starting initially with balancing technique, (S'[W]*'=0.5,T'[W]*'=0.5,E'[W]*'=0)')), paste(bold('inactivity threshold=300 s, startup time=30 s, evaluations done every 2 days')))), cex.main=1.4, font.main = 2, line=3, bty="o", adj=0.5) | |
par(new=F) | |
#---second row--- | |
par(mgp=c(4,2,0)) | |
a <- c(0.593,0.598,0.605,0.631,0.598) | |
b <- c(0.596,0.7,0.676,0.641,0.663) | |
c <- c(0.609,0.648,0.618,0.636,0.631) | |
x <- 1:3 | |
stdevs <- c(sd(a), sd(b), sd(c)) | |
means <- c(mean(a), mean(b), mean(c)) | |
min1 <- means-stdevs | |
max1 <- means+stdevs | |
plot(means, main="", xlab="", ylab="", pch=0, frame.plot=T, col="red", ylim=range(c(0, 4)), axes=F, cex.lab=1) | |
lines(means, type="o", col="red", pch=0, lwd=1, lty=2) | |
error.bar(x, means, 1.96*stdevs/sqrt(5)) | |
par(new=T) | |
a <- c(0.078,0.087,0.098,0.103,0.1) | |
b <- c(0.137,0.125,0.148,0.11,0.133) | |
c <- c(0.121,0.108,0.119,0.113,0.137) | |
x <- 1:3 | |
stdevs <- c(sd(a), sd(b), sd(c)) | |
means <- c(mean(a), mean(b), mean(c)) | |
min2 <- means-stdevs | |
max2 <- means+stdevs | |
min2 <- min(min1, min2) | |
max2 <- max(max1, max2) | |
plot(means, main="", xlab="", ylab="", pch=0, frame.plot=T, col="blue", ylim=range(c(0, 4)), axes=F, cex.lab=1) | |
lines(means, type="o", col="blue", pch=0, lwd=1, lty=2) | |
error.bar(x, means, 1.96*stdevs/sqrt(5)) | |
axis(1,at=1:3, las=1, cex.axis=1.5, tck=-.05, labels=c("6", "12", "24")) | |
title(xlab="Control period (hours)", cex.lab=1.5) | |
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", inset=-.15, pch=c(0,0), lty=c(2,2), col=c("red","blue"), c("CV of storage space", "CV of on-time"), bty="n", cex=1.25, ncol=2, text.width=c(0.5,0.5)) | |
par(xpd=F) | |
#---third row--- | |
par(mgp=c(4,2,0)) | |
a <- c(1.112455,1.18711,1.021705,1.16399,1.06513) | |
b <- c(1.39866,1.237136,1.356375,1.36581,1.241723) | |
c <- c(1.230328,1.206787,1.271434,1.169978,1.192942) | |
x <- 1:3 | |
stdevs <- c(sd(a), sd(b), sd(c)) | |
means <- c(mean(a), mean(b), mean(c)) | |
plot(means, main="", xlab="", ylab="", pch=0, frame.plot=T, col="darkgreen", ylim=range(c(0, 2)), axes=F, cex.lab=1) | |
lines(means, type="o", col="darkgreen", pch=0, lwd=1, lty=2) | |
error.bar(x, means, 1.96*stdevs/sqrt(5)) | |
axis(1,at=1:3, las=1, cex.axis=1.5, tck=-.05, labels=c("6", "12", "24")) | |
title(xlab="Control period (hours)", cex.lab=1.5) | |
par(mgp=c(3.5,1,0)) | |
axis(2, las=1, cex.axis=1.5, tck=-.05) | |
title(ylab="Latency per access (s)", cex.lab=1.5) | |
dev.off() |