Allocate new vehicle if condition is met #2338
Unanswered
glazaridis
asked this question in
Routing (and legacy CP) questions
Replies: 1 comment 1 reply
-
|
first, I would try to find the first visit using the following code: all_visit_locations = [2, 3, ....]
# Not sure min is defined but let's suppose it is
first_visit_cumulvar = min([distance/time_dim.CumulVar(manager.NodeToIndex(node)) for node in all_visit_location)])Then I'll would add a constraint that the extra vehicle (of index routing.solver().Add((first_visit_cumulvar >= your_constraint_C) == routing.ActiveVehicleVar(vehicle_id))ref: or-tools/ortools/constraint_solver/routing.h Lines 1198 to 1202 in b77bd3a |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all, is there any way to allocate a new vehicle when a distance constraint
Cfrom depot to first visiting node is met?Thank you for your time and consideration.
Beta Was this translation helpful? Give feedback.
All reactions