From 0d5c7d931d1b5a5cb8a758ffb433726c930f4e4d Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Sun, 24 Apr 2016 16:11:09 +0200 Subject: [PATCH] add GMUL to ComparisonExperiment --- cool.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/cool.py b/cool.py index 0c90acf..18ed21d 100755 --- 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') -- 2.39.5