Marpec
Marpec

Reputation: 11

Optaplanner vehicle starting and ending time

This Optaplanner is really very useful. I do have a few questions, though.

I am doing a time-windowed problem, and can't find exact information about the route start and end. The Depot.readyTime and dueTime are taken into account, but just as a constraint. Is there any point where I could find the route start time directly, or do I need to get the ArrivalTime to first customer and subtract the travel time from depot (analogously for the last one)?

Very connected to this is the question if I can limit the working time of the vehicle?

And the last one from this batch is - is it possible to schedule lunch breaks for the drivers (and how)?

Thank you!

Upvotes: 0

Views: 182

Answers (1)

Geoffrey De Smet
Geoffrey De Smet

Reputation: 27312

Limiting the working time of the vehicle is a matter of having the VariableListener set the back to depot arrivalTime on each vehicle and then adding a constraint (score rule) to check if it's not too late.

Scheduling lunch breaks is usually best done by adjusting the VariableListener to when it calculates the arrivalTime for the next visit, automatically add an hour if the previous visit crossed the "noon" time.

Upvotes: 1

Related Questions