From 16ecb0fc8d1a46f4dc5d7099a6fb2d3020c489ce Mon Sep 17 00:00:00 2001 From: Tim Quatmann Date: Wed, 30 Sep 2020 13:53:15 +0200 Subject: [PATCH] OVI: display current number of iterations with --progress --verbose. --- src/storm/solver/helper/OptimisticValueIterationHelper.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/storm/solver/helper/OptimisticValueIterationHelper.cpp b/src/storm/solver/helper/OptimisticValueIterationHelper.cpp index 296dd2ceb..fe5e2ddc3 100644 --- a/src/storm/solver/helper/OptimisticValueIterationHelper.cpp +++ b/src/storm/solver/helper/OptimisticValueIterationHelper.cpp @@ -3,6 +3,7 @@ #include "storm/utility/vector.h" #include "storm/utility/SignalHandler.h" #include "storm/environment/solver/OviSolverEnvironment.h" +#include "storm/utility/ProgressMeasurement.h" #include "storm/exceptions/NotSupportedException.h" @@ -260,6 +261,8 @@ namespace storm { SolverStatus status = SolverStatus::InProgress; + storm::utility::ProgressMeasurement progress("iterations."); + progress.startNewMeasurement(0); while (status == SolverStatus::InProgress && overallIterations < maxOverallIterations) { // Perform value iteration until convergence lastValueIterationIterations = dir ? iterationHelper.repeatedIterate(dir.get(), *lowerX, b, iterationPrecision, relative) : iterationHelper.repeatedIterate(*lowerX, b, iterationPrecision, relative); @@ -348,8 +351,8 @@ namespace storm { if (storm::utility::resources::isTerminate()) { status = SolverStatus::Aborted; } + progress.updateProgress(overallIterations); } // end while - // Swap the results into the output vectors (if necessary). assert(initLowerX != lowerX || (initLowerX == lowerX && initUpperX == upperX)); if (initLowerX != lowerX) {