Package microsim.matching
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 Summary
Modifier and TypeMethodDescriptionstatic @NonNull IterativeSimpleMatching<?>
A factory method.matching
(@NonNull Collection<T> collection1, @Nullable org.apache.commons.collections4.Predicate<T> filter1, @NonNull Collection<T> collection2, @Nullable org.apache.commons.collections4.Predicate<T> filter2, @NonNull MatchingScoreClosure<T> doubleClosure, @NonNull MatchingClosure<T> matching) Attempts to match people from two disjoint sets.Methods inherited from class microsim.matching.AbstractMatcher
filterAgents, validateDisjointSets
-
Method Details
-
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 interfaceIterativeMatchingAlgorithm<T>
- Parameters:
collection1
- A set of agents.filter1
- A filter forcollection1
.collection2
- Another set of agents to match to.filter2
- A filter forcollection2
.doubleClosure
- An object implementingMatchingScoreClosure
that allows scoring of pairs.matching
- An object implementingMatchingClosure
to match pairs of agents.- Returns:
- all people with no pair to be passed to other matching methods.
-