From f2294fadb0f211ff93b4cf33808cfcb52990370e Mon Sep 17 00:00:00 2001 From: TimQu Date: Tue, 27 Jun 2017 16:08:02 +0200 Subject: [PATCH] fixed compiling storm-pars cli and improved output a little --- src/storm-pars-cli/storm-pars.cpp | 4 ++-- ...ValidatingSparseParameterLiftingModelChecker.cpp | 2 +- .../modelchecker/results/RegionCheckResult.cpp | 13 +++++++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/storm-pars-cli/storm-pars.cpp b/src/storm-pars-cli/storm-pars.cpp index 6fb83ad26..eba86792d 100644 --- a/src/storm-pars-cli/storm-pars.cpp +++ b/src/storm-pars-cli/storm-pars.cpp @@ -137,7 +137,7 @@ namespace storm { template void printInitialStatesResult(std::unique_ptr const& result, storm::jani::Property const& property, storm::utility::Stopwatch* watch = nullptr) { if (result) { - STORM_PRINT_AND_LOG("Result (initial states): "); + STORM_PRINT_AND_LOG("Result (initial states): " << std::endl); auto const* regionCheckResult = dynamic_cast const*>(result.get()); if (regionCheckResult != nullptr) { @@ -184,7 +184,7 @@ namespace storm { verifyProperties(input.properties, [&model] (std::shared_ptr const& formula) { std::unique_ptr result = storm::api::verifyWithSparseEngine(model, storm::api::createTask(formula, true)); - result->filter(storm::modelchecker::ExplicitQualitativeCheckResult(simplificationResult.first->getInitialStates())); + result->filter(storm::modelchecker::ExplicitQualitativeCheckResult(model->getInitialStates())); return result; }, [&model] (std::unique_ptr const& result) { diff --git a/src/storm-pars/modelchecker/region/ValidatingSparseParameterLiftingModelChecker.cpp b/src/storm-pars/modelchecker/region/ValidatingSparseParameterLiftingModelChecker.cpp index 447bcd27e..d3dabab63 100644 --- a/src/storm-pars/modelchecker/region/ValidatingSparseParameterLiftingModelChecker.cpp +++ b/src/storm-pars/modelchecker/region/ValidatingSparseParameterLiftingModelChecker.cpp @@ -18,7 +18,7 @@ namespace storm { template ValidatingSparseParameterLiftingModelChecker::~ValidatingSparseParameterLiftingModelChecker() { if (storm::settings::getModule().isShowStatisticsSet()) { - STORM_PRINT_AND_LOG("Validating Parameter Lifting Model Checker detected " << numOfWrongRegions << " regions where the imprecise method was wrong."); + STORM_PRINT_AND_LOG("Validating Parameter Lifting Model Checker detected " << numOfWrongRegions << " regions where the imprecise method was wrong." << std::endl); } } diff --git a/src/storm-pars/modelchecker/results/RegionCheckResult.cpp b/src/storm-pars/modelchecker/results/RegionCheckResult.cpp index b561a67ab..2759034e9 100644 --- a/src/storm-pars/modelchecker/results/RegionCheckResult.cpp +++ b/src/storm-pars/modelchecker/results/RegionCheckResult.cpp @@ -59,16 +59,19 @@ namespace storm { for (auto const& res : this->regionResults) { out << res.first.toString() << ": \t" << res.second << std::endl; } + return out; } template std::ostream& RegionCheckResult::writeCondensedToStream(std::ostream& out) const { + double satPercent = storm::utility::convertNumber(satFraction) * 100.0; + double unsatPercent = storm::utility::convertNumber(unsatFraction) * 100.0; auto oneHundred = storm::utility::convertNumber::CoefficientType>(100.0); auto one = storm::utility::convertNumber::CoefficientType>(1.0); - out << "Fraction of satisfied area: " << (satFraction * oneHundred) << std::endl; - out << "Fraction of unsatisfied area: " << (unsatFraction * oneHundred) << std::endl; - out << "Unknown fraction: " << ((one - satFraction - unsatFraction) * oneHundred) << std::endl; - out << "Total Number of regions: " << regionResults.size() << std::endl; + out << " Fraction of satisfied area: " << satPercent << "%" << std::endl; + out << "Fraction of unsatisfied area: " << unsatPercent << "%" << std::endl; + out << " Unknown fraction: " << (100.0 - satPercent - unsatPercent) << "%" << std::endl; + out << " Total number of regions: " << regionResults.size() << std::endl; std::map counters; for (auto const& res : this->regionResults) { ++counters[res.second]; @@ -76,11 +79,13 @@ namespace storm { for (auto const& counter : counters) { out << std::setw(28) << counter.first << ": " << counter.second << std::endl; } + return out; } template std::ostream& RegionCheckResult::writeIllustrationToStream(std::ostream& out) const { STORM_LOG_WARN("Writing illustration of region check result to a stream is not implemented."); + return out; } template