Package microsim.matching
Class AbstractMatcher<T>
java.lang.Object
microsim.matching.AbstractMatcher<T>
- Type Parameters:
T- A generic object representing agents.
- Direct Known Subclasses:
IterativeRandomMatching,IterativeSimpleMatching,SimpleMatching
An abstract class for all matching procedures. Contains common methods only.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfilterAgents(@NonNull Collection<T> collection, @Nullable org.apache.commons.collections4.Predicate<T> filter) A filtering method, allows selection of agents according to the providedfilter.voidvalidateDisjointSets(@NonNull List<T> c1, @NonNull List<T> c2) A validation method, it ensures that two lists do not intersect.
-
Constructor Details
-
AbstractMatcher
public AbstractMatcher()
-
-
Method Details
-
filterAgents
@NonNull public @NonNull List<T> filterAgents(@NonNull @NonNull Collection<T> collection, @Nullable @Nullable org.apache.commons.collections4.Predicate<T> filter) A filtering method, allows selection of agents according to the providedfilter. Does not change the original collection.- Parameters:
collection- A collection of agents.filter- A logical predicate for agent selection.- Returns:
- A list of filtered agents.
- Throws:
NullPointerException- when any of the input parameters isnull.
-
validateDisjointSets
A validation method, it ensures that two lists do not intersect.- Parameters:
c1- A list of agents.c2- Another list to check against.- Throws:
NullPointerException- when any of the input parameters isnull.IllegalArgumentException- whenc1andc2have share at least one agent.
-