Browse Source

dd meta variable types

refactoring
Sebastian Junges 4 years ago
parent
commit
32e8f09a43
  1. 1
      src/mod_storage.cpp
  2. 10
      src/storage/dd.cpp
  3. 1
      src/storage/dd.h

1
src/mod_storage.cpp

@ -26,6 +26,7 @@ PYBIND11_MODULE(storage, m) {
define_bitvector(m);
define_dd<storm::dd::DdType::Sylvan>(m, "Sylvan");
define_dd_nt(m);
define_model(m);
define_statevaluation(m);
define_sparse_model(m);

10
src/storage/dd.cpp

@ -11,6 +11,7 @@ void define_dd(py::module& m, std::string const& libstring) {
ddMetaVariable.def("compute_indices", &storm::dd::DdMetaVariable<DdType>::getIndices, py::arg("sorted")=true);
ddMetaVariable.def_property_readonly("name", &storm::dd::DdMetaVariable<DdType>::getName);
ddMetaVariable.def_property_readonly("lowest_value", &storm::dd::DdMetaVariable<DdType>::getLow);
ddMetaVariable.def_property_readonly("type", &storm::dd::DdMetaVariable<DdType>::getType);
ddMetaVariable.def("__str__", &storm::dd::DdMetaVariable<DdType>::getName);
py::class_<storm::dd::DdManager<DdType>, std::shared_ptr<storm::dd::DdManager<DdType>>> ddManager(m, (std::string("DdManager_") + libstring).c_str());
@ -22,9 +23,18 @@ void define_dd(py::module& m, std::string const& libstring) {
dd.def_property_readonly("meta_variables", [](storm::dd::Dd<DdType> const& dd) {return dd.getContainedMetaVariables();}, "the contained meta variables");
py::class_<storm::dd::Bdd<DdType>> bdd(m, (std::string("Bdd_") + libstring).c_str(), "Bdd", dd);
bdd.def("to_expression", &storm::dd::Bdd<DdType>::toExpression, py::arg("expression_manager"));
}
void define_dd_nt(py::module& m) {
py::enum_<storm::dd::MetaVariableType>(m, "DdMetaVariableType")
.value("Int", storm::dd::MetaVariableType::Int)
.value("Bool", storm::dd::MetaVariableType::Bool)
.value("Bitvector", storm::dd::MetaVariableType::BitVector);
}
template void define_dd<storm::dd::DdType::Sylvan>(py::module& m, std::string const& libstring);

1
src/storage/dd.h

@ -5,3 +5,4 @@
template<storm::dd::DdType DdType>
void define_dd(py::module& m, std::string const& libname);
void define_dd_nt(py::module& m);
Loading…
Cancel
Save