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.

19 lines
778 B

  1. from stormpy.core._core import *
  2. def _build_model(program, formulae):
  3. intermediate = _core.build_model(program, formulae)
  4. if intermediate.parametric:
  5. if intermediate.model_type == ModelType.DTMC:
  6. return intermediate.as_pdtmc()
  7. elif intermediate.model_type == ModelType.MDP:
  8. return intermediate.as_pmdp()
  9. else:
  10. raise RuntimeError("Not supported parametric model constructed")
  11. else:
  12. if intermediate.model_type == ModelType.DTMC:
  13. return intermediate.as_pdtmc()
  14. elif intermediate.model_type == ModelType.MDP:
  15. return intermediate.as_pmdp()
  16. else:
  17. raise RuntimeError("Not supported non-parametric model constructed")
  18. build_model = _build_model