All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opentripplanner.updater.vehicle_position.VehiclePositionUpdaterRunnable Maven / Gradle / Ivy

There is a newer version: 2.6.0
Show newest version
package org.opentripplanner.updater.vehicle_position;

import com.google.transit.realtime.GtfsRealtime.VehiclePosition;
import java.util.List;
import java.util.Objects;
import org.opentripplanner.routing.graph.Graph;
import org.opentripplanner.transit.service.TransitModel;
import org.opentripplanner.updater.GraphWriterRunnable;

public record VehiclePositionUpdaterRunnable(
  List updates,
  VehiclePositionPatternMatcher matcher
)
  implements GraphWriterRunnable {
  public VehiclePositionUpdaterRunnable {
    Objects.requireNonNull(updates);
    Objects.requireNonNull(matcher);
  }

  @Override
  public void run(Graph graph, TransitModel transitModel) {
    // Apply new vehicle positions
    matcher.applyVehiclePositionUpdates(updates);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy