diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2019-09-17 16:49:12 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2019-09-17 16:49:12 +0200 |
commit | 345e41da4430fbec98737e38a6f21ac4941ad5a8 (patch) | |
tree | 6ecef3d1b1f67529b42091b4bf41ac4b19af22e4 | |
parent | 5fcf85df0ec44609ec72f22eab7adaa06ecac672 (diff) |
automata: Add missing transitions to to_json
-rwxr-xr-x | lib/automata.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/automata.py b/lib/automata.py index 2804e7a..cfc42f1 100755 --- a/lib/automata.py +++ b/lib/automata.py @@ -702,4 +702,14 @@ class PTA: state.power = static_model(state.name, 'power') if param_model(state.name, 'power'): state.power_function = param_model(state.name, 'power')['function'] - print(state.name, state.power, state.power_function.__dict__) + for transition in self.transitions: + transition.duration = static_model(transition.name, 'duration') + if param_model(transition.name, 'duration'): + transition.duration_function = param_model(transition.name, 'duration')['function'] + transition.energy = static_model(transition.name, 'energy') + if param_model(transition.name, 'energy'): + transition.energy_function = param_model(transition.name, 'energy')['function'] + if transition.is_interrupt: + transition.timeout = static_model(transition.name, 'timeout') + if param_model(transition.name, 'timeout'): + transition.timeout_function = param_model(transition.name, 'timeout')['function'] |