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/create3
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
91 lines (79 sloc)
3.41 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("result3.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(12.818,12.818,12.818,12.818,12.818) | |
b <- c(13.097,13.097,13.097,13.097,13.097) | |
c <- c(13.202,13.202,13.202,13.202,13.202) | |
d <- c(14,14,14,14,14) | |
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("300", "1800", "3600", "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="Inactivity threshold (s)", 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, with balancing technique')), paste(bold('(S'[W]*'=0.5, T'[W]*'=0.5, E'[W]*'=0), startup time=30 s')))), 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.12,0.12,0.12,0.12,0.12) | |
b <- c(0.12,0.12,0.12,0.12,0.12) | |
c <- c(0.12,0.12,0.12,0.12,0.12) | |
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.092,0.092,0.092,0.092,0.092) | |
b <- c(0.092,0.092,0.092,0.092,0.092) | |
c <- c(0.092,0.092,0.092,0.092,0.092) | |
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("300", "1800", "3600")) | |
title(xlab="Inactivity threshold (s)", 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(0.152033,0.152033,0.152033,0.152033,0.152033) | |
b <- c(0.057434,0.057434,0.057434,0.057434,0.057434) | |
c <- c(0.040089,0.040089,0.040089,0.040089,0.040089) | |
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("300", "1800", "3600")) | |
title(xlab="Inactivity threshold (s)", 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() |