Scripts to reproduce experiments for reaction mining
This commit is contained in:
17
examples/smt/mutex_param.py
Normal file → Executable file
17
examples/smt/mutex_param.py
Normal file → Executable file
@@ -42,7 +42,7 @@ def powerset(iterable, N=None):
|
||||
def mutex_param_bench(cmd_args):
|
||||
"""
|
||||
Mutex Benchmark
|
||||
|
||||
|
||||
Parametric
|
||||
"""
|
||||
|
||||
@@ -77,7 +77,6 @@ def mutex_param_bench(cmd_args):
|
||||
Inhib = [("s", 1)]
|
||||
|
||||
for i in range(n_proc):
|
||||
|
||||
r.add_reaction([E("out", i), E("act", i)], Inhib, [E("req", i)])
|
||||
r.add_reaction([E("out", i)], [E("act", i)], [E("out", i)])
|
||||
|
||||
@@ -189,7 +188,7 @@ def mutex_param_bench(cmd_args):
|
||||
def mutex_nonparam_bench(cmd_args):
|
||||
"""
|
||||
Mutex Benchmark
|
||||
|
||||
|
||||
Parametric
|
||||
"""
|
||||
|
||||
@@ -217,7 +216,6 @@ def mutex_nonparam_bench(cmd_args):
|
||||
Inhib = [("s", 1)]
|
||||
|
||||
for i in range(n_proc):
|
||||
|
||||
r.add_reaction([E("out", i), E("act", i)], Inhib, [E("req", i)])
|
||||
r.add_reaction([E("out", i)], [E("act", i)], [E("out", i)])
|
||||
|
||||
@@ -297,7 +295,7 @@ def mutex_nonparam_bench(cmd_args):
|
||||
def mutex_nonparam_bench_oldimpl(cmd_args):
|
||||
"""
|
||||
Mutex Benchmark
|
||||
|
||||
|
||||
Parametric
|
||||
"""
|
||||
|
||||
@@ -325,7 +323,6 @@ def mutex_nonparam_bench_oldimpl(cmd_args):
|
||||
Inhib = [("s", 1)]
|
||||
|
||||
for i in range(n_proc):
|
||||
|
||||
r.add_reaction([E("out", i), E("act", i)], Inhib, [E("req", i)])
|
||||
r.add_reaction([E("out", i)], [E("act", i)], [E("out", i)])
|
||||
|
||||
@@ -407,7 +404,6 @@ def state_translate_rsc2rs(p):
|
||||
|
||||
|
||||
def mutex_bench_main(cmd_args):
|
||||
|
||||
mode = cmd_args.mode
|
||||
|
||||
if mode == "p":
|
||||
@@ -422,17 +418,16 @@ def mutex_bench_main(cmd_args):
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
parser.add_argument(
|
||||
"scaling",
|
||||
help="scaling parameter value",
|
||||
)
|
||||
|
||||
|
||||
parser.add_argument(
|
||||
"mode",
|
||||
choices=['p', 'np-p', 'np-np'],
|
||||
choices=["p", "np-p", "np-np"],
|
||||
help="Selects the mode: p - parameter synthesis (parametric implementation), np-p - non-parametric with parametric implementation (with the parameters substituted), np-np - non-parametric with non-parametric implementation (parameters substituted)",
|
||||
)
|
||||
|
||||
@@ -447,7 +442,7 @@ def main():
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
mutex_bench_main(args)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user