add GMUL to ComparisonExperiment
authorChristoph Egger <christoph@christoph-egger.org>
Sun, 24 Apr 2016 14:11:09 +0000 (16:11 +0200)
committerChristoph Egger <christoph@christoph-egger.org>
Sun, 24 Apr 2016 14:20:01 +0000 (16:20 +0200)
cool.py

diff --git a/cool.py b/cool.py
index 0c90acf2725f707828e150c8902d1d1c4bec6808..18ed21d850bbddce0139ca8ab8276f2d253ffc67 100755 (executable)
--- a/cool.py
+++ b/cool.py
@@ -116,10 +116,12 @@ class GMULExperiment(SolverExperiment):
 class ComparisonExperiment(Experiment):
     outputs = { 'cool_data' : CSV_File('cool.csv'),
                 'treetab_data' : CSV_File('treetab.csv'),
+                'gmul_data' : CSV_File('gmul.csv'),
                 'graphs' : Directory('graphs')
               }
     inputs = { 'cool' : CoolExperiment(),
-               'treetab' : TreeTabExperiment()
+               'treetab' : TreeTabExperiment(),
+               'gmul' : GMULExperiment()
              }
 
     def folder_to_csv(self, folder, csv):
@@ -143,21 +145,27 @@ class ComparisonExperiment(Experiment):
     def run(self):
         self.folder_to_csv(self.inputs.cool.timing.path, self.outputs.cool_data)
         self.folder_to_csv(self.inputs.treetab.timing.path, self.outputs.treetab_data)
+        self.folder_to_csv(self.inputs.gmul.timing.path, self.outputs.gmul_data)
 
         with self.outputs.graphs as path:
+            samplecount = len(self.outputs.cool_data.value)
             # Time
             plt.title("Time spent: %s" %
                       os.path.basename(self.inputs.treetab.metadata['formulas']))
             plt.yscale('log')
             plt.ylabel('time / s')
             plt.xlabel('problem size')
-            plt.plot(range(1,21),
+            plt.plot([x[0].split('.')[1] for x in self.outputs.cool_data.value],
                      [x[1] for x in self.outputs.cool_data.value],
                      'bo', label="cool")
-            plt.plot(range(1,21),
+            plt.plot([x[0].split('.')[1] for x in self.outputs.treetab_data.value],
                      [x[1] for x in self.outputs.treetab_data.value],
                      'gv', label="TreeTab")
             plt.legend()
+            plt.plot([x[0].split('.')[1] for x in self.outputs.gmul_data.value],
+                     [x[1] for x in self.outputs.gmul_data.value],
+                     'r*', label="GMUL")
+
             plt.savefig('time.svg', format='svg')
             plt.close()
 
@@ -167,13 +175,17 @@ class ComparisonExperiment(Experiment):
             plt.yscale('log')
             plt.ylabel('memory / kB')
             plt.xlabel('problem size')
-            plt.plot(range(1,21),
+            plt.plot([x[0].split('.')[1] for x in self.outputs.cool_data.value],
                      [x[2] for x in self.outputs.cool_data.value],
                      'bo', label="cool")
-            plt.plot(range(1,21),
+            plt.plot([x[0].split('.')[1] for x in self.outputs.treetab_data.value],
                      [x[2] for x in self.outputs.treetab_data.value],
                      'gv', label="TreeTab")
             plt.legend()
+            plt.plot([x[0].split('.')[1] for x in self.outputs.gmul_data.value],
+                     [x[2] for x in self.outputs.gmul_data.value],
+                     'r*', label="GMUL")
+
             plt.savefig('memory.svg', format='svg')