You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
930 B

2 months ago
  1. import stormpy
  2. import stormpy.core
  3. import stormpy.examples
  4. import stormpy.examples.files
  5. def example_exploration_01():
  6. """
  7. Example to exploration of MDPs.
  8. :return:
  9. """
  10. program = stormpy.parse_prism_program(stormpy.examples.files.prism_pomdp_maze)
  11. prop = "R=? [F \"goal\"]"
  12. properties = stormpy.parse_properties(prop, program)
  13. model = stormpy.build_model(program, properties)
  14. print(model.model_type)
  15. for state in model.states:
  16. if state.id in model.initial_states:
  17. print(state)
  18. for action in state.actions:
  19. for transition in action.transitions:
  20. print("From state {} by action {}, with probability {}, go to state {}".format(state, action, transition.value(),
  21. transition.column))
  22. if __name__ == '__main__':
  23. example_exploration_01()