py::class_<Place,std::shared_ptr<Place>>(m,"Place","Place in a GSPN")
.def(py::init<uint64_t>(),"id"_a)
.def("get_name",&Place::getName,"Get name of this place")
.def("set_name",&Place::setName,"name"_a,"Set name of this place")
.def("get_id",&Place::getID,"Get the id of this place")
.def("set_number_of_initial_tokens",&Place::setNumberOfInitialTokens,"tokens"_a,"Set the number of initial tokens of this place")
.def("get_number_of_initial_tokens",&Place::getNumberOfInitialTokens,"Get the number of initial tokens of this place")
.def("set_capacity",&Place::setCapacity,"cap"_a,"Set the capacity of tokens of this place")
.def("get_capacity",&Place::getCapacity,"Get the capacity of tokens of this place")
.def("has_restricted_capacity",&Place::hasRestrictedCapacity,"Is capacity of this place restricted")
;
// TimedTransition class
// ImmediateTransition
// GSPN class
// GSPN class
py::class_<GSPN,std::shared_ptr<GSPN>>(m,"GSPN","Generalized Stochastic Petri Net")
py::class_<GSPN,std::shared_ptr<GSPN>>(m,"GSPN","Generalized Stochastic Petri Net")
.def("name",&GSPN::getName,"Name of GSPN")
.def("name",&GSPN::getName,"Name of GSPN")
@ -46,7 +64,6 @@ void define_gspn(py::module& m) {
// todo: boost::optional<uint64_t> capacity
// todo: boost::optional<uint64_t> capacity
//.def("add_place", &GSPNBuilder::addPlace, "Add a place to the GSPN", py::arg("capacity") = 1, py::arg("initialTokens") = 0, py::arg("name") = "")
//.def("add_place", &GSPNBuilder::addPlace, "Add a place to the GSPN", py::arg("capacity") = 1, py::arg("initialTokens") = 0, py::arg("name") = "")
//.def("set_place_layout_info", &GSPNBuilder::setPlaceLayoutInfo, "Set place layout information", py::arg("placeId"), py::arg("layoutInfo"))
//.def("set_place_layout_info", &GSPNBuilder::setPlaceLayoutInfo, "Set place layout information", py::arg("placeId"), py::arg("layoutInfo"))
.def("add_immediate_transition",&GSPNBuilder::addImmediateTransition,"Adds an immediate transition to the GSPN",py::arg("priority")=0,py::arg("weight")=0,py::arg("name")="")
.def("add_immediate_transition",&GSPNBuilder::addImmediateTransition,"Adds an immediate transition to the GSPN",py::arg("priority")=0,py::arg("weight")=0,py::arg("name")="")
@ -63,8 +80,8 @@ void define_gspn(py::module& m) {
.def("add_normal_arc",&GSPNBuilder::addNormalArc,"Add normal arc from a named element to a named element",py::arg("from"),py::arg("to"),py::arg("multiplicity")=1)
.def("add_normal_arc",&GSPNBuilder::addNormalArc,"Add normal arc from a named element to a named element",py::arg("from"),py::arg("to"),py::arg("multiplicity")=1)