5#include <boost/optional.hpp>
17template<
typename ValueType>
23template<
typename ValueType>
24class LinearEquationSolverFactory;
27namespace modelchecker {
28template<
typename FormulaType,
typename ValueType>
33template<
typename ValueType,
typename RewardModelType>
39template<
typename ValueType>
40class LinearEquationSolver;
42template<
typename ValueType,
typename SolutionType = ValueType>
47 template<
typename RewardModelType,
typename FormulaType>
99 boost::optional<OptimizationDirection> optimizationDirection;
101 boost::optional<storm::logic::ComparisonType> comparisonType;
102 boost::optional<SolutionType> threshold;
103 boost::optional<storm::storage::BitVector> relevantValueVector;
107template<
typename ValueType,
typename MatrixType,
typename SolutionType>
111 std::unique_ptr<storm::solver::MinMaxLinearEquationSolver<ValueType, SolutionType>> solver = factory.
create(env, std::forward<MatrixType>(matrix));
113 :
convert(optimizationDirectionSetting));
114 if (goal.isBounded()) {
115 if (goal.boundIsALowerBound()) {
117 goal.relevantValues(), goal.boundIsStrict(), goal.thresholdValue(),
true));
120 goal.relevantValues(), goal.boundIsStrict(), goal.thresholdValue(),
false));
123 if (goal.hasRelevantValues()) {
124 solver->setRelevantValues(std::move(goal.relevantValues()));
129template<
typename ValueType,
typename MatrixType,
typename SolutionType>
132 MatrixType&& matrix) {
133 std::unique_ptr<storm::solver::LinearEquationSolver<ValueType>> solver = factory.
create(env, std::forward<MatrixType>(matrix));
134 if (goal.isBounded()) {
136 goal.thresholdValue(), goal.minimize()));
141template<
typename MatrixType>
144 MatrixType&& matrix) {
145 std::unique_ptr<storm::solver::LinearEquationSolver<storm::RationalFunction>> solver = factory.
create(env, std::forward<MatrixType>(matrix));
bool isBoundSet() const
Retrieves whether there is a bound with which the values for the states will be compared.
ValueType getBoundThreshold() const
Retrieves the value of the bound (if set).
storm::logic::ComparisonType const & getBoundComparisonType() const
Retrieves the comparison type of the bound (if set).
bool isOptimizationDirectionSet() const
Retrieves whether an optimization direction was set.
storm::OptimizationDirection const & getOptimizationDirection() const
Retrieves the optimization direction (if set).
bool isOnlyInitialStatesRelevantSet() const
Retrieves whether only the initial states are relevant in the computation.
UncertaintyResolutionMode getUncertaintyResolutionMode() const
Retrieves the mode which decides how the uncertainty will be resolved.
Base class for all sparse models.
storm::storage::BitVector const & getInitialStates() const
Retrieves the initial states of the model.
std::unique_ptr< LinearEquationSolver< ValueType > > create(Environment const &env, storm::storage::SparseMatrix< ValueType > const &matrix) const
Creates a new linear equation solver instance with the given matrix.
std::unique_ptr< MinMaxLinearEquationSolver< ValueType, SolutionType > > create(Environment const &env, storm::storage::SparseMatrix< ValueType > const &matrix) const
bool boundIsStrict() const
UncertaintyResolutionMode getUncertaintyResolutionMode() const
bool boundIsALowerBound() const
void oneMinus()
Flips the comparison type, the direction, and computes the new threshold as 1 - old threshold.
SolutionType const & thresholdValue() const
bool hasRelevantValues() const
SolveGoal(storm::models::sparse::Model< ValueType, RewardModelType > const &model, storm::modelchecker::CheckTask< FormulaType, SolutionType > const &checkTask)
void restrictRelevantValues(storm::storage::BitVector const &filter)
storm::storage::BitVector & relevantValues()
void setRelevantValues(storm::storage::BitVector &&values)
bool hasDirection() const
OptimizationDirection direction() const
A bit vector that is internally represented as a vector of 64-bit values.
OptimizationDirection convert(OptimizationDirectionSetting s)
std::unique_ptr< storm::solver::MinMaxLinearEquationSolver< ValueType, SolutionType > > configureMinMaxLinearEquationSolver(Environment const &env, SolveGoal< ValueType, SolutionType > &&goal, storm::solver::MinMaxLinearEquationSolverFactory< ValueType, SolutionType > const &factory, MatrixType &&matrix, OptimizationDirectionSetting optimizationDirectionSetting=OptimizationDirectionSetting::Unset)
OptimizationDirectionSetting
std::unique_ptr< storm::solver::LinearEquationSolver< ValueType > > configureLinearEquationSolver(Environment const &env, SolveGoal< ValueType, SolutionType > &&goal, storm::solver::LinearEquationSolverFactory< ValueType > const &factory, MatrixType &&matrix)
UncertaintyResolutionMode