Interface NormalizedPermutationDistanceMeasurerDouble

    • Method Detail

      • maxf

        double maxf​(int length)
        Computes the maximum possible distance between permutations of a specified length.
        Parameters:
        length - Permutation length.
        Returns:
        the maximum distance between a pair of permutations of the specified length.
      • normalizedDistance

        default double normalizedDistance​(Permutation p1,
                                          Permutation p2)

        Measures the distance between two permutations, normalized to the interval [0.0, 1.0].

        Parameters:
        p1 - first permutation
        p2 - second permutation
        Returns:
        distance between p1 and p2 normalized to the interval [0.0, 1.0]
        Throws:
        IllegalArgumentException - if p1.length() is not equal to p2.length().