Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SymbolicGameSolver.h
Go to the documentation of this file.
1#ifndef STORM_SOLVER_SYMBOLICGAMESOLVER_H_
2#define STORM_SOLVER_SYMBOLICGAMESOLVER_H_
3
4#include <set>
5#include <vector>
6
8
12
13namespace storm {
14
15class Environment;
16
17namespace solver {
18
22template<storm::dd::DdType Type, typename ValueType = double>
24 public:
40 storm::dd::Bdd<Type> const& illegalPlayer2Mask, std::set<storm::expressions::Variable> const& rowMetaVariables,
41 std::set<storm::expressions::Variable> const& columnMetaVariables,
42 std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>> const& rowColumnMetaVariablePairs,
43 std::set<storm::expressions::Variable> const& player1Variables, std::set<storm::expressions::Variable> const& player2Variables);
44
45 virtual ~SymbolicGameSolver() = default;
46
63 boost::optional<storm::dd::Bdd<Type>> const& basePlayer1Strategy = boost::none,
64 boost::optional<storm::dd::Bdd<Type>> const& basePlayer2Strategy = boost::none);
65
66 // Setters that enable the generation of the players' strategies.
67 void setGeneratePlayer1Strategy(bool value);
68 void setGeneratePlayer2Strategy(bool value);
69 void setGeneratePlayersStrategies(bool value);
70
71 // Getters to retrieve the players' strategies. Only legal if they were generated.
74
75 protected:
76 // The matrix defining the coefficients of the linear equation system.
78
79 // A BDD characterizing all rows of the equation system.
81
82 // An ADD that can be used to compensate for the illegal choices of player 1.
84
85 // An ADD that can be used to compensate for the illegal choices of player 2.
87
88 // The row variables.
89 std::set<storm::expressions::Variable> rowMetaVariables;
90
91 // The column variables.
92 std::set<storm::expressions::Variable> columnMetaVariables;
93
94 // The pairs of meta variables used for renaming.
95 std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>> rowColumnMetaVariablePairs;
96
97 // The player 1 variables.
98 std::set<storm::expressions::Variable> player1Variables;
99
100 // The player 2 variables.
101 std::set<storm::expressions::Variable> player2Variables;
102
103 // A flag indicating whether a player 1 is to be generated.
105
106 // A player 1 strategy if one was generated.
107 boost::optional<storm::dd::Bdd<Type>> player1Strategy;
108
109 // A flag indicating whether a player 2 is to be generated.
111
112 // A player 1 strategy if one was generated.
113 boost::optional<storm::dd::Bdd<Type>> player2Strategy;
114};
115
116template<storm::dd::DdType Type, typename ValueType>
118 public:
119 virtual ~SymbolicGameSolverFactory() = default;
120
121 virtual std::unique_ptr<storm::solver::SymbolicGameSolver<Type, ValueType>> create(
122 storm::dd::Add<Type, ValueType> const& A, storm::dd::Bdd<Type> const& allRows, storm::dd::Bdd<Type> const& illegalPlayer1Mask,
123 storm::dd::Bdd<Type> const& illegalPlayer2Mask, std::set<storm::expressions::Variable> const& rowMetaVariables,
124 std::set<storm::expressions::Variable> const& columnMetaVariables,
125 std::vector<std::pair<storm::expressions::Variable, storm::expressions::Variable>> const& rowColumnMetaVariablePairs,
126 std::set<storm::expressions::Variable> const& player1Variables, std::set<storm::expressions::Variable> const& player2Variables) const;
127};
128
129} // namespace solver
130} // namespace storm
131
132#endif /* STORM_SOLVER_SYMBOLICGAMESOLVER_H_ */
virtual std::unique_ptr< storm::solver::SymbolicGameSolver< Type, ValueType > > create(storm::dd::Add< Type, ValueType > const &A, storm::dd::Bdd< Type > const &allRows, storm::dd::Bdd< Type > const &illegalPlayer1Mask, storm::dd::Bdd< Type > const &illegalPlayer2Mask, std::set< storm::expressions::Variable > const &rowMetaVariables, std::set< storm::expressions::Variable > const &columnMetaVariables, std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > const &rowColumnMetaVariablePairs, std::set< storm::expressions::Variable > const &player1Variables, std::set< storm::expressions::Variable > const &player2Variables) const
An interface that represents an abstract symbolic game solver.
virtual ~SymbolicGameSolver()=default
storm::dd::Add< Type, ValueType > illegalPlayer2Mask
storm::dd::Bdd< Type > const & getPlayer1Strategy() const
boost::optional< storm::dd::Bdd< Type > > player2Strategy
storm::dd::Add< Type, ValueType > illegalPlayer1Mask
std::vector< std::pair< storm::expressions::Variable, storm::expressions::Variable > > rowColumnMetaVariablePairs
virtual storm::dd::Add< Type, ValueType > solveGame(Environment const &env, OptimizationDirection player1Goal, OptimizationDirection player2Goal, storm::dd::Add< Type, ValueType > const &x, storm::dd::Add< Type, ValueType > const &b, boost::optional< storm::dd::Bdd< Type > > const &basePlayer1Strategy=boost::none, boost::optional< storm::dd::Bdd< Type > > const &basePlayer2Strategy=boost::none)
Solves the equation system defined by the game matrix.
storm::dd::Add< Type, ValueType > A
boost::optional< storm::dd::Bdd< Type > > player1Strategy
storm::dd::Bdd< Type > const & getPlayer2Strategy() const
std::set< storm::expressions::Variable > rowMetaVariables
std::set< storm::expressions::Variable > columnMetaVariables
std::set< storm::expressions::Variable > player2Variables
std::set< storm::expressions::Variable > player1Variables
LabParser.cpp.
Definition cli.cpp:18