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?
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?
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.