@ -16,6 +16,7 @@
# include "storm/modelchecker/prctl/helper/SparseMdpPrctlHelper.h"
# include "storm/modelchecker/prctl/helper/SparseMdpPrctlHelper.h"
# include "storm/modelchecker/helper/infinitehorizon/SparseNondeterministicInfiniteHorizonHelper.h"
# include "storm/modelchecker/helper/infinitehorizon/SparseNondeterministicInfiniteHorizonHelper.h"
# include "storm/modelchecker/helper/utility/SetInformationFromCheckTask.h"
# include "storm/modelchecker/prctl/helper/rewardbounded/QuantileHelper.h"
# include "storm/modelchecker/prctl/helper/rewardbounded/QuantileHelper.h"
# include "storm/modelchecker/multiobjective/multiObjectiveModelChecking.h"
# include "storm/modelchecker/multiobjective/multiObjectiveModelChecking.h"
@ -221,14 +222,15 @@ namespace storm {
template < typename SparseMdpModelType >
template < typename SparseMdpModelType >
std : : unique_ptr < CheckResult > SparseMdpPrctlModelChecker < SparseMdpModelType > : : computeLongRunAverageProbabilities ( Environment const & env , CheckTask < storm : : logic : : StateFormula , ValueType > const & checkTask ) {
std : : unique_ptr < CheckResult > SparseMdpPrctlModelChecker < SparseMdpModelType > : : computeLongRunAverageProbabilities ( Environment const & env , CheckTask < storm : : logic : : StateFormula , ValueType > const & checkTask ) {
storm : : logic : : StateFormula const & stateFormula = checkTask . getFormula ( ) ;
storm : : logic : : StateFormula const & stateFormula = checkTask . getFormula ( ) ;
STORM_LOG_THROW ( checkTask . isOptimizationDirectionSet ( ) , storm : : exceptions : : InvalidPropertyException , " Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model. " ) ;
STORM_LOG_THROW ( checkTask . isOptimizationDirectionSet ( ) , storm : : exceptions : : InvalidPropertyException , " Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model. " ) ;
std : : unique_ptr < CheckResult > subResultPointer = this - > check ( env , stateFormula ) ;
std : : unique_ptr < CheckResult > subResultPointer = this - > check ( env , stateFormula ) ;
ExplicitQualitativeCheckResult const & subResult = subResultPointer - > asExplicitQualitativeCheckResult ( ) ;
ExplicitQualitativeCheckResult const & subResult = subResultPointer - > asExplicitQualitativeCheckResult ( ) ;
storm : : modelchecker : : helper : : SparseNondeterministicInfiniteHorizonHelper < ValueType > helper ( this - > getModel ( ) . getTransitionMatrix ( ) , this - > getModel ( ) . getBackwardTransitions ( ) ) ;
storm : : modelchecker : : helper : : SparseNondeterministicInfiniteHorizonHelper < ValueType > helper ( this - > getModel ( ) . getTransitionMatrix ( ) , this - > getModel ( ) . getBackwardTransitions ( ) ) ;
helper . setOptimizationDirection ( checkTask . getOptimizationDirection ( ) ) ;
helper . setProduceScheduler ( checkTask . isProduceSchedulersSet ( ) ) ;
storm : : modelchecker : : helper : : setInformationFromCheckTaskNondeterministic ( helper , checkTask , this - > getModel ( ) ) ;
auto values = helper . computeLongRunAverageProbabilities ( env , subResult . getTruthValuesVector ( ) ) ;
auto values = helper . computeLongRunAverageProbabilities ( env , subResult . getTruthValuesVector ( ) ) ;
std : : unique_ptr < CheckResult > result ( new ExplicitQuantitativeCheckResult < ValueType > ( std : : move ( values ) ) ) ;
std : : unique_ptr < CheckResult > result ( new ExplicitQuantitativeCheckResult < ValueType > ( std : : move ( values ) ) ) ;
if ( checkTask . isProduceSchedulersSet ( ) ) {
if ( checkTask . isProduceSchedulersSet ( ) ) {
result - > asExplicitQuantitativeCheckResult < ValueType > ( ) . setScheduler ( std : : make_unique < storm : : storage : : Scheduler < ValueType > > ( helper . extractScheduler ( ) ) ) ;
result - > asExplicitQuantitativeCheckResult < ValueType > ( ) . setScheduler ( std : : make_unique < storm : : storage : : Scheduler < ValueType > > ( helper . extractScheduler ( ) ) ) ;
@ -241,8 +243,7 @@ namespace storm {
STORM_LOG_THROW ( checkTask . isOptimizationDirectionSet ( ) , storm : : exceptions : : InvalidPropertyException , " Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model. " ) ;
STORM_LOG_THROW ( checkTask . isOptimizationDirectionSet ( ) , storm : : exceptions : : InvalidPropertyException , " Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model. " ) ;
auto rewardModel = storm : : utility : : createFilteredRewardModel ( this - > getModel ( ) , checkTask ) ;
auto rewardModel = storm : : utility : : createFilteredRewardModel ( this - > getModel ( ) , checkTask ) ;
storm : : modelchecker : : helper : : SparseNondeterministicInfiniteHorizonHelper < ValueType > helper ( this - > getModel ( ) . getTransitionMatrix ( ) , this - > getModel ( ) . getBackwardTransitions ( ) ) ;
storm : : modelchecker : : helper : : SparseNondeterministicInfiniteHorizonHelper < ValueType > helper ( this - > getModel ( ) . getTransitionMatrix ( ) , this - > getModel ( ) . getBackwardTransitions ( ) ) ;
helper . setOptimizationDirection ( checkTask . getOptimizationDirection ( ) ) ;
helper . setProduceScheduler ( checkTask . isProduceSchedulersSet ( ) ) ;
storm : : modelchecker : : helper : : setInformationFromCheckTaskNondeterministic ( helper , checkTask , this - > getModel ( ) ) ;
auto values = helper . computeLongRunAverageRewards ( env , rewardModel . get ( ) ) ;
auto values = helper . computeLongRunAverageRewards ( env , rewardModel . get ( ) ) ;
std : : unique_ptr < CheckResult > result ( new ExplicitQuantitativeCheckResult < ValueType > ( std : : move ( values ) ) ) ;
std : : unique_ptr < CheckResult > result ( new ExplicitQuantitativeCheckResult < ValueType > ( std : : move ( values ) ) ) ;
if ( checkTask . isProduceSchedulersSet ( ) ) {
if ( checkTask . isProduceSchedulersSet ( ) ) {