Class SimpleMatching<T>

java.lang.Object
microsim.matching.AbstractMatcher<T>
microsim.matching.SimpleMatching<T>
Type Parameters:
T -
All Implemented Interfaces:
MatchingAlgorithm<T>

public class SimpleMatching<T> extends AbstractMatcher<T> implements MatchingAlgorithm<T>
The simplest matching class.
  • Method Details

    • getInstance

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

      public void 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 MatchingAlgorithm<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.
      Throws:
      IllegalArgumentException - when the method fails to match any agents.