From 174058bb5e39dbbdfc70185930ee9795d7e86356 Mon Sep 17 00:00:00 2001 From: Mavo Date: Wed, 2 Mar 2016 11:53:41 +0100 Subject: [PATCH] Do not destroy the universe by dividing by 0 Former-commit-id: bd784f7adeca0f114e80da3870857bd14c24a8b6 --- src/modelchecker/csl/helper/SparseCtmcCslHelper.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modelchecker/csl/helper/SparseCtmcCslHelper.cpp b/src/modelchecker/csl/helper/SparseCtmcCslHelper.cpp index 3ffe7bbe8..18a56f5ab 100644 --- a/src/modelchecker/csl/helper/SparseCtmcCslHelper.cpp +++ b/src/modelchecker/csl/helper/SparseCtmcCslHelper.cpp @@ -663,8 +663,8 @@ namespace storm { // Initialize rewards. std::vector totalRewardVector; for (size_t i = 0; i < exitRateVector.size(); ++i) { - if (targetStates[i]) { - // Set reward for target states to 0. + if (targetStates[i] || storm::utility::isZero(exitRateVector[i])) { + // Set reward for target states or states without outgoing transitions to 0. totalRewardVector.push_back(storm::utility::zero()); } else { // Reward is (1 / exitRate). @@ -685,8 +685,8 @@ namespace storm { // Initialize rewards. std::vector totalRewardVector; for (size_t i = 0; i < exitRateVector.size(); ++i) { - if (targetStates[i]) { - // Set reward for target states to 0. + if (targetStates[i] || storm::utility::isZero(exitRateVector[i])) { + // Set reward for target states or states without outgoing transitions to 0. totalRewardVector.push_back(storm::utility::zero()); } else { // Reward is (1 / exitRate).