Browse Source

enabled switching of methods if unsupported method chosen in symbolic min-max equation solver

tempestpy_adaptions
dehnert 6 years ago
parent
commit
a46e6439eb
  1. 4
      src/storm/solver/GmmxxLinearEquationSolver.cpp
  2. 5
      src/storm/solver/SymbolicMinMaxLinearEquationSolver.cpp

4
src/storm/solver/GmmxxLinearEquationSolver.cpp

@ -103,10 +103,10 @@ namespace storm {
// Check if the solver converged and issue a warning otherwise.
if (iter.converged()) {
STORM_LOG_INFO("Iterative solver converged after " << iter.get_iteration() << " iterations.");
STORM_LOG_INFO("Iterative solver converged after " << iter.get_iteration() << " iteration(s).");
return true;
} else {
STORM_LOG_WARN("Iterative solver did not converge.");
STORM_LOG_WARN("Iterative solver did not converge within " << iter.get_iteration() << " iteration(s).");
return false;
}
}

5
src/storm/solver/SymbolicMinMaxLinearEquationSolver.cpp

@ -40,7 +40,10 @@ namespace storm {
STORM_LOG_WARN("The selected solution method does not guarantee exact results.");
}
}
STORM_LOG_THROW(method == MinMaxMethod::ValueIteration || method == MinMaxMethod::PolicyIteration || method == MinMaxMethod::RationalSearch, storm::exceptions::InvalidEnvironmentException, "This solver does not support the selected method.");
if (method != MinMaxMethod::ValueIteration && method != MinMaxMethod::PolicyIteration && method != MinMaxMethod::RationalSearch) {
STORM_LOG_WARN("Selected method is not supported for this solver, switching to value iteration.");
method = MinMaxMethod::ValueIteration;
}
return method;
}

Loading…
Cancel
Save