Class DuplicateScoringSupport

java.lang.Object
org.onebusaway.gtfs_merge.strategies.scoring.DuplicateScoringSupport

public class DuplicateScoringSupport extends Object
  • Constructor Details

    • DuplicateScoringSupport

      public DuplicateScoringSupport()
  • Method Details

    • scoreElementOverlap

      public static <T> double scoreElementOverlap(Collection<T> a, Collection<T> b)
      Computes a numeric score that captures how much overlap there is between the elements in two collections, given their set of overlapping elements. The score is [0.0, 1.0], where a score of 0.0 indicates absolutely no overlap and 1.0 indicate the two collections are the same.
      Parameters:
      a -
      b -
      Returns:
      the numeric overlap score
    • scoreElementOverlap

      public static <T> double scoreElementOverlap(Collection<T> a, Collection<T> b, Set<T> common)
      Same as scoreElementOverlap(Collection, Collection) with the exception that overlapping elements between the two collections are automatically added to the 'common' set.
      Parameters:
      a -
      b -
      common -
      Returns:
      the numeric overlap score
    • scoreElementOverlap

      public static <T> double scoreElementOverlap(SortedSet<T> a, SortedSet<T> b)
      A faster implementation of scoreElementOverlap(Collection, Collection), when the Collections are SortedSets.
      Parameters:
      a -
      b -
      Returns:
      the numeric overlap score
    • scoreIntervalOverlap

      public static double scoreIntervalOverlap(int[] sourceInterval, int[] targetInterval)