From 69cdae39a315a8f33d6634d5ca849f82f3b6834e Mon Sep 17 00:00:00 2001 From: Sebastian Junges Date: Tue, 14 Apr 2020 22:19:55 -0700 Subject: [PATCH] nr available actions --- src/storage/model.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/storage/model.cpp b/src/storage/model.cpp index 62fb56d..be250a7 100644 --- a/src/storage/model.cpp +++ b/src/storage/model.cpp @@ -194,6 +194,7 @@ void define_sparse_model(py::module& m) { py::class_, std::shared_ptr>>(m, "SparseMdp", "MDP in sparse representation", model) .def(py::init>(), py::arg("other_model")) .def_property_readonly("nondeterministic_choice_indices", [](SparseMdp const& mdp) { return mdp.getNondeterministicChoiceIndices(); }) + .def("get_nr_available_actions", [](SparseMdp const& mdp, uint64_t stateIndex) { return mdp.getNondeterministicChoiceIndices()[stateIndex+1] - mdp.getNondeterministicChoiceIndices()[stateIndex] ; }, py::arg("state")) .def("apply_scheduler", [](SparseMdp const& mdp, storm::storage::Scheduler const& scheduler, bool dropUnreachableStates) { return mdp.applyScheduler(scheduler, dropUnreachableStates); } , "apply scheduler", "scheduler"_a, "drop_unreachable_states"_a = true) .def("__str__", &getModelInfoPrinter) ;