Commit d16f3738 authored by Hans-Peter Deifel's avatar Hans-Peter Deifel
Browse files

wta: Pass --different-values argument through

parent 0415ff22
...@@ -10,9 +10,9 @@ import scipy.stats as st ...@@ -10,9 +10,9 @@ import scipy.stats as st
samples = 5 samples = 5
def coalg_file(states, monoid, symbols, zero_frequency, i): def coalg_file(states, monoid, symbols, zero_frequency, different_values, i):
return "bench/wta_%s_%s_%s_%s_%d" % (monoid, symbols, zero_frequency, return "bench/wta_%s_%s_%s_%s_%s_%d" % (monoid, symbols, zero_frequency,
states, i) different_values, states, i)
def generate(args): def generate(args):
...@@ -21,11 +21,12 @@ def generate(args): ...@@ -21,11 +21,12 @@ def generate(args):
monoid = args.monoid monoid = args.monoid
symbols = args.symbols symbols = args.symbols
zero_frequency = args.zero_frequency zero_frequency = args.zero_frequency
different_values = args.different_values
os.makedirs("bench", exist_ok=True) os.makedirs("bench", exist_ok=True)
for i in range(0, samples): for i in range(0, samples):
f = coalg_file(states, monoid, symbols, zero_frequency, f = coalg_file(states, monoid, symbols, zero_frequency, different_values,
i) + ".coalgebra" i) + ".coalgebra"
if os.path.exists(f): if os.path.exists(f):
...@@ -33,7 +34,8 @@ def generate(args): ...@@ -33,7 +34,8 @@ def generate(args):
cmd = [ cmd = [
generator, "--states", states, "--monoid", monoid, "--symbols", generator, "--states", states, "--monoid", monoid, "--symbols",
symbols, "--zero-frequency", zero_frequency symbols, "--zero-frequency", zero_frequency,
"--different-values", different_values
] ]
subprocess.run(cmd, stdout=open(f, "w+")) subprocess.run(cmd, stdout=open(f, "w+"))
...@@ -44,8 +46,9 @@ def run_one(args, i): ...@@ -44,8 +46,9 @@ def run_one(args, i):
monoid = args.monoid monoid = args.monoid
symbols = args.symbols symbols = args.symbols
zero_frequency = args.zero_frequency zero_frequency = args.zero_frequency
different_values = args.different_values
f = coalg_file(states, monoid, symbols, zero_frequency, i) + ".coalgebra" f = coalg_file(states, monoid, symbols, zero_frequency, different_values, i) + ".coalgebra"
copar_args = [copar, 'refine', '--stats-json', f] copar_args = [copar, 'refine', '--stats-json', f]
...@@ -60,6 +63,7 @@ def run_one(args, i): ...@@ -60,6 +63,7 @@ def run_one(args, i):
stats['monoid'] = monoid stats['monoid'] = monoid
stats['symbols'] = symbols stats['symbols'] = symbols
stats['zero-freq'] = zero_frequency stats['zero-freq'] = zero_frequency
stats['mon-values'] = different_values
stats['i'] = i stats['i'] = i
return stats return stats
...@@ -71,8 +75,9 @@ def run_one_simple(args, i): ...@@ -71,8 +75,9 @@ def run_one_simple(args, i):
monoid = args.monoid monoid = args.monoid
symbols = args.symbols symbols = args.symbols
zero_frequency = args.zero_frequency zero_frequency = args.zero_frequency
different_values= args.different_values
f = coalg_file(states, monoid, symbols, zero_frequency, i) + ".coalgebra" f = coalg_file(states, monoid, symbols, zero_frequency, different_values, i) + ".coalgebra"
copar_args = [copar, 'refine', f] copar_args = [copar, 'refine', f]
...@@ -228,6 +233,7 @@ def main(): ...@@ -228,6 +233,7 @@ def main():
gen_parser.add_argument('--monoid', required=True) gen_parser.add_argument('--monoid', required=True)
gen_parser.add_argument('--symbols', required=True) gen_parser.add_argument('--symbols', required=True)
gen_parser.add_argument('--zero-frequency', required=True) gen_parser.add_argument('--zero-frequency', required=True)
gen_parser.add_argument('--different-values', required=True)
gen_parser.set_defaults(func=generate) gen_parser.set_defaults(func=generate)
run_parser = subparsers.add_parser('run') run_parser = subparsers.add_parser('run')
...@@ -236,6 +242,7 @@ def main(): ...@@ -236,6 +242,7 @@ def main():
run_parser.add_argument('--monoid', required=True) run_parser.add_argument('--monoid', required=True)
run_parser.add_argument('--symbols', required=True) run_parser.add_argument('--symbols', required=True)
run_parser.add_argument('--zero-frequency', required=True) run_parser.add_argument('--zero-frequency', required=True)
run_parser.add_argument('--different-values', required=True)
run_parser.add_argument( run_parser.add_argument(
'--stddev', action='store_true', help="report stddev for timings") '--stddev', action='store_true', help="report stddev for timings")
run_parser.add_argument( run_parser.add_argument(
...@@ -250,6 +257,7 @@ def main(): ...@@ -250,6 +257,7 @@ def main():
bisect_parser.add_argument('--monoid', required=True) bisect_parser.add_argument('--monoid', required=True)
bisect_parser.add_argument('--symbols', required=True) bisect_parser.add_argument('--symbols', required=True)
bisect_parser.add_argument('--zero-frequency', required=True) bisect_parser.add_argument('--zero-frequency', required=True)
bisect_parser.add_argument('--different-values', required=True)
bisect_parser.add_argument('--start-states', type=int, default=50) bisect_parser.add_argument('--start-states', type=int, default=50)
bisect_parser.add_argument('--good', type=int) bisect_parser.add_argument('--good', type=int)
bisect_parser.add_argument('--bad', type=int) bisect_parser.add_argument('--bad', type=int)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment