Class IterativeSimpleMatching<T>

java.lang.Object
microsim.matching.AbstractMatcher<T>
microsim.matching.IterativeSimpleMatching<T>
Type Parameters:
T - A generic type representing agents.
All Implemented Interfaces:
IterativeMatchingAlgorithm<T>

public class IterativeSimpleMatching<T> extends AbstractMatcher<T> implements IterativeMatchingAlgorithm<T>
A singleton class used for matching.
  • Method Details

    • getInstance

      @NonNull public static @NonNull IterativeSimpleMatching<?> getInstance()
      A factory method.
      Returns:
      the instance of this class.
    • matching

      public org.apache.commons.math3.util.Pair<Set<T>,Set<T>> matching(@NonNull @NonNull Collection<T> collection1, @Nullable @Nullable org.apache.commons.collections4.Predicate<T> filter1, @NonNull @NonNull Collection<T> collection2, @Nullable @Nullable org.apache.commons.collections4.Predicate<T> filter2, @NonNull @NonNull MatchingScoreClosure<T> doubleClosure, @NonNull @NonNull MatchingClosure<T> matching)
      Attempts to match people from two disjoint sets.
      Specified by:
      matching in interface IterativeMatchingAlgorithm<T>
      Parameters:
      collection1 - A set of agents.
      filter1 - A filter for collection1.
      collection2 - Another set of agents to match to.
      filter2 - A filter for collection2.
      doubleClosure - An object implementing MatchingScoreClosure that allows scoring of pairs.
      matching - An object implementing MatchingClosure to match pairs of agents.
      Returns:
      all people with no pair to be passed to other matching methods.