Allow selecting Experiment via comandline parameter
authorChristoph Egger <christoph@christoph-egger.org>
Sun, 24 Apr 2016 13:20:48 +0000 (15:20 +0200)
committerChristoph Egger <christoph@christoph-egger.org>
Sun, 24 Apr 2016 13:20:48 +0000 (15:20 +0200)
cool.py

diff --git a/cool.py b/cool.py
index 8b5568f02752996f6a73dc349e2d281f2b641391..bab84825db737af92c6e92edb98af3f5fb865b6b 100755 (executable)
--- a/cool.py
+++ b/cool.py
@@ -7,6 +7,7 @@ from versuchung.execute import shell, CommandFailed
 
 import re
 import os
+import argparse
 
 def natural_key(string_):
     return [int(s) if s.isdigit() else s for s in re.split(r'(\d+)', string_)]
@@ -104,8 +105,19 @@ class GMULExperiment(SolverExperiment):
 
 
 if __name__ == "__main__":
-    import sys
-    experiment = CoolExperiment()
-    dirname = experiment(sys.argv)
+    parser = argparse.ArgumentParser(description="CTL Experiment runnter", add_help=False)
+    parser.add_argument("experiment", choices=['cool', 'treetab', 'gmul', 'comparison'])
 
+    local, unknown = parser.parse_known_args()
+
+    if local.experiment == 'cool':
+        experiment = CoolExperiment()
+
+    elif local.experiment == 'treetab':
+        experiment = TreeTabExperiment()
+
+    elif local.experiment == 'gmul':
+        experiment = GMULExperiment()
+
+    dirname = experiment(unknown)
     print(dirname)