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

org.opentripplanner.routing.algorithm.raptoradapter.transit.TripSchedule Maven / Gradle / Ivy

There is a newer version: 2.5.0
Show newest version
package org.opentripplanner.routing.algorithm.raptoradapter.transit;

import org.opentripplanner.model.TripPattern;
import org.opentripplanner.routing.trippattern.TripTimes;
import org.opentripplanner.transit.raptor.api.transit.RaptorTripSchedule;

import java.time.LocalDate;

/**
 * Extension of RaptorTripSchedule passed through Raptor searches to be able to retrieve the
 * original trip from the path when creating itineraries.
 */
public interface TripSchedule extends RaptorTripSchedule {

    /**
     * TODO OTP2 - Add JavaDoc
     */
    TripTimes getOriginalTripTimes();

    /**
     * TODO OTP2 - Add JavaDoc
     */
    TripPattern getOriginalTripPattern();

    LocalDate getServiceDate();

    /**
     * Return {@code true} if this trip is not based on a fixed schedule, but instead a
     * frequency based scheduled trip. The {@link #frequencyHeadwayInSeconds()} is only defined for
     * such trips.
     */
    default boolean isFrequencyBasedTrip() { return false; }

    /**
     * Return the {@code headway} for a frequency based trip. {@code -999} is returned for "normal"
     * scheduled trips, but you should not relay on this. Instead, use the
     * {@link #isFrequencyBasedTrip()} method to determine the trip type.
     */
    default int frequencyHeadwayInSeconds() { return -999; }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy