From aad97116e0ec3ab238f7d4439b35c62385dc862b Mon Sep 17 00:00:00 2001 From: sjunges Date: Tue, 26 Jan 2016 23:04:06 +0100 Subject: [PATCH] overwrite build model by some method which applies the downcast directly Former-commit-id: f796834082775b53dc87156e7d124ab75974a36a --- stormpy/core/__init__.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/stormpy/core/__init__.py b/stormpy/core/__init__.py index ab88a96bd..977c7f2c8 100644 --- a/stormpy/core/__init__.py +++ b/stormpy/core/__init__.py @@ -1 +1,20 @@ -from stormpy.core._core import * \ No newline at end of file +from stormpy.core._core import * + +def _build_model(program, formulae): + intermediate = _core.build_model(program, formulae) + if intermediate.parametric: + if intermediate.model_type == ModelType.DTMC: + return intermediate.as_pdtmc() + elif intermediate.model_type == ModelType.MDP: + return intermediate.as_pmdp() + else: + raise RuntimeError("Not supported parametric model constructed") + else: + if intermediate.model_type == ModelType.DTMC: + return intermediate.as_pdtmc() + elif intermediate.model_type == ModelType.MDP: + return intermediate.as_pmdp() + else: + raise RuntimeError("Not supported non-parametric model constructed") + +build_model = _build_model \ No newline at end of file