From 7d8fafad61c7639e3551939942e5ea507c6a134e Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 21 Feb 2019 13:35:29 +0100 Subject: support legacy argument / benchmark test value definitions --- lib/automata.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/automata.py b/lib/automata.py index be0b3d8..563ff4d 100755 --- a/lib/automata.py +++ b/lib/automata.py @@ -87,7 +87,7 @@ class State: for trans in self.outgoing_transitions.values(): if with_arguments: for args in itertools.product(*trans.argument_values): - yield [[trans.name, args]] + yield [(trans.name, args)] else: yield [trans.name] else: @@ -95,7 +95,7 @@ class State: for suffix in trans.destination.dfs(depth - 1, with_arguments = with_arguments): if with_arguments: for args in itertools.product(*trans.argument_values): - new_suffix = [[trans.name, args]] + new_suffix = [(trans.name, args)] new_suffix.extend(suffix) yield new_suffix else: @@ -212,6 +212,7 @@ class Transition: 'destination' : self.destination.name, 'is_interrupt' : self.is_interrupt, 'arguments' : self.arguments, + 'argument_values' : self.argument_values, 'arg_to_param_map' : self.arg_to_param_map, 'set_param' : self.set_param, 'duration' : _attribute_to_json(self.duration, self.duration_function), @@ -326,10 +327,16 @@ class PTA: for trans_name in sorted(json_input['transition'].keys()): transition = json_input['transition'][trans_name] destination = transition['destination'] + arguments = list() + argument_values = list() if type(destination) == list: destination = destination[0] + for arg in transition['parameters']: + arguments.append(arg['name']) + argument_values.append(arg['values']) for origin in transition['origins']: - pta.add_transition(origin, destination, trans_name) + pta.add_transition(origin, destination, trans_name, + arguments = arguments, argument_values = argument_values) return pta -- cgit v1.2.3