From 183f0cf8438bfd065f73df5848b5892589dc0ae1 Mon Sep 17 00:00:00 2001 From: Sebastian Junges Date: Thu, 29 Nov 2018 11:39:42 +0100 Subject: [PATCH] extended environment --- src/core/environment.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/core/environment.cpp b/src/core/environment.cpp index 6e6f8f8..f9c1596 100644 --- a/src/core/environment.cpp +++ b/src/core/environment.cpp @@ -19,15 +19,34 @@ void define_environment(py::module& m) { .value("topological", storm::solver::EquationSolverType::Topological) ; + py::enum_(m, "MinMaxMethod", "Method for min-max equation systems") + .value("policy_iteration", storm::solver::MinMaxMethod::PolicyIteration) + .value("value_iteration", storm::solver::MinMaxMethod::ValueIteration) + .value("linear_programming", storm::solver::MinMaxMethod::LinearProgramming) + .value("topological", storm::solver::MinMaxMethod::Topological) + .value("rational_search", storm::solver::MinMaxMethod::RationalSearch) + .value("interval_iteration", storm::solver::MinMaxMethod::IntervalIteration) + .value("sound_value_iteration", storm::solver::MinMaxMethod::SoundValueIteration) + .value("topological_cuda", storm::solver::MinMaxMethod::TopologicalCuda) + ; + + py::class_(m, "Environment", "Environment") .def(py::init<>(), "Construct default environment") - .def_property_readonly("solver_environment", [](storm::Environment& env) {return env.solver();}, "solver part of environment") + .def_property_readonly("solver_environment", [](storm::Environment& env) -> auto& {return env.solver();}, "solver part of environment") ; py::class_(m, "SolverEnvironment", "Environment for solvers") .def("set_force_sound", &storm::SolverEnvironment::setForceSoundness, "force soundness", py::arg("new_value") = true) .def("set_linear_equation_solver_type", &storm::SolverEnvironment::setLinearEquationSolverType, "set solver type to use", py::arg("new_value"), py::arg("set_from_default") = false) + .def_property_readonly("minmax_solver_environment", [](storm::SolverEnvironment& senv) -> auto& { return senv.minMax(); }) ; + py::class_(m, "MinMaxSolverEnvironment", "Environment for Min-Max-Solvers") + .def_property("method", &storm::MinMaxSolverEnvironment::getMethod, [](storm::MinMaxSolverEnvironment& mmenv, storm::solver::MinMaxMethod const& m) { mmenv.setMethod(m, false); } ) + .def_property("precision", &storm::MinMaxSolverEnvironment::getPrecision, &storm::MinMaxSolverEnvironment::setPrecision); + + + }