Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple time windows per location #8

Open
daniel-j-h opened this issue Apr 18, 2017 · 4 comments
Open

Multiple time windows per location #8

daniel-j-h opened this issue Apr 18, 2017 · 4 comments

Comments

@daniel-j-h
Copy link
Contributor

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).
@Herteby
Copy link

Herteby commented Jun 9, 2017

Aah, good to hear!
Hmm, I haven't used C++ since high school though... 😟
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...

@daniel-j-h
Copy link
Contributor Author

Here are som epointers:

  • TimeWindows is 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

@ivosabev
Copy link
Contributor

Any status on this? This will be quite useful.

@daniel-j-h
Copy link
Contributor Author

#26 is a first take on it. You can test it, run it out to completion, and then use it I guess.

KhaledSakr pushed a commit to impargo/node-or-tools that referenced this issue Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants