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

org.opentripplanner.routing.algorithm.raptor.transit.request.TransferWithDuration Maven / Gradle / Ivy

There is a newer version: 2.5.0
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy