Get the minimum and maximum allowed distance between the global source and a {@link TimePoint}.
@param tpTo the {@link TimePoint} whose temporal placement should be queried.
@return The allowed bounds of the {@link TimePoint}.
359455
public final Bounds getAdmissibleDistanceBounds(TimePoint tpTo) {
		final APSPSolver stpSolver = (APSPSolver) constraintSolvers[0];
		return stpSolver.getDistanceBounds(stpSolver.getSource(), tpTo);
	}
532275
public long getRangeTo() {
		final long limit = (liveUpdated ? database.getStorage().getClusterDataRange(current.clusterId)[1] : lastClusterPosition) + 1;
		if (rangeTo > -1)
			return Math.min(rangeTo, limit);
		return limit;
	}
931595
public Iterable<StopTime> getInterpolatedStopTimesForTrip (String trip_id) throws FirstAndLastStopsDoNotHaveTimes {
        // clone stop times so as not to modify base GTFS structures
        StopTime[] stopTimes = StreamSupport.stream(getOrderedStopTimesForTrip(trip_id).spliterator(), false)
                .map(st -> st.clone())
                .toArray(i -> new StopTime[i]);

        // avoid having to make sure that the array has length below.
        if (stopTimes.length == 0) return Collections.emptyList();

        // first pass: set all partially filled stop times
        for (StopTime st : stopTimes) {
            if (st.arrival_time != Entity.INT_MISSING && st.departure_time == Entity.INT_MISSING) {
                st.departure_time = st.arrival_time;
            }

            if (st.arrival_time == Entity.INT_MISSING && st.departure_time != Entity.INT_MISSING) {
                st.arrival_time = st.departure_time;
            }
        }

        // quick check: ensure that first and last stops have times.
        // technically GTFS requires that both arrival_time and departure_time be filled at both the first and last stop,
        // but we are slightly more lenient and only insist that one of them be filled at both the first and last stop.
        // The meaning of the first stop's arrival time is unclear, and same for the last stop's departure time (except
        // in the case of interlining).

        // it's fine to just check departure time, as the above pass ensures that all stop times have either both
        // arrival and departure times, or neither
        if (stopTimes[0].departure_time == Entity.INT_MISSING || stopTimes[stopTimes.length - 1].departure_time == Entity.INT_MISSING) {
            throw new FirstAndLastStopsDoNotHaveTimes();
        }

        // second pass: fill complete stop times
        int startOfInterpolatedBlock = -1;
        for (int stopTime = 0; stopTime < stopTimes.length; stopTime++) {

            if (stopTimes[stopTime].departure_time == Entity.INT_MISSING && startOfInterpolatedBlock == -1) {
                startOfInterpolatedBlock = stopTime;
            }
            else if (stopTimes[stopTime].departure_time != Entity.INT_MISSING && startOfInterpolatedBlock != -1) {
                throw new RuntimeException("Missing stop times not supported.");
            }
        }

        return Arrays.asList(stopTimes);
    }
236884
T getTemporalOfClosedStart() {

        T temporal = this.start.getTemporal();

        if (temporal == null) {
            throw new UnsupportedOperationException(
                "An infinite interval has no finite duration.");
        } else if (this.start.isOpen()) {
            return this.getTimeLine().stepForward(temporal);
        } else {
            return temporal;
        }

    }
66982
private int getTimeSlice(Instant timestamp) {
        long value = times.getTime(timestamp) / TIMESLICE_INTERVAL;
        if (value>Integer.MAX_VALUE || value<0) throw new IllegalArgumentException("Timestamp overflow detected: " + timestamp);
        return (int)value;
    }
386853
@Override
	public int compareTo(Object arg0) {
		Interval that = (Interval)arg0;
		return this.bounds.compareTo(that.getBounds());
	}
1139492
private void tpDelete(int[] IDtimePoint) {
		logger.finest("Deleting " + IDtimePoint.length + " TP");
		for (int i = 0; i < IDtimePoint.length; i++) {
			tPoints[IDtimePoint[i]].setUsed(false);

			if (IDtimePoint[i] == MAX_USED) MAX_USED--;

			SimpleDistanceConstraint conO = new SimpleDistanceConstraint();
			SimpleDistanceConstraint conH = new SimpleDistanceConstraint();
			conO.setFrom(this.getVariable(0));
			conO.setTo(this.getVariable(IDtimePoint[i]));
			conH.setFrom(this.getVariable(IDtimePoint[i]));
			conH.setTo(this.getVariable(1));

			conO.setMinimum(0);
			conO.setMaximum(H-O);
			conH.setMinimum(0);
			conH.setMaximum(H-O);

			conO.addInterval(new Bounds(0,H-O));
			conH.addInterval(new Bounds(0,H-O));

			//[lb,ub] = [-di0,d0i]
			tPoints[IDtimePoint[i]].setLowerBound(O);
			tPoints[IDtimePoint[i]].setUpperBound(H);
			tPoints[0].setOut(IDtimePoint[i],conO);
			tPoints[IDtimePoint[i]].setOut(1,conH);
		}

		fromScratchDistanceMatrixComputation();
	}
622804
def _calculate_bounds(self):
        """"""
        if self._bounds_calculated:
            # Assume no need to recalc bounds for lifetime of a Logfile object
            return

        if self.from_stdin:
            return False

        # we should be able to find a valid log line within max_start_lines
        max_start_lines = 10
        lines_checked = 0

        # get start datetime
        for line in self.filehandle:
            logevent = LogEvent(line)
            lines_checked += 1
            if logevent.datetime:
                self._start = logevent.datetime
                self._timezone = logevent.datetime.tzinfo
                self._datetime_format = logevent.datetime_format
                self._datetime_nextpos = logevent._datetime_nextpos
                break
            if lines_checked > max_start_lines:
                break

        # sanity check before attempting to find end date
        if (self._start is None):
            raise SystemExit("Error: <%s> does not appear to be a supported "
                             "MongoDB log file format" % self.filehandle.name)

        # get end datetime (lines are at most 10k,
        # go back 30k at most to make sure we catch one)
        self.filehandle.seek(0, 2)
        self._filesize = self.filehandle.tell()
        self.filehandle.seek(-min(self._filesize, 30000), 2)

        for line in reversed(self.filehandle.readlines()):
            logevent = LogEvent(line)
            if logevent.datetime:
                self._end = logevent.datetime
                break

        # if there was a roll-over, subtract 1 year from start time
        if self._end < self._start:
            self._start = self._start.replace(year=self._start.year - 1)
            self._year_rollover = self._end
        else:
            self._year_rollover = False

        # reset logfile
        self.filehandle.seek(0)
        self._bounds_calculated = True

        return True
328425
public static Bbox getBounds(Geometry geometry) {
		if (geometry == null) {
			throw new IllegalArgumentException("Cannot get bounds for null geometry.");
		}
		if (isEmpty(geometry)) {
			return null;
		}
		Bbox bbox = null;
		if (geometry.getGeometries() != null) {
			bbox = getBounds(geometry.getGeometries()[0]);
			for (int i = 1; i < geometry.getGeometries().length; i++) {
				bbox = BboxService.union(bbox, getBounds(geometry.getGeometries()[i]));
			}
		}
		if (geometry.getCoordinates() != null) {
			double minX = Double.MAX_VALUE;
			double minY = Double.MAX_VALUE;
			double maxX = -Double.MAX_VALUE;
			double maxY = -Double.MAX_VALUE;

			for (Coordinate coordinate : geometry.getCoordinates()) {
				if (coordinate.getX() < minX) {
					minX = coordinate.getX();
				}
				if (coordinate.getY() < minY) {
					minY = coordinate.getY();
				}
				if (coordinate.getX() > maxX) {
					maxX = coordinate.getX();
				}
				if (coordinate.getY() > maxY) {
					maxY = coordinate.getY();
				}
			}
			if (bbox == null) {
				bbox = new Bbox(minX, minY, maxX - minX, maxY - minY);
			} else {
				bbox = BboxService.union(bbox, new Bbox(minX, minY, maxX - minX, maxY - minY));
			}
		}
		return bbox;
	}
382372
synchronized Weight getMinimumStart() {
        if (calcMinStart == null) {
            // Find the shortest distance from a start to time zero.
            Weight result = WeightFactory.NEG_INFINITY;
            if (shortestDistancesFromTimeZeroDestination == null) {
                shortestDistancesFromTimeZeroDestination = BellmanFord.calcShortestDistances(timeZero, directedGraph,
                        BellmanFord.Mode.DESTINATION);

                if (shortestDistancesFromTimeZeroDestination == null) {
                    throw new IllegalStateException("Negative cycle detected!");
                }
            }
            for (int i = 0, n = intervals.size(); i < n; i++) {
                Object start = intervals.get(i).getStart();
                result = Weight.max(result,
                        (Weight) shortestDistancesFromTimeZeroDestination.get(start));
            }
            calcMinStart = result.invertSign();
        }

        return calcMinStart;
    }
647487
public static int max(IntTuple t)
    {
        return IntTupleFunctions.reduce(
            t, Integer.MIN_VALUE, Math::max);
    }
1192293
public SIMPIterator getPtoPInboundReceiverIterator()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getPtoPInboundReceiverIterator");

    TargetStreamManager tsm = inputHandler.getTargetStreamManager();
    SIMPIterator itr = tsm.getTargetStreamSetControlIterator();
  
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getPtoPInboundReceiverIterator", itr);

    return itr;
  }
872945
public TimePoint getTimePoint(int Id) {
		if (Id >= MAX_TPS) return null;
		if (tPoints[Id] == null) return null;
		if (!tPoints[Id].isUsed()) return null;
		return tPoints[Id];
	}
1072126
public long maxTimestamp()
  {
    return ranges == null
            ? topLevel.markedForDeleteAt
            : Math.max(topLevel.markedForDeleteAt, ranges.maxMarkedAt());
  }
352790
private void checkBounds(String source, Integer from, Integer to) throws TransformationOperationException {
        Integer length = source.length();
        if (from > to) {
            throw new TransformationOperationException(
                "The from parameter is bigger than the to parameter");
        }
        if (from < 0 || from > length) {
            throw new TransformationOperationException(
                "The from parameter is not fitting to the size of the source");
        }
        if (to < 0 || to > length) {
            throw new TransformationOperationException(
                "The to parameter is not fitting to the size of the source");
        }
    }
185806
public TreeSet<TrajectoryEnvelope> getGroundEnvelopes() {
		TreeSet<TrajectoryEnvelope> ret = new TreeSet<TrajectoryEnvelope>(new Comparator<TrajectoryEnvelope>() {
			@Override
			public int compare(TrajectoryEnvelope o1, TrajectoryEnvelope o2) {
				Bounds o1b = new Bounds(o1.getTemporalVariable().getEST(),o1.getTemporalVariable().getEET());
				Bounds o2b = new Bounds(o2.getTemporalVariable().getEST(),o2.getTemporalVariable().getEET());
				if (o2b.min-o1b.min > 0) return -1;
				else if (o2b.min-o1b.min == 0) return 0;
				return 1;
			}
		});			
		if (this.getSubEnvelopes() != null) {
			for (TrajectoryEnvelope te : this.getSubEnvelopes()) {
				ret.addAll(te.getGroundEnvelopes());
			}
		}
		else ret.add(this);
		return ret;
	}
422751
@Override
    public ValueRange range(TemporalField field) {
        if (field instanceof ChronoField) {
            if (field == INSTANT_SECONDS || field == OFFSET_SECONDS) {
                return field.range();
            }
            return toLocalDateTime().range(field);
        }
        return field.rangeRefinedBy(this);
    }