Thanks for your reply. I will explore
"SetBreakIntervalsOfVehicle" to manage driver shift management. Is there another way to resolve this issue?
I tried to add shift time as constraint in the time dimension as explained by Mizux
'''
for vehicle in range(manager.GetNumberOfVehicles()):
start_index = routing.Start(vehicle)
print(start_index)
end_index = routing.End(vehicle)
print(end_index)
shift_start_time_window=data_model["shift_start_time_window"][vehicle]
print(shift_start_time_window)
shift_end_time_window=data_model["shift_end_time_window"][vehicle]
print(shift_end_time_window)
time_dimension.CumulVar(start_index).SetRange(shift_start_time_window[0], shift_start_time_window[1])
time_dimension.CumulVar(end_index).SetRange(shift_end_time_window[0], shift_end_time_window[1])
# can also create some constraint on shift duration
MAX_SHIFT_DURATION=720
routing.solver().Add(time_dimension.CumulVar(end_index) - time_dimension.CumulVar(start_index) <= MAX_SHIFT_DURATION) ''''
In that case I have taken 20 delivery stops and 1 depot. That means the total length of data is 21. Two driver working in two different shifts such as
data_model['shift_start_time_window']=[[480,495],[900,915]]
data_model['shift_end_time_window']=[[1020,1035],[1440,1455]]
The output of shift time constraint is
0
22
[480, 495]
[1020, 1035]
21
23
[900, 915]
[1440, 1455]
But I did not understand why the start and end index of the first driver is 0,22 and the second driver index is 21,23.
How can I match this index with the index of the original dataframe(0,21).
Can anybody explain? There is a special request to @Mizux.