aboutsummaryrefslogtreecommitdiff
path: root/benchmark.py
diff options
context:
space:
mode:
authorCharlie Blake2018-01-18 23:57:52 +0000
committerGitHub2018-01-18 23:57:52 +0000
commitbcaff64bdeaab93ff0d40dfd039b4b43ff689b1c (patch)
tree7882812349716607773458b1c830579de802793f /benchmark.py
parentMerge pull request #29 from thecharlesblake/refactor-improve-debug (diff)
parentRemoves unnecessary assert statement bug (diff)
downloadmetasol-bcaff64bdeaab93ff0d40dfd039b4b43ff689b1c.tar.gz
metasol-bcaff64bdeaab93ff0d40dfd039b4b43ff689b1c.zip

Merge pull request #30 from thecharlesblake/symmetrical-hash

Symmetrical hash

Diffstat (limited to 'benchmark.py')
-rw-r--r--benchmark.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/benchmark.py b/benchmark.py
index 1eaf9f4..905d960 100644
--- a/benchmark.py
+++ b/benchmark.py
@@ -12,11 +12,17 @@ timeoutsLimit = 4
timeoutSeconds = 1
runtype = "release"
-if (len(sys.argv) == 2
+if (len(sys.argv) >= 2
and (sys.argv[1] == "--debug" or sys.argv[1] == "-d")):
runtype = "debug"
print("Running in debug mode...")
+flag = ""
+if (len(sys.argv) >= 2
+ and (sys.argv[1] == "--simple-hash" or sys.argv[1] == "-sh")):
+ flag = "-simple-hash"
+ print("Running in simple-hash mode...")
+
class SolitaireRulesGen(metaclass=ABCMeta):
def __init__(self, name):
@@ -166,8 +172,9 @@ for rulesGen in [SpanishPatienceRulesGen(),
timeouts = 0
for attempt in range(20):
try:
- run("./cmake-build-" + runtype + "/bin/solvitaire --rules "
- + tempRulesFilename + " --random " + str(attempt + 1),
+ run("./cmake-build-" + runtype + "/bin/solvitaire" + flag
+ + " --rules " + tempRulesFilename + " --random "
+ + str(attempt + 1),
shell=True,
check=True,
stdout=DEVNULL,
@@ -199,6 +206,7 @@ for rulesGen in [SpanishPatienceRulesGen(),
else:
print("Solved " + rulesGen.name + " at level " + str(level)
+ " ...")
+ summaryResults[rulesGen.name] = level
# Prints results summary table
t = PrettyTable(['Solitaire', 'Level'])