From 9b9bbe2a68b5d42b18df3a93075f13a84fe55020 Mon Sep 17 00:00:00 2001 From: sjunges Date: Tue, 26 Jan 2016 23:04:43 +0100 Subject: [PATCH] added isParametric to models Former-commit-id: dc2189b013464250cb05ba8294171653038d3100 --- src/models/ModelBase.cpp | 4 ++++ src/models/ModelBase.h | 5 +++++ src/models/sparse/Model.cpp | 7 +++++++ src/models/sparse/Model.h | 1 + 4 files changed, 17 insertions(+) diff --git a/src/models/ModelBase.cpp b/src/models/ModelBase.cpp index b79d7a81f..00a566b9b 100644 --- a/src/models/ModelBase.cpp +++ b/src/models/ModelBase.cpp @@ -17,5 +17,9 @@ namespace storm { bool ModelBase::isOfType(storm::models::ModelType const& modelType) const { return this->getType() == modelType; } + + bool ModelBase::isParametric() const { + return false; + } } } \ No newline at end of file diff --git a/src/models/ModelBase.h b/src/models/ModelBase.h index d118e1516..9fd80171a 100644 --- a/src/models/ModelBase.h +++ b/src/models/ModelBase.h @@ -97,6 +97,11 @@ namespace storm { */ bool isOfType(storm::models::ModelType const& modelType) const; + /*! + * Checks whether the model is parametric + */ + virtual bool isParametric() const; + private: // The type of the model. ModelType modelType; diff --git a/src/models/sparse/Model.cpp b/src/models/sparse/Model.cpp index e30965998..f0cf38e1c 100644 --- a/src/models/sparse/Model.cpp +++ b/src/models/sparse/Model.cpp @@ -310,6 +310,11 @@ namespace storm { return true; } + template + bool Model::isParametric() const { + return std::is_same::value; + } + template std::unordered_map& Model::getRewardModels() { return this->rewardModels; @@ -319,6 +324,8 @@ namespace storm { std::unordered_map const& Model::getRewardModels() const { return this->rewardModels; } + + std::set getProbabilityParameters(Model const& model) { return storm::storage::getVariables(model.getTransitionMatrix()); diff --git a/src/models/sparse/Model.h b/src/models/sparse/Model.h index 7d36ebca3..dc0378348 100644 --- a/src/models/sparse/Model.h +++ b/src/models/sparse/Model.h @@ -278,6 +278,7 @@ namespace storm { virtual bool isSparseModel() const override; + virtual bool isParametric() const override; protected: RewardModelType & rewardModel(std::string const& rewardModelName);