1
0
Fork 0
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:
oblonski 2015-12-18 08:01:08 +01:00
parent 06fa714ffd
commit b012730dde
2 changed files with 10 additions and 0 deletions

View file

@ -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);
}