13template<
typename ValueType>
18template<
typename ValueType>
20 trackSchedulers = value;
21 if (!trackSchedulers) {
22 player1SchedulerChoices = boost::none;
23 player2SchedulerChoices = boost::none;
27template<
typename ValueType>
29 return trackSchedulers;
32template<
typename ValueType>
34 return player1SchedulerChoices.is_initialized() && player2SchedulerChoices.is_initialized();
37template<
typename ValueType>
39 STORM_LOG_THROW(hasSchedulers(), storm::exceptions::IllegalFunctionCallException,
"Cannot retrieve player 1 scheduler, because none was generated.");
41 uint_fast64_t state = 0;
42 for (
auto const& schedulerChoice : player1SchedulerChoices.get()) {
49template<
typename ValueType>
51 STORM_LOG_THROW(hasSchedulers(), storm::exceptions::IllegalFunctionCallException,
"Cannot retrieve player 2 scheduler, because none was generated.");
53 uint_fast64_t state = 0;
54 for (
auto const& schedulerChoice : player2SchedulerChoices.get()) {
61template<
typename ValueType>
63 STORM_LOG_THROW(hasSchedulers(), storm::exceptions::IllegalFunctionCallException,
64 "Cannot retrieve player 1 scheduler choices, because they were not generated.");
65 return player1SchedulerChoices.get();
68template<
typename ValueType>
70 STORM_LOG_THROW(hasSchedulers(), storm::exceptions::IllegalFunctionCallException,
71 "Cannot retrieve player 2 scheduler choices, because they were not generated.");
72 return player2SchedulerChoices.get();
75template<
typename ValueType>
77 this->player1ChoicesHint = std::move(player1Choices);
78 this->player2ChoicesHint = std::move(player2Choices);
81template<
typename ValueType>
83 return player1ChoicesHint.is_initialized() && player2ChoicesHint.is_initialized();
86template<
typename ValueType>
88 if (cachingEnabled && !value) {
92 cachingEnabled = value;
95template<
typename ValueType>
97 return cachingEnabled;
100template<
typename ValueType>
105template<
typename ValueType>
107 this->uniqueSolution = value;
110template<
typename ValueType>
112 return this->uniqueSolution;
115template<
typename ValueType>
120template<
typename ValueType>
124 return std::make_unique<StandardGameSolver<ValueType>>(player1Matrix, player2Matrix, std::make_unique<GeneralLinearEquationSolverFactory<ValueType>>());
127template<
typename ValueType>
131 return std::make_unique<StandardGameSolver<ValueType>>(std::move(player1Matrix), std::move(player2Matrix),
132 std::make_unique<GeneralLinearEquationSolverFactory<ValueType>>());
135template<
typename ValueType>
138 return std::make_unique<StandardGameSolver<ValueType>>(player1Grouping, player2Matrix, std::make_unique<GeneralLinearEquationSolverFactory<ValueType>>());
141template<
typename ValueType>
144 return std::make_unique<StandardGameSolver<ValueType>>(std::move(player1Grouping), std::move(player2Matrix),
145 std::make_unique<GeneralLinearEquationSolverFactory<ValueType>>());
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
A class representing the interface that all game solvers shall implement.
bool hasUniqueSolution() const
Retrieves whether the solution to the min max equation system is assumed to be unique.
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.
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
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.
bool isCachingEnabled() const
Retrieves whether some of the generated data during solver calls should be cached.
This class defines which action is chosen in a particular state of a non-deterministic model.
void setChoice(SchedulerChoice< ValueType > const &choice, uint_fast64_t modelState, uint_fast64_t memoryState=0)
Sets the choice defined by the scheduler for the given state.
A class that holds a possibly non-square matrix in the compressed row storage format.
#define STORM_LOG_THROW(cond, exception, message)