public void init(final OsmPath origin, final OsmLink link, final OsmTrack refTrack, final boolean detailMode, final RoutingContext rc) {
        if (origin.myElement == null) {
            origin.myElement = OsmPathElement.create(origin);
        }
        this.originElement = origin.myElement;
        this.link = link;
        this.sourceNode = origin.targetNode;
        this.targetNode = link.getTarget(sourceNode);
        this.cost = origin.cost;
        this.lastClassifier = origin.lastClassifier;
        this.lastInitialCost = origin.lastInitialCost;
        this.bitfield = origin.bitfield;
        this.priorityclassifier = origin.priorityclassifier;
        init(origin);
        addAddionalPenalty(refTrack, detailMode, origin, link, rc);
    }
The cost of that path (a modified distance)
main/src/main/java/cgeo/geocaching/brouter/core/OsmPath.java