#include "src/utility/solver.h" #include #include "src/solver/SymbolicLinearEquationSolver.h" #include "src/solver/SymbolicMinMaxLinearEquationSolver.h" #include "src/solver/SymbolicGameSolver.h" #include "src/solver/GameSolver.h" #include "src/solver/TopologicalMinMaxLinearEquationSolver.h" #include "src/solver/GurobiLpSolver.h" #include "src/solver/GlpkLpSolver.h" #include "src/solver/Z3SmtSolver.h" #include "src/solver/MathsatSmtSolver.h" #include "src/settings/SettingsManager.h" #include "src/settings/modules/CoreSettings.h" #include "src/exceptions/InvalidSettingsException.h" namespace storm { namespace utility { namespace solver { template std::unique_ptr> SymbolicLinearEquationSolverFactory::create(storm::dd::Add const& A, storm::dd::Bdd const& allRows, std::set const& rowMetaVariables, std::set const& columnMetaVariables, std::vector> const& rowColumnMetaVariablePairs) const { return std::unique_ptr>(new storm::solver::SymbolicLinearEquationSolver(A, allRows, rowMetaVariables, columnMetaVariables, rowColumnMetaVariablePairs)); } template std::unique_ptr> SymbolicMinMaxLinearEquationSolverFactory::create(storm::dd::Add const& A, storm::dd::Bdd const& allRows, storm::dd::Bdd const& illegalMask, std::set const& rowMetaVariables, std::set const& columnMetaVariables, std::set const& choiceVariables, std::vector> const& rowColumnMetaVariablePairs) const { return std::unique_ptr>(new storm::solver::SymbolicMinMaxLinearEquationSolver(A, allRows, illegalMask, rowMetaVariables, columnMetaVariables, choiceVariables, rowColumnMetaVariablePairs)); } template std::unique_ptr> SymbolicGameSolverFactory::create(storm::dd::Add const& A, storm::dd::Bdd const& allRows, std::set const& rowMetaVariables, std::set const& columnMetaVariables, std::vector> const& rowColumnMetaVariablePairs, std::set const& player1Variables, std::set const& player2Variables) const { return std::unique_ptr>(new storm::solver::SymbolicGameSolver(A, allRows, rowMetaVariables, columnMetaVariables, rowColumnMetaVariablePairs, player1Variables, player2Variables)); } template std::unique_ptr> GameSolverFactory::create(storm::storage::SparseMatrix const& player1Matrix, storm::storage::SparseMatrix const& player2Matrix) const { return std::unique_ptr>(new storm::solver::GameSolver(player1Matrix, player2Matrix)); } std::unique_ptr LpSolverFactory::create(std::string const& name, storm::solver::LpSolverTypeSelection solvT) const { storm::solver::LpSolverType t; if(solvT == storm::solver::LpSolverTypeSelection::FROMSETTINGS) { t = storm::settings::getModule().getLpSolver(); } else { t = convert(solvT); } switch (t) { case storm::solver::LpSolverType::Gurobi: return std::unique_ptr(new storm::solver::GurobiLpSolver(name)); case storm::solver::LpSolverType::Glpk: return std::unique_ptr(new storm::solver::GlpkLpSolver(name)); } } std::unique_ptr LpSolverFactory::create(std::string const& name) const { return LpSolverFactory::create(name, storm::solver::LpSolverTypeSelection::FROMSETTINGS); } std::unique_ptr GlpkLpSolverFactory::create(std::string const& name) const { return LpSolverFactory::create(name, storm::solver::LpSolverTypeSelection::Glpk); } std::unique_ptr GurobiLpSolverFactory::create(std::string const& name) const { return LpSolverFactory::create(name, storm::solver::LpSolverTypeSelection::Gurobi); } std::unique_ptr getLpSolver(std::string const& name, storm::solver::LpSolverTypeSelection solvType) { std::unique_ptr factory(new LpSolverFactory()); return factory->create(name, solvType); } std::unique_ptr SmtSolverFactory::create(storm::expressions::ExpressionManager& manager) const { storm::solver::SmtSolverType smtSolverType = storm::settings::getModule().getSmtSolver(); switch (smtSolverType) { case storm::solver::SmtSolverType::Z3: return std::unique_ptr(new storm::solver::Z3SmtSolver(manager)); case storm::solver::SmtSolverType::Mathsat: return std::unique_ptr(new storm::solver::MathsatSmtSolver(manager)); } } std::unique_ptr Z3SmtSolverFactory::create(storm::expressions::ExpressionManager& manager) const { return std::unique_ptr(new storm::solver::Z3SmtSolver(manager)); } std::unique_ptr MathsatSmtSolverFactory::create(storm::expressions::ExpressionManager& manager) const { return std::unique_ptr(new storm::solver::MathsatSmtSolver(manager)); } std::unique_ptr getSmtSolver(storm::expressions::ExpressionManager& manager) { std::unique_ptr factory(new MathsatSmtSolverFactory()); return factory->create(manager); } template class SymbolicLinearEquationSolverFactory; template class SymbolicLinearEquationSolverFactory; template class SymbolicMinMaxLinearEquationSolverFactory; template class SymbolicMinMaxLinearEquationSolverFactory; template class SymbolicGameSolverFactory; template class SymbolicGameSolverFactory; template class GameSolverFactory; } } }