From 06ec360c86ec813cc19fac0035b445498ccc94bf Mon Sep 17 00:00:00 2001 From: Matthias Volk Date: Sun, 26 Nov 2017 16:04:35 +0100 Subject: [PATCH] Bindings for storm environments --- src/core/environment.cpp | 10 ++++++++++ src/core/environment.h | 8 ++++++++ src/mod_core.cpp | 2 ++ tests/core/test_environment.py | 6 ++++++ 4 files changed, 26 insertions(+) create mode 100644 src/core/environment.cpp create mode 100644 src/core/environment.h create mode 100644 tests/core/test_environment.py diff --git a/src/core/environment.cpp b/src/core/environment.cpp new file mode 100644 index 0000000..23ad447 --- /dev/null +++ b/src/core/environment.cpp @@ -0,0 +1,10 @@ +#include "environment.h" +#include "src/helpers.h" +#include "storm/environment/Environment.h" + +void define_environment(py::module& m) { + py::class_(m, "Environment", "Environment") + .def(py::init<>(), "Construct default environment") + ; +} + diff --git a/src/core/environment.h b/src/core/environment.h new file mode 100644 index 0000000..63783c1 --- /dev/null +++ b/src/core/environment.h @@ -0,0 +1,8 @@ +#ifndef PYTHON_CORE_ENVIRONMENT_H_ +#define PYTHON_CORE_ENVIRONMENT_H_ + +#include "common.h" + +void define_environment(py::module& m); + +#endif /* PYTHON_CORE_ENVIRONMENT_H_ */ diff --git a/src/mod_core.cpp b/src/mod_core.cpp index d98d603..583eff6 100644 --- a/src/mod_core.cpp +++ b/src/mod_core.cpp @@ -6,6 +6,7 @@ #include "core/bisimulation.h" #include "core/input.h" #include "core/analysis.h" +#include "core/environment.h" PYBIND11_MODULE(core, m) { m.doc() = "core"; @@ -25,4 +26,5 @@ PYBIND11_MODULE(core, m) { define_bisimulation(m); define_input(m); define_graph_constraints(m); + define_environment(m); } diff --git a/tests/core/test_environment.py b/tests/core/test_environment.py new file mode 100644 index 0000000..fa6b0ea --- /dev/null +++ b/tests/core/test_environment.py @@ -0,0 +1,6 @@ +import stormpy +from helpers.helper import get_example_path + +class TestEnvironment: + def test_environment(self): + env = stormpy.Environment()