From c37e2bfe702d78711e58f4462073da5d61b0dc2b Mon Sep 17 00:00:00 2001 From: TimQu Date: Mon, 25 Mar 2019 09:10:13 +0100 Subject: [PATCH] Added INFO output when game solver is invoked. --- src/storm/solver/SolverSelectionOptions.cpp | 10 ++++++++++ src/storm/solver/StandardGameSolver.cpp | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/storm/solver/SolverSelectionOptions.cpp b/src/storm/solver/SolverSelectionOptions.cpp index 0a457be7e..26001226f 100644 --- a/src/storm/solver/SolverSelectionOptions.cpp +++ b/src/storm/solver/SolverSelectionOptions.cpp @@ -36,6 +36,16 @@ namespace storm { 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) { switch(m) { case LraMethod::LinearProgramming: diff --git a/src/storm/solver/StandardGameSolver.cpp b/src/storm/solver/StandardGameSolver.cpp index 837a149b3..a818f2706 100644 --- a/src/storm/solver/StandardGameSolver.cpp +++ b/src/storm/solver/StandardGameSolver.cpp @@ -72,7 +72,9 @@ namespace storm { template bool StandardGameSolver::solveGame(Environment const& env, OptimizationDirection player1Dir, OptimizationDirection player2Dir, std::vector& x, std::vector const& b, std::vector* player1Choices, std::vector* player2Choices) const { - switch (getMethod(env, std::is_same::value)) { + auto method = getMethod(env, std::is_same::value); + STORM_LOG_INFO("Solving stochastic two player game over " << x.size() << " states using " << toString(method) << "."); + switch (method) { case GameMethod::ValueIteration: return solveGameValueIteration(env, player1Dir, player2Dir, x, b, player1Choices, player2Choices); case GameMethod::PolicyIteration: