From 78cfb10c7e75f2945dbd6199012b1d2d7d004c48 Mon Sep 17 00:00:00 2001 From: TimQu Date: Tue, 16 Jan 2018 15:20:43 +0100 Subject: [PATCH] fixed qvi with negative rewards --- src/storm/solver/IterativeMinMaxLinearEquationSolver.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/storm/solver/IterativeMinMaxLinearEquationSolver.cpp b/src/storm/solver/IterativeMinMaxLinearEquationSolver.cpp index 25e6e037d..71708a86c 100644 --- a/src/storm/solver/IterativeMinMaxLinearEquationSolver.cpp +++ b/src/storm/solver/IterativeMinMaxLinearEquationSolver.cpp @@ -626,11 +626,13 @@ namespace storm { void setLowerBound(ValueType const& value) { hasLowerBound = true; lowerBound = value; + // std::cout << "Lower bound set to " << lowerBound << std::endl; } void setUpperBound(ValueType const& value) { hasUpperBound = true; upperBound = value; + // std::cout << "Upper bound set to " << upperBound << std::endl; } template @@ -800,7 +802,7 @@ namespace storm { } bool isPreciseEnough(ValueType const& xi, ValueType const& yi, ValueType const& lb, ValueType const& ub) { - return yi * (ub - lb) <= (relative ? (precision * xi) : (precision * storm::utility::convertNumber(2.0))); + return yi * (ub - lb) <= storm::utility::abs((relative ? (precision * xi) : (precision * storm::utility::convertNumber(2.0)))); } template @@ -808,6 +810,7 @@ namespace storm { if (convergencePhase1) { if (checkConvergencePhase1()) { + STORM_LOG_INFO("Quick Value Iteration took " << iterations << " iterations for first convergence phase."); firstIndexViolatingConvergence = 0; if (relevantValues != nullptr) { firstIndexViolatingConvergence = relevantValues->getNextSetIndex(firstIndexViolatingConvergence);