diff options
| author | thecharlesblake | 2018-01-10 12:12:15 +0000 |
|---|---|---|
| committer | thecharlesblake | 2018-01-10 12:12:15 +0000 |
| commit | 6c7a66dd874b4a345c9e78bc36097a88d2dc8ec9 (patch) | |
| tree | 1ba3f7998224ef9550ddcbbc27aa5e90208d67f8 /benchmark.py | |
| parent | Remove build order from sol rules (diff) | |
| download | metasol-6c7a66dd874b4a345c9e78bc36097a88d2dc8ec9.tar.gz metasol-6c7a66dd874b4a345c9e78bc36097a88d2dc8ec9.zip | |
Add results table to benchmark script
Diffstat (limited to 'benchmark.py')
| -rw-r--r-- | benchmark.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/benchmark.py b/benchmark.py index c00ccce..fa13c7b 100644 --- a/benchmark.py +++ b/benchmark.py @@ -5,6 +5,7 @@ import sys import atexit from subprocess import run, TimeoutExpired, CalledProcessError, DEVNULL from abc import ABCMeta, abstractmethod +from prettytable import PrettyTable tempRulesFilename = "temp_rules.json" timeoutsLimit = 4 @@ -134,6 +135,8 @@ def cleanup(): atexit.register(cleanup) +summaryResults = {} + # Loops through each canonical solitaire for rulesGen in [SpanishPatienceRulesGen(), FreeCellRulesGen(), @@ -184,7 +187,14 @@ for rulesGen in [SpanishPatienceRulesGen(), + " within time constraint\n") print("Game description at level " + str(level) + ":") print(str(rulesGen) + "\n") + summaryResults[rulesGen.name] = level break else: print("Solved " + rulesGen.name + " at level " + str(level) + " ...") + +# Prints results summary table +t = PrettyTable(['Solitaire', 'Level']) +for name, level in summaryResults.items(): + t.add_row([name, level]) +print(t) |
