From 230ac204807619277381c366e5eae29bd33e647d Mon Sep 17 00:00:00 2001 From: Matthias Volk Date: Fri, 7 Dec 2018 17:02:40 +0100 Subject: [PATCH] Added progress measurements for Unif+ iterations and steps --- .../csl/helper/SparseMarkovAutomatonCslHelper.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/storm/modelchecker/csl/helper/SparseMarkovAutomatonCslHelper.cpp b/src/storm/modelchecker/csl/helper/SparseMarkovAutomatonCslHelper.cpp index 32e95fd36..ccc0cc324 100644 --- a/src/storm/modelchecker/csl/helper/SparseMarkovAutomatonCslHelper.cpp +++ b/src/storm/modelchecker/csl/helper/SparseMarkovAutomatonCslHelper.cpp @@ -327,6 +327,9 @@ namespace storm { ValueType maxNorm = storm::utility::zero(); // Maximal step size uint64_t N; + storm::utility::ProgressMeasurement progressIterations("iterations"); + size_t iteration = 0; + progressIterations.startNewMeasurement(iteration); // Loop until result is within precision bound. do { // (2) update parameter @@ -379,6 +382,9 @@ namespace storm { // Iteration k = N was already performed by initializing with zeros. // Iterations k < N + storm::utility::ProgressMeasurement progressSteps("steps in iteration " + std::to_string(iteration)); + progressSteps.setMaxCount(N); + progressSteps.startNewMeasurement(0); for (int64_t k = N-1; k >= 0; --k) { if (k < (int64_t)(N-1)) { unifVectors.prepareNewIteration(); @@ -394,7 +400,7 @@ namespace storm { unifVectors.resUpper[state] += foxGlynnResult.weights[index - foxGlynnResult.left] * unifVectors.wUpperNew[state]; } } - + progressSteps.updateProgress(N-k); } // Only iterate over result vector, as the results can only get more precise. @@ -407,7 +413,7 @@ namespace storm { // (6) Double lambda. lambda *= 2; STORM_LOG_DEBUG("Increased lambda to " << lambda << ", max diff is " << maxNorm << "."); - + progressIterations.updateProgress(++iteration); } while (maxNorm > epsilon * (1 - kappa)); return unifVectors.resLowerNew;