Browse Source

Topological solvers: Added a warning for numerical issues triggered in cases where in non-exact mode a selfloop probability is very close to 1 but not equal to 1

tempestpy_adaptions
Tim Quatmann 4 years ago
parent
commit
94311e7d30
  1. 11
      src/storm/solver/TopologicalLinearEquationSolver.cpp
  2. 1
      src/storm/solver/TopologicalMinMaxLinearEquationSolver.cpp

11
src/storm/solver/TopologicalLinearEquationSolver.cpp

@ -144,11 +144,12 @@ namespace storm {
} }
if (hasDiagonalEntry) { if (hasDiagonalEntry) {
if (storm::utility::isZero(denominator)) {
STORM_LOG_THROW(storm::utility::isZero(xi), storm::exceptions::InvalidOperationException, "The equation system has no solution.");
} else {
xi /= denominator;
}
STORM_LOG_WARN_COND_DEBUG(storm::NumberTraits<ValueType>::IsExact || !storm::utility::isAlmostZero(denominator) || storm::utility::isZero(denominator), "State " << sccState << " has a selfloop with probability '1-(" << denominator << ")'. This could be an indication for numerical issues.");
if (storm::utility::isZero(denominator)) {
STORM_LOG_THROW(storm::utility::isZero(xi), storm::exceptions::InvalidOperationException, "The equation system has no solution.");
} else {
xi /= denominator;
}
} }
return true; return true;
} }

1
src/storm/solver/TopologicalMinMaxLinearEquationSolver.cpp

@ -155,6 +155,7 @@ namespace storm {
} }
} }
if (hasDiagonalEntry) { if (hasDiagonalEntry) {
STORM_LOG_WARN_COND_DEBUG(storm::NumberTraits<ValueType>::IsExact || !storm::utility::isAlmostZero(denominator) || storm::utility::isZero(denominator), "State " << sccState << " has a selfloop with probability '1-(" << denominator << ")'. This could be an indication for numerical issues.");
if (storm::utility::isZero(denominator)) { if (storm::utility::isZero(denominator)) {
// In this case we have a selfloop on this state. This can never an optimal choice: // In this case we have a selfloop on this state. This can never an optimal choice:
// When minimizing, we are looking for the largest fixpoint (which will never be attained by this action) // When minimizing, we are looking for the largest fixpoint (which will never be attained by this action)

Loading…
Cancel
Save