From 345e41da4430fbec98737e38a6f21ac4941ad5a8 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 17 Sep 2019 16:49:12 +0200 Subject: automata: Add missing transitions to to_json --- lib/automata.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib') 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'] -- cgit v1.2.3