TimQu
7 years ago
6 changed files with 221 additions and 33 deletions
-
11src/storm/modelchecker/multiobjective/pcaa/SparseMdpRewardBoundedPcaaWeightVectorChecker.cpp
-
7src/storm/modelchecker/prctl/helper/SparseMdpPrctlHelper.cpp
-
32src/storm/solver/AbstractEquationSolver.cpp
-
13src/storm/solver/AbstractEquationSolver.h
-
84src/storm/utility/ProgressMeasurement.cpp
-
107src/storm/utility/ProgressMeasurement.h
@ -16,9 +16,9 @@ namespace storm { |
|||
|
|||
template<typename ValueType> |
|||
AbstractEquationSolver<ValueType>::AbstractEquationSolver() { |
|||
auto const& generalSettings = storm::settings::getModule<storm::settings::modules::GeneralSettings>(); |
|||
showProgressFlag = generalSettings.isVerboseSet(); |
|||
showProgressDelay = generalSettings.getShowProgressDelay(); |
|||
if (storm::settings::getModule<storm::settings::modules::GeneralSettings>().isVerboseSet()) { |
|||
this->progressMeasurement = storm::utility::ProgressMeasurement("iterations"); |
|||
} |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
@ -203,35 +203,29 @@ namespace storm { |
|||
|
|||
template<typename ValueType> |
|||
bool AbstractEquationSolver<ValueType>::isShowProgressSet() const { |
|||
return showProgressFlag; |
|||
return this->progressMeasurement.is_initialized(); |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
uint64_t AbstractEquationSolver<ValueType>::getShowProgressDelay() const { |
|||
return showProgressDelay; |
|||
STORM_LOG_ASSERT(this->isShowProgressSet(), "Tried to get the progress message delay but progress is not shown."); |
|||
return this->progressMeasurement->getShowProgressDelay(); |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
void AbstractEquationSolver<ValueType>::startMeasureProgress(uint64_t startingIteration) const { |
|||
timeOfStart = std::chrono::high_resolution_clock::now(); |
|||
timeOfLastMessage = timeOfStart; |
|||
iterationOfLastMessage = startingIteration; |
|||
if (this->isShowProgressSet()) { |
|||
this->progressMeasurement->startNewMeasurement(startingIteration); |
|||
} |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
void AbstractEquationSolver<ValueType>::showProgressIterative(uint64_t iteration, boost::optional<uint64_t> const& bound) const { |
|||
if (this->isShowProgressSet()) { |
|||
auto now = std::chrono::high_resolution_clock::now(); |
|||
auto durationSinceLastMessage = static_cast<uint64_t>(std::chrono::duration_cast<std::chrono::seconds>(now - timeOfLastMessage).count()); |
|||
if (durationSinceLastMessage >= this->getShowProgressDelay()) { |
|||
uint64_t numberOfIterationsSinceLastMessage = iteration - iterationOfLastMessage; |
|||
STORM_LOG_INFO("Completed " << iteration << " iterations " |
|||
<< (bound ? "(out of " + std::to_string(bound.get()) + ") " : "") |
|||
<< "in " << std::chrono::duration_cast<std::chrono::seconds>(now - timeOfStart).count() << "s (currently " << (static_cast<double>(numberOfIterationsSinceLastMessage) / durationSinceLastMessage) << " per second)." |
|||
); |
|||
timeOfLastMessage = std::chrono::high_resolution_clock::now(); |
|||
iterationOfLastMessage = iteration; |
|||
if (bound) { |
|||
this->progressMeasurement->setMaxCount(bound.get()); |
|||
} |
|||
this->progressMeasurement->updateProgress(iteration); |
dehnert
913aa83dbc
Former-commit-id:
|
10 years ago | |
---|---|---|
.. | ||
3rdparty | Removed ltl2dstar. | 10 years ago |
cmake | Merge branch 'master' into cuda_integration | 10 years ago |
BUILD.txt | Updated build instructions with list of tested compilers and some new dependencies, but it still looks partially outdated. | 10 years ago |
GUIDELINES-Doxygen.example.h | Added temporary Find* files for CMake | 13 years ago |
GUIDELINES.txt | Renaming MRMC to STORM, see #42 | 12 years ago |
Google C++ Style Guide.pdf | Updated styleguides | 13 years ago |
Google C++ Testing Framework.pdf | Updated styleguides | 13 years ago |