diff --git a/lib/stormpy/storage/__init__.py b/lib/stormpy/storage/__init__.py index c68800f..2eda405 100644 --- a/lib/stormpy/storage/__init__.py +++ b/lib/stormpy/storage/__init__.py @@ -1,3 +1,15 @@ from . import storage from .storage import * from . import state,action + +class ModelInstantiator: + def __init__(self, model): + if model.model_type == ModelType.MDP: + self._instantiator = PmdpInstantiator(model) + elif model.model_type == ModelType.DTMC: + self._instantiator = PdtmcInstantiator(model) + else: + raise ValueError("Only DTMCs and MDPs supported") + + def instantiate(self, point): + return self._instantiator.instantiate(point) \ No newline at end of file diff --git a/tests/storage/test_model_instantiator.py b/tests/storage/test_model_instantiator.py index 5e7a489..fd2c4fc 100644 --- a/tests/storage/test_model_instantiator.py +++ b/tests/storage/test_model_instantiator.py @@ -9,7 +9,7 @@ class TestModel: formulas = stormpy.parse_properties_for_prism_program("P=? [ F s=5 ]", program) model = stormpy.build_parametric_model(program, formulas) parameters = model.collect_probability_parameters() - instantiator = stormpy.storage.PdtmcInstantiator(model) + instantiator = stormpy.ModelInstantiator(model) point = dict() for p in parameters: point[p] = 0.4