A state of a policy representation is composed of a set of predicates. When the representation is saved, each state is serialized as a string. However, since sets are unordered, the same state may be saved with predicates in a different order.
Currently, the str_to_state method in the CartPole discretizer assumes a specific order of predicates when parsing these strings, but no error arises because the sample Policy Graphs used for testing are simple and crafted so that the order of predicates is consistent among states.
Proposed next steps:
- Update
str_to_state to handle unordered predicates or use a consistent order when saving states,
- Add new tests for saving and loading policy representations using more realistic Policy Graphs.
A state of a policy representation is composed of a set of predicates. When the representation is saved, each state is serialized as a string. However, since sets are unordered, the same state may be saved with predicates in a different order.
Currently, the
str_to_statemethod in the CartPole discretizer assumes a specific order of predicates when parsing these strings, but no error arises because the sample Policy Graphs used for testing are simple and crafted so that the order of predicates is consistent among states.Proposed next steps:
str_to_stateto handle unordered predicates or use a consistent order when saving states,