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

com.graphhopper.routing.ev.TurnCost Maven / Gradle / Ivy

package com.graphhopper.routing.ev;

import com.graphhopper.storage.IntsRef;
import com.graphhopper.util.Helper;

import static com.graphhopper.routing.util.EncodingManager.getKey;

public class TurnCost {

    public static String key(String prefix) {
        return getKey(prefix, "turn_cost");
    }

    /**
     * This creates an EncodedValue specifically for the turn costs
     */
    public static DecimalEncodedValue create(String name, int maxTurnCosts) {
        int turnBits = Helper.countBitValue(maxTurnCosts);
        return new UnsignedDecimalEncodedValue(key(name), turnBits, 1, 0, false, true);
    }

    public static IntsRef createFlags() {
        return new IntsRef(1);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy