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

org.opentripplanner.routing.algorithm.raptoradapter.transit.cost.SingleValueFactorStrategy Maven / Gradle / Ivy

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

/**
 * This {@link FactorStrategy} keep a single value and use it every time
 * the factor is needed. The {@link #minFactor()} return the same value.
 * 

* The class and methods are {@code final} to help the JIT compiler optimize the use of this class. */ final class SingleValueFactorStrategy implements FactorStrategy { private final int factor; SingleValueFactorStrategy(int factor) { this.factor = factor; } SingleValueFactorStrategy(double reluctance) { this(RaptorCostConverter.toRaptorCost(reluctance)); } @Override public int factor(int index) { return factor; } @Override public int minFactor() { return factor; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy