| 43 | namespace python { |
| 44 | |
| 45 | void Random(py::module& m) |
| 46 | { |
| 47 | ::py::class_<dart::math::Random>(m, "Random") |
| 48 | .def(::py::init<>()) |
| 49 | .def_static( |
| 50 | "setSeed", |
| 51 | +[](unsigned int seed) { dart::math::Random::setSeed(seed); }, |
| 52 | ::py::arg("seed")) |
| 53 | .def_static( |
| 54 | "getSeed", |
| 55 | +[]() -> unsigned int { return dart::math::Random::getSeed(); }) |
| 56 | .def_static( |
| 57 | "uniform", |
| 58 | +[](double min, double max) -> double { |
| 59 | return dart::math::Random::uniform(min, max); |
| 60 | }, |
| 61 | ::py::arg("min"), |
| 62 | ::py::arg("max")); |
| 63 | } |
| 64 | |
| 65 | } // namespace python |
| 66 | } // namespace dart |
no outgoing calls