From 3c5f25fe4a960575137859629d8596cefce37772 Mon Sep 17 00:00:00 2001 From: Matthias Volk Date: Fri, 15 Feb 2019 16:57:23 +0100 Subject: [PATCH] Get all model parameters --- src/storm/models/sparse/Model.cpp | 9 ++++++++- src/storm/models/sparse/Model.h | 20 +++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/storm/models/sparse/Model.cpp b/src/storm/models/sparse/Model.cpp index d97686f12..66da51770 100644 --- a/src/storm/models/sparse/Model.cpp +++ b/src/storm/models/sparse/Model.cpp @@ -473,8 +473,15 @@ namespace storm { } return result; } + + std::set getAllParameters(Model const& model) { + std::set parameters = getProbabilityParameters(model); + std::set rewardParameters = getRewardParameters(model); + parameters.insert(rewardParameters.begin(), rewardParameters.end()); + return parameters; + } #endif - + template class Model; template class Model; diff --git a/src/storm/models/sparse/Model.h b/src/storm/models/sparse/Model.h index cc2fd3779..4e1d91b0a 100644 --- a/src/storm/models/sparse/Model.h +++ b/src/storm/models/sparse/Model.h @@ -419,10 +419,28 @@ namespace storm { boost::optional> choiceOrigins; }; - + #ifdef STORM_HAVE_CARL + /*! + * Get all probability parameters occurring on transitions. + * @param model Model. + * @return Set of parameters. + */ std::set getProbabilityParameters(Model const& model); + + /*! + * Get all parameters occurring in rewards. + * @param model Model. + * @return Set of parameters. + */ std::set getRewardParameters(Model const& model); + + /*! + * Get all parameters (probability and rewards) occurring in the model. + * @param model Model. + * @return Set of parameters. + */ + std::set getAllParameters(Model const& model); #endif } // namespace sparse } // namespace models