Interface NearbyDistanceMeter<O,​D>

  • Type Parameters:
    O -
    D -
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface NearbyDistanceMeter<O,​D>
    Implementations are expected to be stateless. The solver may choose to reuse instances.
    • Method Detail

      • getNearbyDistance

        double getNearbyDistance​(O origin,
                                 D destination)
        Measures the distance from the origin to the destination. The distance can be in any unit, such a meters, foot, seconds or milliseconds. For example, vehicle routing often uses driving time in seconds.

        Distances can be asymmetrical: the distance from an origin to a destination often differs from the distance from that destination to that origin.

        Parameters:
        origin - never null
        destination - never null
        Returns:
        Preferably always >= 0.0. If origin == destination, it usually returns 0.0.