-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_replicas.R
More file actions
47 lines (37 loc) · 1.53 KB
/
plot_replicas.R
File metadata and controls
47 lines (37 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# run this by starting R (type R at the bash prompt)
# then type source("plot.R") at the R prompt.
metadata <- read.csv("log-2011-02-02T21:09:32-05:00", nrows=8, header=0, sep=":")
log <- read.csv("log-2011-02-02T21:09:32-05:00", skip=8)
# start the PNG device driver to save the graph
# png(filename="graphs/lms-recall2.png", height=400, width=600, bg="white")
replicas <- log$replicas
put.recall <- log$put.recall
get.recall <- log$get.recall
perf = get.recall*put.recall
# exepcted local minima for uniform distribution
elm.uniform= function (area, br, h) {
area/(pi*(br*h)^2)
}
size = metadata[3,2]*metadata[4,2]
print(size)
hops = metadata[8,2]
print(hops)
broadcast = metadata[5,2]
print(broadcast)
explm = elm.uniform(size, broadcast, hops)
print(explm)
colours = c("darkorange4", "darkorange2","darkolivegreen3", "darkolivegreen4",
"blue3", "blue4", "aquamarine3", "aquamarine4", "brown3", "brown4")
# ann=False turns off automatic axis annotations (we specify
# them manually below)
plot(replicas, put.recall, type="o", lty=3, ylim=range(0,1),
ann=FALSE, col=colours[1])
lines(replicas, get.recall, type="o", lty=3, pch=21, col=colours[2])
lines(replicas, perf, type="o", lty=1, pch=22, col=colours[3])
abline(v=explm)
title(xlab="Replicas", ylab="Recall",
main="LMS Performance\nNodes=500,Area=1000000, BR = 200, Hops=1")
legend(40,0.20, legend=c("PUT Recall","GET Recall", "GET*PUT"),
border=FALSE, col=colours, lty=c(3,31), pch=c(21,21,22), cex=0.8)
# turn the device driver off (flushes the PNG output as well)
#dev.off()