- py::class_<simgrid::s4u::Link, std::unique_ptr<simgrid::s4u::Link, py::nodelete>> link(m, "Link", "Network link");
- link.def("set_latency", py::overload_cast<const std::string&>(&simgrid::s4u::Link::set_latency), "Set the latency")
- .def("set_latency", py::overload_cast<double>(&simgrid::s4u::Link::set_latency), "Set the latency")
- .def("set_sharing_policy", &simgrid::s4u::Link::set_sharing_policy, "Set sharing policy for this link")
- .def("set_concurrency_limit", &simgrid::s4u::Link::set_concurrency_limit, "Set concurrency limit for this link")
- .def("set_host_wifi_rate", &simgrid::s4u::Link::set_host_wifi_rate,
+ py::class_<simgrid::s4u::Link, std::unique_ptr<simgrid::s4u::Link, py::nodelete>> link(
+ m, "Link", "Network link. See the C++ documentation for details.");
+ link.def("set_latency", py::overload_cast<const std::string&>(&simgrid::s4u::Link::set_latency),
+ py::call_guard<py::gil_scoped_release>(),
+ "Set the latency as a string. Accepts values with units, such as ‘1s’ or ‘7ms’.\nFull list of accepted "
+ "units: w (week), d (day), h, s, ms, us, ns, ps.")
+ .def("set_latency", py::overload_cast<double>(&simgrid::s4u::Link::set_latency),
+ py::call_guard<py::gil_scoped_release>(), "Set the latency as a float (in seconds).")
+ .def("set_bandwidth", &simgrid::s4u::Link::set_bandwidth, py::call_guard<py::gil_scoped_release>(),
+ "Set the bandwidth (in byte per second).")
+
+ .def("turn_on", &simgrid::s4u::Link::turn_on, py::call_guard<py::gil_scoped_release>(), "Turns the link on.")
+ .def("turn_off", &simgrid::s4u::Link::turn_off, py::call_guard<py::gil_scoped_release>(), "Turns the link off.")
+ .def("is_on", &simgrid::s4u::Link::is_on, "Check whether the link is on.")
+
+ .def("set_sharing_policy", &simgrid::s4u::Link::set_sharing_policy, py::call_guard<py::gil_scoped_release>(),
+ "Set sharing policy for this link")
+ .def("set_concurrency_limit", &simgrid::s4u::Link::set_concurrency_limit,
+ py::call_guard<py::gil_scoped_release>(), "Set concurrency limit for this link")
+ .def("set_host_wifi_rate", &simgrid::s4u::Link::set_host_wifi_rate, py::call_guard<py::gil_scoped_release>(),