From d53ca206b3622859a50ec27a84a19a71abd02517 Mon Sep 17 00:00:00 2001 From: Matthias Volk Date: Wed, 4 Apr 2018 00:11:25 +0200 Subject: [PATCH] Binding for transient probabilities --- src/core/modelchecking.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/core/modelchecking.cpp b/src/core/modelchecking.cpp index 703e53c..d2325a5 100644 --- a/src/core/modelchecking.cpp +++ b/src/core/modelchecking.cpp @@ -1,5 +1,7 @@ #include "modelchecking.h" -#include "result.h" +#include "storm/api/storm.h" +#include "storm/environment/Environment.h" +#include "storm/modelchecker/csl/helper/SparseCtmcCslHelper.h" template using CheckTask = storm::modelchecker::CheckTask; @@ -10,6 +12,12 @@ std::shared_ptr modelCheckingSparseEngine(std: return storm::api::verifyWithSparseEngine(model, task); } + +std::vector computeTransientProbabilities(storm::Environment const& env, std::shared_ptr> ctmc, storm::storage::BitVector const& phiStates, storm::storage::BitVector const& psiStates, double timeBound) { + return storm::modelchecker::helper::SparseCtmcCslHelper::computeAllTransientProbabilities(env, ctmc->getTransitionMatrix(), ctmc->getBackwardTransitions(), ctmc->getInitialStates(), phiStates, psiStates, ctmc->getExitRateVector(), timeBound); +} + + // Thin wrapper for computing prob01 states template std::pair computeProb01(storm::models::sparse::Dtmc const& model, storm::storage::BitVector const& phiStates, storm::storage::BitVector const& psiStates) { @@ -44,6 +52,7 @@ void define_modelchecking(py::module& m) { // Model checking m.def("_model_checking_sparse_engine", &modelCheckingSparseEngine, "Perform model checking", py::arg("model"), py::arg("task")); m.def("_parametric_model_checking_sparse_engine", &modelCheckingSparseEngine, "Perform parametric model checking", py::arg("model"), py::arg("task")); + m.def("compute_transient_probabilities", &computeTransientProbabilities, "Compute transient probabilities"); m.def("_compute_prob01states_double", &computeProb01, "Compute prob-0-1 states", py::arg("model"), py::arg("phi_states"), py::arg("psi_states")); m.def("_compute_prob01states_rationalfunc", &computeProb01, "Compute prob-0-1 states", py::arg("model"), py::arg("phi_states"), py::arg("psi_states")); m.def("_compute_prob01states_min_double", &computeProb01min, "Compute prob-0-1 states (min)", py::arg("model"), py::arg("phi_states"), py::arg("psi_states"));