
org.opentripplanner.standalone.config.routerequest.TimeAndCostPenaltyMapper 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
The newest version!
package org.opentripplanner.standalone.config.routerequest;
import org.opentripplanner.routing.api.request.framework.TimeAndCostPenalty;
import org.opentripplanner.standalone.config.framework.json.NodeAdapter;
import org.opentripplanner.standalone.config.framework.json.OtpVersion;
public class TimeAndCostPenaltyMapper {
public static TimeAndCostPenalty map(NodeAdapter c) {
return TimeAndCostPenalty.of(
c
.of("timePenalty")
.summary("Penalty added to the time of a path/leg.")
.since(OtpVersion.V2_4)
.asTimePenalty(TimeAndCostPenalty.ZERO.timePenalty()),
c
.of("costFactor")
.summary("A factor multiplied with the time-penalty to get the cost-penalty.")
.since(OtpVersion.V2_4)
.asDouble(TimeAndCostPenalty.ZERO.costFactor())
);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy