From 10eea677e978ea8ad7d6c08aa0d43c84ba0c913a Mon Sep 17 00:00:00 2001 From: Sebastian Junges Date: Mon, 8 Jan 2018 15:54:57 +0100 Subject: [PATCH] Add support for integer cast from state objects --- src/storage/state.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/storage/state.cpp b/src/storage/state.cpp index fadd676..b13c887 100644 --- a/src/storage/state.cpp +++ b/src/storage/state.cpp @@ -17,12 +17,14 @@ void define_state(py::module& m) { .def_property_readonly("id", &SparseModelState::getIndex, "Id") .def_property_readonly("labels", &SparseModelState::getLabels, "Labels") .def_property_readonly("actions", &SparseModelState::getActions, "Get actions") + .def("__int__",&SparseModelState::getIndex) ; py::class_>(m, "SparseParametricModelState", "State in sparse parametric model") .def("__str__", &SparseModelState::toString) .def_property_readonly("id", &SparseModelState::getIndex, "Id") .def_property_readonly("labels", &SparseModelState::getLabels, "Labels") .def_property_readonly("actions", &SparseModelState::getActions, "Get actions") + .def("__int__",&SparseModelState::getIndex) ; // SparseModelActions