return cachedGaps;
}
private List<GapOnQueue> calculateGaps() {
List<Gap> result = new ArrayList<Gap>();
DateAndHour previousEnd = null;
ResourceCalendar calendar = resource.getCalendar();
List<CalendarAvailability> activationPeriods = calendar.getCalendarAvailabilities();
for (LimitingResourceQueueElement each : limitingResourceQueueElements) {
DateAndHour startTime = each.getStartTime();
if (previousEnd == null || startTime.isAfter(previousEnd)) {
List<GapInterval> gapIntervals = GapInterval.
create(previousEnd, startTime).
delimitByActivationPeriods(activationPeriods);
if (!gapIntervals.isEmpty()) {
result.addAll(GapInterval.gapsOn(gapIntervals, resource));