Multiple time windows per location
We should expose the possibility to specify multiple time windows per location.
Use-case: you can service a location between 9am--11am and between 1pm--3pm.
Implementation:
- Sort intervals per location by start then stop, assert for non-overlapping
- Take the min and max and set
CumulVar(n)->SetRange(minStart, maxStop) - Walk over adjacent intervals and remove in between
CumulVar(n)->RemoveInterval(stop, start).
Aah, good to hear! Hmm, I haven't used C++ since high school though... :worried: So timeDimension.CumulVar(node) returns the time window for the node, which is of the class IntVar. IntVar already supports "holes", and once set up the solver will handle them automatically, right? It's just that you haven't set it up yet.
Maybe I can figure this out...
Here are som epointers:
TimeWindowsis a vector of[start, stop]- Here is where we store the parsed time window for each location
- Here we parse the time windows
- Here is where you need to add the ranges
Any status on this? This will be quite useful.
https://github.com/mapbox/node-or-tools/pull/26 is a first take on it. You can test it, run it out to completion, and then use it I guess.