3#include <boost/optional.hpp>
29template<
class ValueType>
48 std::vector<ValueType>
const& b, std::vector<uint64_t>* player1Choices =
nullptr,
49 std::vector<uint64_t>* player2Choices =
nullptr)
const = 0;
66 std::vector<ValueType>
const* b, uint_fast64_t n = 1)
const = 0;
99 void setSchedulerHints(std::vector<uint_fast64_t>&& player1Choices, std::vector<uint_fast64_t>&& player2Choices);
154template<
typename ValueType>
167 virtual std::unique_ptr<GameSolver<ValueType>>
create(
Environment const& env, std::vector<uint64_t>
const& player1Grouping,
169 virtual std::unique_ptr<GameSolver<ValueType>>
create(
Environment const& env, std::vector<uint64_t>&& player1Grouping,
virtual std::unique_ptr< GameSolver< ValueType > > create(Environment const &env, storm::storage::SparseMatrix< storm::storage::sparse::state_type > const &player1Matrix, storm::storage::SparseMatrix< ValueType > const &player2Matrix) const
virtual ~GameSolverFactory()=default
A class representing the interface that all game solvers shall implement.
boost::optional< std::vector< uint_fast64_t > > player1SchedulerChoices
The scheduler choices that induce the optimal values (if they could be successfully generated).
boost::optional< std::vector< uint_fast64_t > > player1ChoicesHint
bool hasUniqueSolution() const
Retrieves whether the solution to the min max equation system is assumed to be unique.
boost::optional< std::vector< uint_fast64_t > > player2SchedulerChoices
storm::storage::Scheduler< ValueType > computePlayer2Scheduler() const
std::vector< uint_fast64_t > const & getPlayer2SchedulerChoices() const
storm::storage::Scheduler< ValueType > computePlayer1Scheduler() const
Retrieves the generated scheduler.
void setCachingEnabled(bool value)
Sets whether some of the generated data during solver calls should be cached.
bool trackSchedulers
Whether we generate schedulers during solving.
std::vector< uint_fast64_t > const & getPlayer1SchedulerChoices() const
Retrieves the generated (deterministic) choices of the optimal scheduler.
void setTrackSchedulers(bool value=true)
Sets whether schedulers are generated when solving equation systems.
bool hasSchedulers() const
Retrieves whether the solver generated a scheduler.
virtual void clearCache() const
virtual ~GameSolver()=default
bool hasSchedulerHints() const
Returns whether Scheduler hints are available.
bool isTrackSchedulersSet() const
Retrieves whether this solver is set to generate schedulers.
void setSchedulerHints(std::vector< uint_fast64_t > &&player1Choices, std::vector< uint_fast64_t > &&player2Choices)
Sets scheduler hints that might be considered by the solver as an initial guess.
void setHasUniqueSolution(bool value=true)
Sets whether the solution to the min max equation system is known to be unique.
boost::optional< std::vector< uint_fast64_t > > player2ChoicesHint
bool isCachingEnabled() const
Retrieves whether some of the generated data during solver calls should be cached.
virtual void repeatedMultiply(Environment const &env, OptimizationDirection player1Dir, OptimizationDirection player2Dir, std::vector< ValueType > &x, std::vector< ValueType > const *b, uint_fast64_t n=1) const =0
Performs (repeated) matrix-vector multiplication with the given parameters, i.e.
virtual bool solveGame(Environment const &env, OptimizationDirection player1Dir, OptimizationDirection player2Dir, std::vector< ValueType > &x, std::vector< ValueType > const &b, std::vector< uint64_t > *player1Choices=nullptr, std::vector< uint64_t > *player2Choices=nullptr) const =0
Solves the equation system defined by the game matrices.
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.