|
|
@ -13,6 +13,8 @@ |
|
|
|
#include "storm/modelchecker/prctl/helper/SparseDtmcPrctlHelper.h"
|
|
|
|
#include "storm/modelchecker/csl/helper/SparseCtmcCslHelper.h"
|
|
|
|
#include "storm/modelchecker/prctl/helper/rewardbounded/QuantileHelper.h"
|
|
|
|
#include "storm/modelchecker/helper/infinitehorizon/SparseDeterministicInfiniteHorizonHelper.h"
|
|
|
|
#include "storm/modelchecker/helper/utility/SetInformationFromCheckTask.h"
|
|
|
|
|
|
|
|
#include "storm/logic/FragmentSpecification.h"
|
|
|
|
|
|
|
@ -166,18 +168,25 @@ namespace storm { |
|
|
|
|
|
|
|
template<typename SparseDtmcModelType> |
|
|
|
std::unique_ptr<CheckResult> SparseDtmcPrctlModelChecker<SparseDtmcModelType>::computeLongRunAverageProbabilities(Environment const& env, CheckTask<storm::logic::StateFormula, ValueType> const& checkTask) { |
|
|
|
|
|
|
|
storm::logic::StateFormula const& stateFormula = checkTask.getFormula(); |
|
|
|
std::unique_ptr<CheckResult> subResultPointer = this->check(env, stateFormula); |
|
|
|
ExplicitQualitativeCheckResult const& subResult = subResultPointer->asExplicitQualitativeCheckResult(); |
|
|
|
std::vector<ValueType> numericResult = storm::modelchecker::helper::SparseCtmcCslHelper::computeLongRunAverageProbabilities<ValueType>(env, storm::solver::SolveGoal<ValueType>(this->getModel(), checkTask), this->getModel().getTransitionMatrix(), subResult.getTruthValuesVector(), nullptr); |
|
|
|
return std::unique_ptr<CheckResult>(new ExplicitQuantitativeCheckResult<ValueType>(std::move(numericResult))); |
|
|
|
|
|
|
|
storm::modelchecker::helper::SparseDeterministicInfiniteHorizonHelper<ValueType> helper(this->getModel().getTransitionMatrix()); |
|
|
|
storm::modelchecker::helper::setInformationFromCheckTaskDeterministic(helper, checkTask, this->getModel()); |
|
|
|
auto values = helper.computeLongRunAverageProbabilities(env, subResult.getTruthValuesVector()); |
|
|
|
|
|
|
|
return std::unique_ptr<CheckResult>(new ExplicitQuantitativeCheckResult<ValueType>(std::move(values))); |
|
|
|
} |
|
|
|
|
|
|
|
template<typename SparseDtmcModelType> |
|
|
|
std::unique_ptr<CheckResult> SparseDtmcPrctlModelChecker<SparseDtmcModelType>::computeLongRunAverageRewards(Environment const& env, storm::logic::RewardMeasureType rewardMeasureType, CheckTask<storm::logic::LongRunAverageRewardFormula, ValueType> const& checkTask) { |
|
|
|
auto rewardModel = storm::utility::createFilteredRewardModel(this->getModel(), checkTask); |
|
|
|
std::vector<ValueType> numericResult = storm::modelchecker::helper::SparseCtmcCslHelper::computeLongRunAverageRewards<ValueType>(env, storm::solver::SolveGoal<ValueType>(this->getModel(), checkTask), this->getModel().getTransitionMatrix(), rewardModel.get(), nullptr); |
|
|
|
return std::unique_ptr<CheckResult>(new ExplicitQuantitativeCheckResult<ValueType>(std::move(numericResult))); |
|
|
|
storm::modelchecker::helper::SparseDeterministicInfiniteHorizonHelper<ValueType> helper(this->getModel().getTransitionMatrix()); |
|
|
|
storm::modelchecker::helper::setInformationFromCheckTaskDeterministic(helper, checkTask, this->getModel()); |
|
|
|
auto values = helper.computeLongRunAverageRewards(env, rewardModel.get()); |
|
|
|
return std::unique_ptr<CheckResult>(new ExplicitQuantitativeCheckResult<ValueType>(std::move(values))); |
|
|
|
} |
|
|
|
|
|
|
|
template<typename SparseDtmcModelType> |
|
|
|