I am trying to schedule transportation for passengers to appointments at a facility. I am having problems controlling the wait time on the resulting route effectively. My test problem consists of 3 passengers located at various locations within 10 minutes of the single facility. One of the passengers has a 7:00 am appointment and the other two have a 10:00 appointment. I constructed the problem with six total orders and three order pairs as follows:
Orders: Passenger 1 - pickup quanity 1 located within 10 minutes of facility, service time .5 Passenger 2 - pickup quanity 1 located within 10 minutes of facility, service time .5 Passenger 3 - pickup quanity 1 located within 10 minutes of facility, service time .5 Facility 1 - delivery quanity 1, TimeWindowStart1 = 7:00, TimeWindowEnd1 = 7:05, service time .1 Facility 2 - delivery quanity 1, TimeWindowStart1 = 10:00, TimeWindowEnd1 = 10:05, service time .1 Facility 3 - delivery quanity 1, TimeWindowStart1 = 10:00, TimeWindowEnd1 = 10:05, service time .1
When I solve this problem, Passenger 1 and Facility 1 are unassigned. The route created is: Passenger 2 - Arrive at: 9:46 Passenger 3 - Arrive at 9:56 Facility 2 - Arrive at 10:04 Facility 3 - Arrive at 10:05
If I increase the MaxTransitTime in the order pairs to 240, the problem will solve with the resulting solution:
Passenger 1 - Arrive at: 6:51 - Depart at 6:51 Facility 1 - Arrive at 7:05 - Depart at 7:05 Passenger 2 - Arrive at 7:16 - Depart at 7:17 Passenger 3 - Arrive at 7:27 - Depart at 7:27 Facility 2 - Arrive at 7:35 - Depart at 10:00 - Wait time 145 Facility 3 - Arrive at 10:00 - Depart at 10:00
I need to control the location of the wait time. It is obvious that my original set of constraints can easily be met if there is a mechanism to ask the vehicle to wait between Facility 1 and Passenger 2. How can I accomplish this? Am I missing some type of configuration that allows slack or wait time?
You need to add the pickup time window to avoid the wait time between Facility 2 and Facility 3. VRP solver will only apply the wait time in front of the orders with time windows. You may try to add the pickup time window for passenger 2 and 3 (i.e. [9am, 10am]) and see whether the solution meets your expectation.