summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-05-20 13:49:11 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2020-05-20 13:49:11 +0200
commit2d89290854d10a22a0c333736803e8b7be385bb2 (patch)
tree1ff13fca18fd35cabd9ca1f8fd693a1e0eb294d6 /lib
parent96406d24d0246ac1f7511a59a3102523c6d69767 (diff)
automata: Handle set_param before arg_to_param_map
Diffstat (limited to 'lib')
-rwxr-xr-xlib/automata.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/automata.py b/lib/automata.py
index 8a43e8f..b7668c5 100755
--- a/lib/automata.py
+++ b/lib/automata.py
@@ -452,12 +452,14 @@ class Transition:
if self.param_update_function:
return self.param_update_function(param_dict, args)
ret = param_dict.copy()
- if self.arg_to_param_map:
- for k, v in self.arg_to_param_map.items():
- ret[v] = args[k]
+ # set_param is for default values, arg_to_param_map may contain optional overrides.
+ # So arg_to_param_map must come last.
if self.set_param:
for k, v in self.set_param.items():
ret[k] = v
+ if self.arg_to_param_map:
+ for k, v in self.arg_to_param_map.items():
+ ret[v] = args[k]
return ret
def to_json(self) -> dict: