// If the vehicle has already passed the stop, then there is no prediction
// interval
if (stopTime.getDepartureTime() <= blockLocation.getEffectiveScheduleTime())
return null;
ScheduleDeviationSamples samples = blockLocation.getScheduleDeviations();
if (samples == null || samples.isEmpty())
return null;
double mu = InterpolationLibrary.interpolate(samples.getScheduleTimes(),
samples.getScheduleDeviationMus(), stopTime.getDepartureTime(),
EOutOfRangeStrategy.LAST_VALUE);
double sigma = InterpolationLibrary.interpolate(samples.getScheduleTimes(),
samples.getScheduleDeviationSigmas(), stopTime.getDepartureTime(),
EOutOfRangeStrategy.LAST_VALUE);
long from = (long) (instance.getScheduledDepartureTime() + (mu - sigma) * 1000);
long to = (long) (instance.getScheduledDepartureTime() + (mu + sigma) * 1000);