Delaying driver start until necessary

The algorithm is dispatching drivers at shift’s start even if the jobs provided start late, causing the driver to wait at the job’s location until it’s ready. I’ve tried augmenting the waiting cost but the result continues to be the same.

Is this the expected behavior, or am I missing a flag or something like that to take this into account?

Thanks in advance for any help

Variable/dynamic/flexible (or whatever you call it) vehicle start time is not yet implemented in Jsprit.

As Stefan said in this post:

Currently, the vehicle’s departure time is a hard physical constaint, i.e. earliestStart of vehicle is always the actual departure time.

Best regards,
He

Is there a roadmap for this I can contribute with? Or is it something that could be done single-handedly? If the latter is true, could you provide some hints to start with?

Thanks for any help.

Perhaps you can take a look at Jsprit’s playground. Note that the codes are a bit out of date, though.

Best regards,
He

I’ll take a look at it, try to make it work, and report back. Thanks for the hint.

Reading through the example, does the maxDriverTime variable conflict with the vehicle’s shift property or does it correspond to a time when the variable was not implemented yet? In such case, could it be replaced by vehicle.latestArrival - vehicle.earliestStart?

EDIT: After running tests on the code, I’ve noticed that when there are open-ended routes (no endLocation and returnToDepot is false), the start of the End activity is the only one off. This is caused on the end listener by the function setVehicleAndDepartureTime. This function internally sets the new end’s location as the vehicle parameter’s end location.

Since it has as parameter the route’s vehicle which had no declared endLocation it gets instead its startLocation as shown in the VehicleImpl.Builder’s build method.

Is this the expected behavior?

Two ways to solve this, none which convince me, are to override the route’s end time inside the listener or override the finish method from the ActivityTimeTracker class to consider returnToDepot at the moment of calculating transport time.

Any idea on how to solve this more elegantly is welcomed.