diff --git a/lib/stormpy/__init__.py b/lib/stormpy/__init__.py index d3c7e881b..901ad52b5 100644 --- a/lib/stormpy/__init__.py +++ b/lib/stormpy/__init__.py @@ -602,11 +602,11 @@ def parse_properties(properties, context=None, filters=None): if context.is_prism_program(): return core.parse_properties_for_prism_program(properties, context.as_prism_program(), filters) else: - core.parse_properties_for_jani_program(properties, context.as_jani_model(), filters) + return core.parse_properties_for_jani_program(properties, context.as_jani_model(), filters) elif type(context) == storage.PrismProgram: return core.parse_properties_for_prism_program(properties, context, filters) elif type(context) == storage.JaniModel: - core.parse_properties_for_jani_model(properties, context, filters) + return core.parse_properties_for_jani_model(properties, context, filters) else: raise StormError("Unclear context. Please pass a symbolic model description") diff --git a/src/storage/bitvector.cpp b/src/storage/bitvector.cpp index 9718695e5..fa53f88c7 100644 --- a/src/storage/bitvector.cpp +++ b/src/storage/bitvector.cpp @@ -21,6 +21,7 @@ void define_bitvector(py::module& m) { .def("set", [](BitVector& b, uint_fast64_t i, bool v) { b.set(i, v); }, py::arg("index"), py::arg("value") = true, "Set") + .def("as_int", &BitVector::getAsInt, py::arg("index"), py::arg("no_bits"), "Get as unsigned int") .def("__len__", [](BitVector const& b) { return b.size(); }) .def("__getitem__", [](BitVector const& b, uint_fast64_t i) { @@ -49,7 +50,9 @@ void define_bitvector(py::module& m) { .def(py::self |= py::self) .def("__str__", &streamToString) - + .def("__hash__", [](const BitVector &b) { + return storm::storage::Murmur3BitVectorHash()(b); + }) ; } diff --git a/src/storage/model.cpp b/src/storage/model.cpp index d498ec430..60602acd9 100644 --- a/src/storage/model.cpp +++ b/src/storage/model.cpp @@ -209,6 +209,7 @@ void define_sparse_model(py::module& m, std::string const& vtSuffix) { .def("labels_state", &SparseModel::getLabelsOfState, py::arg("state"), "Get labels of state") .def_property_readonly("initial_states", &getSparseInitialStates, "Initial states") .def_property_readonly("initial_states_as_bitvector", [](SparseModel const& model) {return model.getInitialStates();}) + .def("set_initial_states", &SparseModel::setInitialStates, py::arg("states"), "Set initial states") .def_property_readonly("states", [](SparseModel& model) { return SparseModelStates(model); }, "Get states")