Search in sources :

Example 6 with RaptorTransfer

use of org.opentripplanner.transit.raptor.api.transit.RaptorTransfer in project OpenTripPlanner by opentripplanner.

the class ForwardPathMapper method createAccessPathLeg.

private AccessPathLeg<T> createAccessPathLeg(ArrivalView<T> from, PathLeg<T> nextLeg) {
    RaptorTransfer access = from.accessLeg().access();
    int departureTime = from.arrivalTime() - access.durationInSeconds();
    return new AccessPathLeg<>(access, from.stop(), departureTime, from.arrivalTime(), nextLeg);
}
Also used : AccessPathLeg(org.opentripplanner.transit.raptor.api.path.AccessPathLeg) RaptorTransfer(org.opentripplanner.transit.raptor.api.transit.RaptorTransfer)

Example 7 with RaptorTransfer

use of org.opentripplanner.transit.raptor.api.transit.RaptorTransfer in project OpenTripPlanner by opentripplanner.

the class Stops method setupEgressStopStates.

/**
 * Setup egress arrivals with a callback witch is notified when a new transit egress arrival happens.
 */
public void setupEgressStopStates(Iterable<RaptorTransfer> egressLegs, Consumer<EgressStopArrivalState<T>> transitArrivalCallback) {
    for (int round = 1; round < stops.length; round++) {
        for (RaptorTransfer leg : egressLegs) {
            EgressStopArrivalState<T> state = new EgressStopArrivalState<>(round, leg, transitArrivalCallback);
            stops[round][leg.stop()] = state;
        }
    }
}
Also used : RaptorTransfer(org.opentripplanner.transit.raptor.api.transit.RaptorTransfer)

Aggregations

RaptorTransfer (org.opentripplanner.transit.raptor.api.transit.RaptorTransfer)7 AccessPathLeg (org.opentripplanner.transit.raptor.api.path.AccessPathLeg)2 EgressPathLeg (org.opentripplanner.transit.raptor.api.path.EgressPathLeg)2 ZonedDateTime (java.time.ZonedDateTime)1 Collection (java.util.Collection)1 Collectors (java.util.stream.Collectors)1 SlackProvider (org.opentripplanner.routing.algorithm.raptor.transit.SlackProvider)1 TripSchedule (org.opentripplanner.routing.algorithm.raptor.transit.TripSchedule)1 RoutingRequest (org.opentripplanner.routing.api.request.RoutingRequest)1 Optimization (org.opentripplanner.transit.raptor.api.request.Optimization)1 RaptorProfile (org.opentripplanner.transit.raptor.api.request.RaptorProfile)1 RaptorRequest (org.opentripplanner.transit.raptor.api.request.RaptorRequest)1 RaptorRequestBuilder (org.opentripplanner.transit.raptor.api.request.RaptorRequestBuilder)1