-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding compatability for upstream vroom. #121
base: main
Are you sure you want to change the base?
Changes from 2 commits
495526c
fc46276
d2c95ab
9a0391e
2970f62
deb1042
06cf96c
b6c24e8
ec593b0
ce64ecf
7ed6e6f
991e9e4
ab0bca9
39d4e1f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,17 +13,18 @@ void init_input(py::module_ &m) { | |
|
||
py::class_<vroom::Input>(m, "Input") | ||
.def( | ||
py::init([](const vroom::io::Servers &servers, vroom::ROUTER router) { | ||
return new vroom::Input(servers, router); | ||
py::init([](const vroom::io::Servers &servers, vroom::ROUTER router, bool apply_TSPFix) { | ||
return new vroom::Input(servers, router, apply_TSPFix); | ||
}), | ||
"Class initializer.", | ||
py::arg("servers") = std::map<std::string, vroom::io::Servers>(), | ||
py::arg("router") = vroom::ROUTER::OSRM) | ||
py::arg("router") = vroom::ROUTER::OSRM, | ||
py::arg("apply_TSPFix") = false) | ||
.def_readonly("jobs", &vroom::Input::jobs) | ||
.def_readonly("vehicles", &vroom::Input::vehicles) | ||
.def("_from_json", &vroom::io::parse, py::arg("json_string"), | ||
py::arg("geometry")) | ||
.def("_set_amount_size", &vroom::Input::set_amount_size) | ||
/* .def("_set_amount_size", &vroom::Input::set_amount_size) */ | ||
.def("_set_geometry", &vroom::Input::set_geometry) | ||
.def("_add_job", &vroom::Input::add_job) | ||
.def("_add_shipment", &vroom::Input::add_shipment) | ||
|
@@ -51,9 +52,12 @@ void init_input(py::module_ &m) { | |
.def("has_homogeneous_locations", | ||
&vroom::Input::has_homogeneous_locations) | ||
.def("has_homogeneous_profiles", &vroom::Input::has_homogeneous_profiles) | ||
.def("has_homogeneous_costs", &vroom::Input::has_homogeneous_costs) | ||
// .def("vehicle_ok_with_job", &vroom::Input::vehicle_ok_with_job) | ||
.def("_solve", &vroom::Input::solve, "Solve problem.", | ||
py::arg("exploration_level"), py::arg("nb_threads") = 1, | ||
py::arg("nb_searches"), | ||
py::arg("depth"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the The Having a simple knob to use on a scale from 0 to 5 is actually convenient from a user perspective because everything is already tuned internally and you don't have to understand what the underlying parameters are about. Maybe that's what we'd also like to expose from pyvroom to offer the same interface? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think have the parameters consistent would be a good idea, yeah. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What we could do if it helps is to keep an overload of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we can have that, that would be great, yes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jonathf done in VROOM-Project/vroom#1197, let me know if that's OK and I'll merge. |
||
py::arg("nb_threads") = 1, | ||
py::arg("timeout") = vroom::Timeout(), | ||
py::arg("h_param") = std::vector<vroom::HeuristicParameters>()) | ||
.def("check", &vroom::Input::check); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jcoupey, seems like
vroom::Input::set_amount_size
is removed. Is the feature deprecated or just moved somewhere else?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we still store
_amount_size
as an optional. It's just that it used to be user-defined which is not really convenient. Now we infer the expected size for amount/capacity arrays directly ourselves in theInput
class while adding stuff.This is more convenient from the user perspective (not having to provide a somewhat redundant info). Also it allows to move some checks upstream in the
Input
class in the light of VROOM-Project/vroom#1086.