mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
avoid overlapping time windows
This commit is contained in:
parent
06fa714ffd
commit
b012730dde
2 changed files with 10 additions and 0 deletions
|
|
@ -19,6 +19,9 @@ public class TimeWindowsImpl implements TimeWindows {
|
|||
if(timeWindow.getEnd() > tw.getStart() && timeWindow.getEnd() < tw.getEnd()){
|
||||
throw new IllegalStateException("time-windows cannot overlap each other. overlap: " + tw + ", " + timeWindow);
|
||||
}
|
||||
if(timeWindow.getStart() <= tw.getStart() && timeWindow.getEnd() >= tw.getEnd()){
|
||||
throw new IllegalStateException("time-windows cannot overlap each other. overlap: " + tw + ", " + timeWindow);
|
||||
}
|
||||
}
|
||||
timeWindows.add(timeWindow);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue