7#include <boost/optional.hpp>
25template<
typename ValueType>
34template<
typename ValueType,
typename SolutionType = ValueType>
176 boost::optional<storm::solver::OptimizationDirection>
const&
direction = boost::none,
192 std::vector<ValueType>
const& b)
const = 0;
214 bool noEndComponents;
220 bool requirementsChecked;
223 bool robustUncertainty;
226template<
typename ValueType,
typename SolutionType = ValueType>
232 std::unique_ptr<MinMaxLinearEquationSolver<ValueType, SolutionType>>
create(
Environment const& env,
235 virtual std::unique_ptr<MinMaxLinearEquationSolver<ValueType, SolutionType>>
create(
Environment const& env)
const = 0;
242 boost::optional<storm::solver::OptimizationDirection>
const& direction = boost::none,
243 bool hasInitialScheduler =
false,
bool trackScheduler =
false)
const;
248 bool requirementsChecked;
251template<
typename ValueType,
typename SolutionType = ValueType>
259 virtual std::unique_ptr<MinMaxLinearEquationSolver<ValueType, SolutionType>>
create(
Environment const& env)
const override;
virtual std::unique_ptr< MinMaxLinearEquationSolver< ValueType, SolutionType > > create(Environment const &env) const override
GeneralMinMaxLinearEquationSolverFactory()
MinMaxLinearEquationSolverRequirements getRequirements(Environment const &env, bool hasUniqueSolution=false, bool hasNoEndComponents=false, boost::optional< storm::solver::OptimizationDirection > const &direction=boost::none, bool hasInitialScheduler=false, bool trackScheduler=false) const
Retrieves the requirements of the solver that would be created when calling create() right now.
std::unique_ptr< MinMaxLinearEquationSolver< ValueType, SolutionType > > create(Environment const &env, storm::storage::SparseMatrix< ValueType > const &matrix) const
bool isRequirementsCheckedSet() const
virtual std::unique_ptr< MinMaxLinearEquationSolver< ValueType, SolutionType > > create(Environment const &env) const =0
virtual ~MinMaxLinearEquationSolverFactory()=default
void setRequirementsChecked(bool value=true)
MinMaxLinearEquationSolverFactory()
A class representing the interface that all min-max linear equation solvers shall implement.
virtual ~MinMaxLinearEquationSolver()
virtual void setSchedulerFixedForRowGroup(storm::storage::BitVector &&schedulerFixedForRowGroup)
Sets the states for which the choices are fixed.
void unsetOptimizationDirection()
Unsets the optimization direction to use for calls to methods that do not explicitly provide one.
storm::storage::Scheduler< ValueType > computeScheduler() const
Retrieves the generated scheduler.
void setHasUniqueSolution(bool value=true)
Sets whether the solution to the min max equation system is known to be unique.
void setUncertaintyIsRobust(bool robust)
Set whether uncertainty should be interpreted adverserially (robust) or not.
bool solveEquations(Environment const &env, OptimizationDirection d, std::vector< SolutionType > &x, std::vector< ValueType > const &b) const
Solves the equation system x = min/max(A*x + b) given by the parameters.
virtual void clearCache() const
Clears the currently cached data that has been stored during previous calls of the solver.
void setOptimizationDirection(OptimizationDirection direction)
Sets an optimization direction to use for calls to methods that do not explicitly provide one.
OptimizationDirectionSetting direction
The optimization direction to use for calls to functions that do not provide it explicitly....
boost::optional< std::vector< uint_fast64_t > > initialScheduler
A scheduler that can be used by solvers that require a valid initial scheduler.
void setInitialScheduler(std::vector< uint_fast64_t > &&choices)
Sets a valid initial scheduler that is required by some solvers (see requirements of solvers).
bool hasScheduler() const
Retrieves whether the solver generated a scheduler.
std::vector< uint_fast64_t > const & getSchedulerChoices() const
Retrieves the generated (deterministic) choices of the optimal scheduler.
std::vector< uint_fast64_t > const & getInitialScheduler() const
Retrieves the initial scheduler if one was set.
bool trackScheduler
Whether we generate a scheduler during solving.
void setRequirementsChecked(bool value=true)
Notifies the solver that the requirements for solving equations have been checked.
bool hasUniqueSolution() const
Retrieves whether the solution to the min max equation system is assumed to be unique.
virtual MinMaxLinearEquationSolverRequirements getRequirements(Environment const &env, boost::optional< storm::solver::OptimizationDirection > const &direction=boost::none, bool const &hasInitialScheduler=false) const
Retrieves the requirements of this solver for solving equations with the current settings.
boost::optional< storm::storage::BitVector > choiceFixedForRowGroup
void setHasNoEndComponents(bool value=true)
Sets whether the min max equation system is known to not have any end components.
bool isUncertaintyRobust() const
Is the uncertainty to be interpreted robustly (adverserially) or not?
bool isTrackSchedulerSet() const
Retrieves whether this solver is set to generate schedulers.
bool hasNoEndComponents() const
Retrieves whether the min max equation system is known to not have any end components.
virtual bool internalSolveEquations(Environment const &env, OptimizationDirection d, std::vector< SolutionType > &x, std::vector< ValueType > const &b) const =0
void setCachingEnabled(bool value)
Sets whether some of the generated data during solver calls should be cached.
bool isRequirementsCheckedSet() const
Retrieves whether the solver is aware that the requirements were checked.
bool isCachingEnabled() const
Retrieves whether some of the generated data during solver calls should be cached.
boost::optional< std::vector< uint_fast64_t > > schedulerChoices
The scheduler choices that induce the optimal values (if they could be successfully generated).
virtual void setMatrix(storm::storage::SparseMatrix< ValueType > const &matrix)=0
bool hasInitialScheduler() const
Returns true iff an initial scheduler is set.
void setTrackScheduler(bool trackScheduler=true)
Sets whether schedulers are generated when solving equation systems.
virtual void setMatrix(storm::storage::SparseMatrix< ValueType > &&matrix)=0
A bit vector that is internally represented as a vector of 64-bit values.
This class defines which action is chosen in a particular state of a non-deterministic model.
A class that holds a possibly non-square matrix in the compressed row storage format.
OptimizationDirectionSetting