As far as I can figure it out, it wouldn’t be easy to do this.
The problem with breaks that it has no location. This is the main difference between breaks and jobs. It is taken at the location of the last activity before the break or on the route to the next activity. In short, it has no location, no movement, no travel cost. This is why it is handled specially and at the moment, there is only one break is available per vehicle.
If you have only single activity jobs (no shipments) and the break has a fix time, a rough approximation would be implemented by solving the problem in several steps. Let’s see an example:
There is a vehicle working from 8:00 till 16:00. It has 2 breaks: 10:00 - 10:30 and 14:00 - 14:30. Now you could split the problem into three. You define 3 vehicles instead of 1:
- Vehicle #1 has a time window of 8:00 till 10:00
- Vehicle #2 has a time window of 10:30 till 14:00
- Vehicle #3 has a time window of 14:30 till 16:00
First you pick all the jobs with time window which has intersection with the time window of the first vehicle. (All jobs which has to done or may be done before the first break.) Run the optimalization on these subset of jobs using the first vehicle. You get a solution and possible some unassigned tasks. Now you take the jobs within the time window of Vehicle #2, add to them the unassigned jobs from the previous iteration, set the start location of the vehicle to the location of the last activity of the first solution and run the optimalization on this configuration. Now you have two solutions. Repeat this on the third vehicle similarly.
Finally, combine the three solutions.
This is not perfect, most probably it would left out some jobs (especially, when there are a lot of time windows overlaping the breaks), but I can’t think of a better solution as for now.
(PS: I am making a proposal for improvement to support jobs with no location. With this feature combined with the also upcomming mandatory job would offer a more flexible solution. But it would take some time and would be available no sooner than the new major version of the framework – meaning months from now.)