Hi everyone, I’ve got a problem when using TimeWindows on a Service.
I’m using the Service.addTimeWindow(double earliest, double latest) method to configure a TimeWindow on a service, providing time information in second unit.
I’ve also got Vehicles with earliest departure and latest arrival (always in seconds).
If I do put a TimeWindow that cannot be satisfied considering Vehicle working hours, that is skipped as expected and categorized as unassigned job.
Eg: Service has TW between 8am and 9am, Vehicles starts at 10am -> TW = ignored (correct)
If the TimeWindow in instead inside the Vehicle working hours, the result I get is random, sometimes it is respected, some others not, some others it shifts all the other Services of that day just after the TimeWindow.latest property.
Eg: Service has TW between 8am and 9am, Vehicles starts at 7am -> TW = random behavior
Why this happens?
Do I need to set some other specific property?
In Jsprit, a time window on an activity imposes the constraint that the start time of the activity cannot be outside the time window. Note the difference between start time and arrival time.
For example, if a Service has a time window 8am - 9am, this means the start time of the Service activity must be between 8am and 9am. The arrival time could be before 8am, then the vehicle will wait at the location and start the Service activity at 8am; the arrival time could be between 8am and 9am, then the Service activity could start immediately after arrival; and the arrival time cannot be after 9am.