org.opentripplanner.routing.algorithm.raptor.transit.request.TransferWithDuration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
package org.opentripplanner.routing.algorithm.raptor.transit.request;
import org.opentripplanner.routing.algorithm.raptor.transit.Transfer;
import org.opentripplanner.transit.raptor.api.transit.RaptorTransfer;
public class TransferWithDuration implements RaptorTransfer {
private final int durationSeconds;
private final Transfer transfer;
public TransferWithDuration(Transfer transfer, double walkSpeed) {
this.transfer = transfer;
this.durationSeconds = (int) Math.round(transfer.getEffectiveWalkDistanceMeters() / walkSpeed);
}
@Override
public int stop() {
return transfer.getToStop();
}
@Override
public int durationInSeconds() {
return this.durationSeconds;
}
}