5#include <boost/optional.hpp>
16template<
typename ValueType>
22template<
typename ValueType>
23class LinearEquationSolverFactory;
26namespace modelchecker {
27template<
typename FormulaType,
typename ValueType>
32template<
typename ValueType,
typename RewardModelType>
38template<
typename ValueType>
39class LinearEquationSolver;
41template<
typename ValueType,
typename SolutionType = ValueType>
46 template<
typename RewardModelType,
typename FormulaType>
98 boost::optional<OptimizationDirection> optimizationDirection;
100 boost::optional<storm::logic::ComparisonType> comparisonType;
101 boost::optional<SolutionType> threshold;
102 boost::optional<storm::storage::BitVector> relevantValueVector;
103 bool robustAgainstUncertainty =
true;
106template<
typename ValueType,
typename MatrixType,
typename SolutionType>
109 MatrixType&& matrix) {
110 std::unique_ptr<storm::solver::MinMaxLinearEquationSolver<ValueType, SolutionType>> solver = factory.
create(env, std::forward<MatrixType>(matrix));
111 solver->setOptimizationDirection(goal.direction());
112 if (goal.isBounded()) {
113 if (goal.boundIsALowerBound()) {
115 goal.relevantValues(), goal.boundIsStrict(), goal.thresholdValue(),
true));
118 goal.relevantValues(), goal.boundIsStrict(), goal.thresholdValue(),
false));
121 if (goal.hasRelevantValues()) {
122 solver->setRelevantValues(std::move(goal.relevantValues()));
127template<
typename ValueType,
typename MatrixType,
typename SolutionType>
130 MatrixType&& matrix) {
131 std::unique_ptr<storm::solver::LinearEquationSolver<ValueType>> solver = factory.
create(env, std::forward<MatrixType>(matrix));
132 if (goal.isBounded()) {
134 goal.thresholdValue(), goal.minimize()));
139template<
typename MatrixType>
142 MatrixType&& matrix) {
143 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.
bool getRobustUncertainty() const
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
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.
std::unique_ptr< storm::solver::LinearEquationSolver< ValueType > > configureLinearEquationSolver(Environment const &env, SolveGoal< ValueType, SolutionType > &&goal, storm::solver::LinearEquationSolverFactory< ValueType > const &factory, MatrixType &&matrix)
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)