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.

20 lines
887 B

  1. import pycarl
  2. import stormpy
  3. import stormpy.logic
  4. from helpers.helper import get_example_path
  5. class TestModel:
  6. def test_instantiate_dtmc(self):
  7. program = stormpy.parse_prism_program(get_example_path("pdtmc", "brp16_2.pm"))
  8. formulas = stormpy.parse_formulas_for_prism_program("P=? [ F s=5 ]", program)
  9. model = stormpy.build_parametric_model(program, formulas[0])
  10. parameters = model.collect_probability_parameters()
  11. instantiator = stormpy.storage.PdtmcInstantiator(model)
  12. point = dict()
  13. for p in parameters:
  14. point[p] = 0.4
  15. instantiated_model = instantiator.instantiate(point)
  16. assert instantiated_model.nr_states == model.nr_states
  17. assert not instantiated_model.has_parameters
  18. for p in parameters:
  19. point[p] = 0.5
  20. instatiated_model2 = instantiator.instantiate(point)