summaryrefslogtreecommitdiff
path: root/bin/generate-dfa-benchmark.py
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-03-05 08:04:40 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-03-05 08:04:40 +0100
commit965b35d6ae356a0aed8b7a044af62e868f1fab4e (patch)
tree6caf2dc628947f27a99f391bfb66c69cc933168e /bin/generate-dfa-benchmark.py
parent4e37798145fa03bd90880f4ac315529190472eaf (diff)
read instance name from PTA/DFA yaml file
Diffstat (limited to 'bin/generate-dfa-benchmark.py')
-rwxr-xr-xbin/generate-dfa-benchmark.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/generate-dfa-benchmark.py b/bin/generate-dfa-benchmark.py
index 87cb662..4789ad7 100755
--- a/bin/generate-dfa-benchmark.py
+++ b/bin/generate-dfa-benchmark.py
@@ -51,6 +51,12 @@ if __name__ == '__main__':
print(harness.start_benchmark())
+ class_prefix = ''
+ if 'instance' in opt:
+ class_prefix = '{}.'.format(opt['instance'])
+ elif pta.instance:
+ class_prefix = '{}.'.format(pta.instance)
+
for run in pta.dfs(opt['depth'], with_arguments = True):
print(harness.start_run())
for transition, arguments in run:
@@ -59,10 +65,7 @@ if __name__ == '__main__':
print('// wait for {} interrupt'.format(transition.name))
transition_code = '// TODO add startTransition / stopTransition calls to interrupt routine'
else:
- if 'instance' in opt:
- transition_code = '{}.{}({});'.format(opt['instance'], transition.name, ', '.join(map(str, arguments)))
- else:
- transition_code = '{}({});'.format(transition.name, ', '.join(arguments))
+ transition_code = '{}{}({});'.format(class_prefix, transition.name, ', '.join(map(str, arguments)))
print(harness.pass_transition(pta.get_transition_id(transition), transition_code))
if 'sleep' in opt: