diff --git a/src/modelchecker/region/SamplingModel.cpp b/src/modelchecker/region/SamplingModel.cpp index 9539c2bde..2df9c63fd 100644 --- a/src/modelchecker/region/SamplingModel.cpp +++ b/src/modelchecker/region/SamplingModel.cpp @@ -252,6 +252,10 @@ namespace storm { template<> void SamplingModel, double>::invokeSolver(){ std::unique_ptr> solver = storm::solver::configureMinMaxLinearEquationSolver(this->solveGoal, storm::utility::solver::MinMaxLinearEquationSolverFactory(), this->matrixData.matrix); + if(!this->solveGoal.minimize()){ + //The value iteration method is not correct if the value is maximized and the initial x-vector is not <= the actual probability/reward. + this->eqSysResult.assign(this->eqSysResult.size(), storm::utility::zero()); + } solver->solveEquationSystem(this->eqSysResult, this->vectorData.vector); }