private SizeDimension calcSizeAt(boolean start) { SizeDimension size = SizeDimension.EMPTY; for (JobActivity act : activityList.getAll()) { size = size.add(act.getLoadChange()); } if (start) return size.getNegativeDimensions().abs(); else return size.getPositiveDimensions(); }
protected void prepareCaches() { allLocations = new ArrayList<>(); allTimeWindows = new LinkedHashSet<>(); activityList .getAll() .stream() .forEach( ja -> { addLocation(ja.getLocation()); addTimeWindows(ja.getTimeWindows()); }); sizeAtStart = calcSizeAt(true); sizeAtEnd = calcSizeAt(false); }