aboutsummaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2016-05-11 22:03:53 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2016-05-11 22:03:53 -0400
commit236b06a88f709ca6c70ce0c7adfb57f9f0b2a60d (patch)
tree6be9561263946d30e0f402bae94786bc0a27393f /main.py
parentaa709603639d6a010ae20bc7fc2856c92693ecf6 (diff)
downloadpos-236b06a88f709ca6c70ce0c7adfb57f9f0b2a60d.tar.gz
Add final code used during experiments
Diffstat (limited to 'main.py')
-rw-r--r--main.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/main.py b/main.py
new file mode 100644
index 0000000..c37c288
--- /dev/null
+++ b/main.py
@@ -0,0 +1,36 @@
+import numpy as np
+import matplotlib.pyplot as plt
+import seaborn
+import matplotlib
+
+seaborn.set_style("white")
+
+matplotlib.rcParams.update({'xtick.labelsize': 12})
+matplotlib.rcParams.update({'ytick.labelsize': 12})
+matplotlib.rcParams.update({'legend.fontsize': 12})
+matplotlib.rcParams.update({'axes.titlesize': 12})
+matplotlib.rcParams.update({'axes.labelsize': 12})
+
+with open("time.txt") as fh:
+ values = [line.split() for line in fh]
+
+h, post, bfs = zip(*values)
+plt.plot(h, post, label="DF")
+plt.plot(h, bfs, label="BF")
+plt.legend()
+plt.xlabel("height")
+plt.ylabel("runtime (s)")
+plt.savefig("time.pdf", bbox_inches='tight')
+
+plt.clf()
+with open("misses.txt") as fh:
+ values = [line.split() for line in fh]
+h, bfs, post = zip(*values)
+plt.plot(h, post, label="DF")
+plt.plot(h, bfs, label="BF")
+plt.legend()
+plt.xlabel("height")
+plt.ylabel("cache-misses")
+plt.savefig("misses.pdf", bbox_inches='tight')
+
+print h, post, bfs