Browse Source

Added INFO output when game solver is invoked.

tempestpy_adaptions
TimQu 6 years ago
parent
commit
c37e2bfe70
  1. 10
      src/storm/solver/SolverSelectionOptions.cpp
  2. 4
      src/storm/solver/StandardGameSolver.cpp

10
src/storm/solver/SolverSelectionOptions.cpp

@ -36,6 +36,16 @@ namespace storm {
return "invalid"; return "invalid";
} }
std::string toString(GameMethod m) {
switch(m) {
case GameMethod::ValueIteration:
return "valueiteration";
case GameMethod::PolicyIteration:
return "PolicyIteration";
}
return "invalid";
}
std::string toString(LraMethod m) { std::string toString(LraMethod m) {
switch(m) { switch(m) {
case LraMethod::LinearProgramming: case LraMethod::LinearProgramming:

4
src/storm/solver/StandardGameSolver.cpp

@ -72,7 +72,9 @@ namespace storm {
template<typename ValueType> template<typename ValueType>
bool StandardGameSolver<ValueType>::solveGame(Environment const& env, OptimizationDirection player1Dir, OptimizationDirection player2Dir, std::vector<ValueType>& x, std::vector<ValueType> const& b, std::vector<uint64_t>* player1Choices, std::vector<uint64_t>* player2Choices) const { bool StandardGameSolver<ValueType>::solveGame(Environment const& env, OptimizationDirection player1Dir, OptimizationDirection player2Dir, std::vector<ValueType>& x, std::vector<ValueType> const& b, std::vector<uint64_t>* player1Choices, std::vector<uint64_t>* player2Choices) const {
switch (getMethod(env, std::is_same<ValueType, storm::RationalNumber>::value)) {
auto method = getMethod(env, std::is_same<ValueType, storm::RationalNumber>::value);
STORM_LOG_INFO("Solving stochastic two player game over " << x.size() << " states using " << toString(method) << ".");
switch (method) {
case GameMethod::ValueIteration: case GameMethod::ValueIteration:
return solveGameValueIteration(env, player1Dir, player2Dir, x, b, player1Choices, player2Choices); return solveGameValueIteration(env, player1Dir, player2Dir, x, b, player1Choices, player2Choices);
case GameMethod::PolicyIteration: case GameMethod::PolicyIteration:

Loading…
Cancel
Save