From d02c918f6a89f74e1234bc27e575dd7105de99a1 Mon Sep 17 00:00:00 2001 From: TimQu Date: Fri, 1 Jul 2016 11:11:16 +0200 Subject: [PATCH] forgot a little something... Former-commit-id: dc5b68bdb61e94cd36dc570200e0d30c58689bfd --- src/models/sparse/StandardRewardModel.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/models/sparse/StandardRewardModel.cpp b/src/models/sparse/StandardRewardModel.cpp index c8fd2aa8f..823d3a884 100644 --- a/src/models/sparse/StandardRewardModel.cpp +++ b/src/models/sparse/StandardRewardModel.cpp @@ -248,7 +248,13 @@ namespace storm { if(hasStateRewards() && !std::all_of(getStateRewardVector().begin(), getStateRewardVector().end(), storm::utility::isZero)) { return false; } - return !(static_cast(this->optionalStateRewardVector) || static_cast(this->optionalStateActionRewardVector) || static_cast(this->optionalTransitionRewardMatrix)); + if(hasStateActionRewards() && !std::all_of(getStateActionRewardVector().begin(), getStateActionRewardVector().end(), storm::utility::isZero)) { + return false; + } + if(hasTransitionRewards() && !std::all_of(getTransitionRewardMatrix().begin(), getTransitionRewardMatrix().end(), [](storm::storage::MatrixEntry entry){ return storm::utility::isZero(entry.getValue()); })) { + return false; + } + return true; }