From bc3c0d1d552f62f02bde5b738350f3a037a77bf7 Mon Sep 17 00:00:00 2001 From: TimQu Date: Fri, 5 Apr 2019 16:31:04 +0200 Subject: [PATCH] ModelBase: added isDiscreteTimeModel(). and let isNondeterministicModel return true for POMDPs and PSGs. --- src/storm/models/ModelBase.cpp | 16 +++++++++++++++- src/storm/models/ModelBase.h | 5 +++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/storm/models/ModelBase.cpp b/src/storm/models/ModelBase.cpp index f73ba1bce..7bf753ab8 100644 --- a/src/storm/models/ModelBase.cpp +++ b/src/storm/models/ModelBase.cpp @@ -19,7 +19,21 @@ namespace storm { } bool ModelBase::isNondeterministicModel() const { - return this->isOfType(storm::models::ModelType::Mdp) || this->isOfType(storm::models::ModelType::MarkovAutomaton); + for (auto const& type : {storm::models::ModelType::Mdp, storm::models::ModelType::Pomdp, storm::models::ModelType::S2pg, storm::models::ModelType::MarkovAutomaton}) { + if (this->isOfType(type)) { + return true; + } + } + return false; + } + + bool ModelBase::isDiscreteTimeModel() const { + for (auto const& type : {storm::models::ModelType::Dtmc, storm::models::ModelType::Mdp, storm::models::ModelType::Pomdp, storm::models::ModelType::S2pg}) { + if (this->isOfType(type)) { + return true; + } + } + return false; } bool ModelBase::supportsParameters() const { diff --git a/src/storm/models/ModelBase.h b/src/storm/models/ModelBase.h index 77fa5b60d..ca275ed92 100644 --- a/src/storm/models/ModelBase.h +++ b/src/storm/models/ModelBase.h @@ -115,6 +115,11 @@ namespace storm { */ bool isNondeterministicModel() const; + /*! + * Returns true if the model is a descrete-time model. + */ + bool isDiscreteTimeModel() const; + /*! * Checks whether the model supports parameters. *