Matthias Volk
7 years ago
4 changed files with 57 additions and 50 deletions
-
16tests/core/test_modelchecking.py
-
16tests/pars/test_parametric.py
-
41tests/pars/test_parametric_model.py
-
34tests/storage/test_model.py
@ -0,0 +1,41 @@ |
|||
import stormpy |
|||
import stormpy.info |
|||
import stormpy.logic |
|||
from helpers.helper import get_example_path |
|||
|
|||
from configurations import pars |
|||
|
|||
|
|||
@pars |
|||
class TestParametricModel: |
|||
def test_build_parametric_dtmc(self): |
|||
program = stormpy.parse_prism_program(get_example_path("pdtmc", "brp16_2.pm")) |
|||
formulas = stormpy.parse_properties_for_prism_program("P=? [ F s=5 ]", program) |
|||
model = stormpy.build_parametric_model(program, formulas) |
|||
assert model.nr_states == 613 |
|||
assert model.nr_transitions == 803 |
|||
assert model.model_type == stormpy.ModelType.DTMC |
|||
assert model.supports_parameters |
|||
assert model.has_parameters |
|||
assert type(model) is stormpy.SparseParametricDtmc |
|||
|
|||
def test_build_dtmc_supporting_parameters(self): |
|||
program = stormpy.parse_prism_program(get_example_path("dtmc", "die.pm")) |
|||
formulas = stormpy.parse_properties_for_prism_program("P=? [ F \"one\" ]", program) |
|||
model = stormpy.build_parametric_model(program, formulas) |
|||
assert model.nr_states == 13 |
|||
assert model.nr_transitions == 20 |
|||
assert model.model_type == stormpy.ModelType.DTMC |
|||
assert model.supports_parameters |
|||
assert not model.has_parameters |
|||
assert type(model) is stormpy.SparseParametricDtmc |
|||
|
|||
def test_build_parametric_mdp(self): |
|||
program = stormpy.parse_prism_program(get_example_path("pmdp", "two_dice.nm")) |
|||
formulas = stormpy.parse_properties_for_prism_program("P=? [ F \"two\" ]", program) |
|||
model = stormpy.build_parametric_model(program, formulas) |
|||
assert model.nr_states == 169 |
|||
assert model.nr_transitions == 435 |
|||
assert model.model_type == stormpy.ModelType.MDP |
|||
assert model.supports_parameters |
|||
assert type(model) is stormpy.SparseParametricMdp |
Write
Preview
Loading…
Cancel
Save
Reference in new issue