Package microsim.matching
Class SimpleMatching<T>
java.lang.Object
microsim.matching.AbstractMatcher<T>
microsim.matching.SimpleMatching<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
MatchingAlgorithm<T>
The simplest matching class.
-
Method Summary
Modifier and TypeMethodDescriptionstatic SimpleMatching<?>
A factory method.void
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 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 interfaceMatchingAlgorithm<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.- Throws:
IllegalArgumentException
- when the method fails to match any agents.
-