Class AbstractMatcher<T>

java.lang.Object
microsim.matching.AbstractMatcher<T>
Type Parameters:
T - A generic object representing agents.
Direct Known Subclasses:
IterativeRandomMatching, IterativeSimpleMatching, SimpleMatching

public abstract class AbstractMatcher<T> extends Object
An abstract class for all matching procedures. Contains common methods only.
  • 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 provided filter. 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 is null.
    • validateDisjointSets

      public void validateDisjointSets(@NonNull @NonNull List<T> c1, @NonNull @NonNull List<T> c2)
      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 is null.
      IllegalArgumentException - when c1 and c2 have share at least one agent.