From f46e8bcccf1949f5f49244e43c6071e8c5b3a25c Mon Sep 17 00:00:00 2001 From: TimQu Date: Thu, 3 Aug 2017 16:22:47 +0200 Subject: [PATCH] fixed selecting LPMinMaxSolver in --exact mode --- src/storm/solver/MinMaxLinearEquationSolver.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/storm/solver/MinMaxLinearEquationSolver.cpp b/src/storm/solver/MinMaxLinearEquationSolver.cpp index 874010c6d..180f91cf8 100644 --- a/src/storm/solver/MinMaxLinearEquationSolver.cpp +++ b/src/storm/solver/MinMaxLinearEquationSolver.cpp @@ -211,10 +211,16 @@ namespace storm { std::unique_ptr> GeneralMinMaxLinearEquationSolverFactory::selectSolver(MatrixType&& matrix) const { std::unique_ptr> result; auto method = this->getMinMaxMethod(); - STORM_LOG_THROW(method == MinMaxMethod::ValueIteration || method == MinMaxMethod::PolicyIteration || method == MinMaxMethod::Acyclic, storm::exceptions::InvalidSettingsException, "For this data type only value iteration, policy iteration, and acyclic value iteration are available."); - IterativeMinMaxLinearEquationSolverSettings iterativeSolverSettings; - iterativeSolverSettings.setSolutionMethod(method); - return std::make_unique>(std::forward(matrix), std::make_unique>(), iterativeSolverSettings); + if (method == MinMaxMethod::ValueIteration || method == MinMaxMethod::PolicyIteration || method == MinMaxMethod::Acyclic) { + IterativeMinMaxLinearEquationSolverSettings iterativeSolverSettings; + iterativeSolverSettings.setSolutionMethod(method); + result = std::make_unique>(std::forward(matrix), std::make_unique>(), iterativeSolverSettings); + } else if (method == MinMaxMethod::LinearProgramming) { + result = std::make_unique>(std::forward(matrix), std::make_unique>(), std::make_unique>()); + } else { + STORM_LOG_THROW(false, storm::exceptions::InvalidSettingsException, "The selected method is not available for this data type."); + } + return result; } #endif template class MinMaxLinearEquationSolver;