we are using optaplanner to try to improve our current vehicle routes with time windows. We have a few smaller issues which we are not sure how to overcome:
- Our drivers need to have to have a 30 minutes lunch break, somewhere between 3rd and 5th hour of their shift (from the start of their drive), and if the drive is shorter than 5 hours - no break is required.
- We have to make sure that some packages (but not all) get back to the depot by a certain time. For example, some customer would have a pick-up time from 8:00 to 8:30 but their package / parcel has to be returned to depot by 12:00.
Our current idea for the second problem is to create two new classes:
public class ReturningCustomer extends TimeWindowedCustomer {
protected int returningId;
and
public class ReturnToDepot extends TimeWindowedCustomer {
protected int returningId;
where the first one models the customer with special packages, which are to be returned. The second one is the “fake” customer that represents the driver’s return to the depot. ReturnToDepot would have the same location as the depot itself. Comparing their ids in Drools will assure that they are on the same vehicle’s path. Treating the ReturnToDepot as another customer would hopefully assure that the planner finds an optimal way to put it into a route.
However, for the lunch break modeling, we are not quite sure what to do.
Is there a better way to model this? What would be the best way to model the lunch breaks? Are there any samples which could point us to the right direction?
Thanks.