Browse Source

Added progress measurements for Unif+ iterations and steps

tempestpy_adaptions
Matthias Volk 6 years ago
parent
commit
230ac20480
  1. 10
      src/storm/modelchecker/csl/helper/SparseMarkovAutomatonCslHelper.cpp

10
src/storm/modelchecker/csl/helper/SparseMarkovAutomatonCslHelper.cpp

@ -327,6 +327,9 @@ namespace storm {
ValueType maxNorm = storm::utility::zero<ValueType>(); ValueType maxNorm = storm::utility::zero<ValueType>();
// Maximal step size // Maximal step size
uint64_t N; uint64_t N;
storm::utility::ProgressMeasurement progressIterations("iterations");
size_t iteration = 0;
progressIterations.startNewMeasurement(iteration);
// Loop until result is within precision bound. // Loop until result is within precision bound.
do { do {
// (2) update parameter // (2) update parameter
@ -379,6 +382,9 @@ namespace storm {
// Iteration k = N was already performed by initializing with zeros. // Iteration k = N was already performed by initializing with zeros.
// Iterations k < N // 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) { for (int64_t k = N-1; k >= 0; --k) {
if (k < (int64_t)(N-1)) { if (k < (int64_t)(N-1)) {
unifVectors.prepareNewIteration(); unifVectors.prepareNewIteration();
@ -394,7 +400,7 @@ namespace storm {
unifVectors.resUpper[state] += foxGlynnResult.weights[index - foxGlynnResult.left] * unifVectors.wUpperNew[state]; 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. // Only iterate over result vector, as the results can only get more precise.
@ -407,7 +413,7 @@ namespace storm {
// (6) Double lambda. // (6) Double lambda.
lambda *= 2; lambda *= 2;
STORM_LOG_DEBUG("Increased lambda to " << lambda << ", max diff is " << maxNorm << "."); STORM_LOG_DEBUG("Increased lambda to " << lambda << ", max diff is " << maxNorm << ".");
progressIterations.updateProgress(++iteration);
} while (maxNorm > epsilon * (1 - kappa)); } while (maxNorm > epsilon * (1 - kappa));
return unifVectors.resLowerNew; return unifVectors.resLowerNew;

Loading…
Cancel
Save