|
@ -31,7 +31,7 @@ namespace storm { |
|
|
|
|
|
|
|
|
template <typename SparseCtmcModelType> |
|
|
template <typename SparseCtmcModelType> |
|
|
bool SparseCtmcCslModelChecker<SparseCtmcModelType>::canHandle(storm::logic::Formula const& formula) const { |
|
|
bool SparseCtmcCslModelChecker<SparseCtmcModelType>::canHandle(storm::logic::Formula const& formula) const { |
|
|
return formula.isCslStateFormula() || formula.isCslPathFormula() || formula.isRewardPathFormula(); |
|
|
|
|
|
|
|
|
return formula.isCslStateFormula() || formula.isCslPathFormula() || formula.isRewardPathFormula() || formula.isExpectedTimeOperatorFormula(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
template <typename SparseCtmcModelType> |
|
|
template <typename SparseCtmcModelType> |
|
@ -101,8 +101,17 @@ namespace storm { |
|
|
storm::storage::SparseMatrix<ValueType> probabilityMatrix = storm::modelchecker::helper::SparseCtmcCslHelper<ValueType>::computeProbabilityMatrix(this->getModel().getTransitionMatrix(), this->getModel().getExitRateVector()); |
|
|
storm::storage::SparseMatrix<ValueType> probabilityMatrix = storm::modelchecker::helper::SparseCtmcCslHelper<ValueType>::computeProbabilityMatrix(this->getModel().getTransitionMatrix(), this->getModel().getExitRateVector()); |
|
|
std::vector<ValueType> numericResult = storm::modelchecker::helper::SparseCtmcCslHelper<ValueType>::computeLongRunAverage(probabilityMatrix, subResult.getTruthValuesVector(), &this->getModel().getExitRateVector(), qualitative, *linearEquationSolverFactory); |
|
|
std::vector<ValueType> numericResult = storm::modelchecker::helper::SparseCtmcCslHelper<ValueType>::computeLongRunAverage(probabilityMatrix, subResult.getTruthValuesVector(), &this->getModel().getExitRateVector(), qualitative, *linearEquationSolverFactory); |
|
|
return std::unique_ptr<CheckResult>(new ExplicitQuantitativeCheckResult<ValueType>(std::move(numericResult))); |
|
|
return std::unique_ptr<CheckResult>(new ExplicitQuantitativeCheckResult<ValueType>(std::move(numericResult))); |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
template <typename SparseCtmcModelType> |
|
|
|
|
|
std::unique_ptr<CheckResult> SparseCtmcCslModelChecker<SparseCtmcModelType>::computeExpectedTimes(storm::logic::EventuallyFormula const& eventuallyFormula, bool qualitative, boost::optional<OptimizationDirection> const& optimalityType) { |
|
|
|
|
|
std::unique_ptr<CheckResult> subResultPointer = this->check(eventuallyFormula.getSubformula()); |
|
|
|
|
|
ExplicitQualitativeCheckResult& subResult = subResultPointer->asExplicitQualitativeCheckResult(); |
|
|
|
|
|
|
|
|
|
|
|
std::vector<ValueType> numericResult = storm::modelchecker::helper::SparseCtmcCslHelper<ValueType>::computeExpectedTimes(this->getModel().getTransitionMatrix(), this->getModel().getBackwardTransitions(), this->getModel().getExitRateVector(), subResult.getTruthValuesVector(), qualitative, *linearEquationSolverFactory); |
|
|
|
|
|
return std::unique_ptr<CheckResult>(new ExplicitQuantitativeCheckResult<ValueType>(std::move(numericResult))); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Explicitly instantiate the model checker.
|
|
|
// Explicitly instantiate the model checker.
|
|
|
template class SparseCtmcCslModelChecker<storm::models::sparse::Ctmc<double>>; |
|
|
template class SparseCtmcCslModelChecker<storm::models::sparse::Ctmc<double>>; |
|
|
|
|
|
|
|
|