7#include <boost/optional.hpp>
26template<
typename ValueType>
35template<
typename ValueType,
typename SolutionType = ValueType>
182 boost::optional<storm::solver::OptimizationDirection>
const&
direction = boost::none,
198 std::vector<ValueType>
const& b)
const = 0;
231 bool noEndComponents;
237 bool requirementsChecked;
243template<
typename ValueType,
typename SolutionType = ValueType>
249 std::unique_ptr<MinMaxLinearEquationSolver<ValueType, SolutionType>>
create(
Environment const& env,
252 virtual std::unique_ptr<MinMaxLinearEquationSolver<ValueType, SolutionType>>
create(
Environment const& env)
const = 0;
259 boost::optional<storm::solver::OptimizationDirection>
const& direction = boost::none,
260 bool hasInitialScheduler =
false,
bool trackScheduler =
false)
const;
265 bool requirementsChecked;
268template<
typename ValueType,
typename SolutionType = ValueType>
276 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()
MinMaxMethod getMethod(Environment env) const
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.
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.
boost::optional< std::vector< uint_fast64_t > > robustSchedulerIndex
For interval models, this index points into the schedulerChoices and is a state -> index map.
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.
std::vector< uint_fast64_t > const & getRobustSchedulerIndex() const
Retrieves the generated robust index into the scheduler.
void setUncertaintyResolutionMode(UncertaintyResolutionMode uncertaintyResolutionMode)
Sets how the uncertainty should be resolved.
UncertaintyResolutionMode getUncertaintyResolutionMode() const
Retrieves the mode indicating how the uncertainty should be resolved.
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
UncertaintyResolutionMode