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

org.opentripplanner.routing.algorithm.raptoradapter.transit.constrainedtransfer.ConstrainedBoardingSearchStrategy Maven / Gradle / Ivy

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

import org.opentripplanner.routing.algorithm.raptoradapter.transit.TripSchedule;
import org.opentripplanner.transit.raptor.api.transit.IntIterator;
import org.opentripplanner.transit.raptor.api.transit.RaptorTimeTable;
import org.opentripplanner.transit.raptor.api.transit.RaptorTripSchedule;


/**
 * Used to search forward and in reverse.
 */
interface ConstrainedBoardingSearchStrategy {

    /**
     * 
    *
  1. In a forward search return the DEPARTURE time. *
  2. In a reverse search return the ARRIVAL time. *
*/ int time(RaptorTripSchedule schedule, int stopPos); /** *
    *
  1. In a forward search the time is before another time if it is in the PAST. *
  2. In a reverse search the time is before another time if it is in the FUTURE. *
*/ boolean timeIsBefore(int time0, int time1); /** *
    *
  1. In a forward search iterate in departure order. *
  2. In a reverse search iterate in reverse departure order, * starting with the last trip in the schedule. *
*/ IntIterator scheduleIndexIterator(RaptorTimeTable timetable); /** *
    *
  1. In a forward search add {@code u} and {@code v} together. Example: {@code plus(5, 2) => 7} *
  2. In a reverse search subtract {@code v} from {@code u}. Example: {@code plus(5, 2) => 3} *
*/ int plus(int v, int u); /** *
    *
  1. In a forward search return the highest time. *
  2. In a reverse search return the lowest time. *
*/ default int maxTime(int v, int u) { return timeIsBefore(v, u) ? u : v; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy