diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-02-21 17:03:12 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-02-21 17:03:12 +0100 |
commit | 74c43f1af8c222256a37f65288e68e9a0fef4886 (patch) | |
tree | 409559debc0980a8ec7b54ff36e500337415a0f0 /lib/automata.py | |
parent | cf48fc7cc6b49cf2231aeb9254808f129e0ba7b3 (diff) |
update from_json / to_json
Diffstat (limited to 'lib/automata.py')
-rwxr-xr-x | lib/automata.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/automata.py b/lib/automata.py index 379b4dc..37b52e1 100755 --- a/lib/automata.py +++ b/lib/automata.py @@ -292,7 +292,7 @@ class PTA: return cls.from_legacy_json(json_input) kwargs = dict() - for key in ('state_names', 'parameters', 'initial_param_values'): + for key in ('state_names', 'parameters', 'initial_param_values', 'accepting_states'): if key in json_input: kwargs[key] = json_input[key] pta = cls(**kwargs) @@ -375,7 +375,8 @@ class PTA: 'parameters' : self.parameters, 'initial_param_values' : self.initial_param_values, 'state' : dict([[state.name, state.to_json()] for state in self.state.values()]), - 'transitions' : [trans.to_json() for trans in self.transitions] + 'transitions' : [trans.to_json() for trans in self.transitions], + 'accepting_states' : self.accepting_states, } return ret |