Interface AlignmentUtils<T>

Type Parameters:
T - A generic type describing an agent.
All Known Implementing Classes:
AbstractSortByDifferenceAlignment, LogitScalingAlignment, MultiplicativeScalingAlignment, ResamplingAlignment, SBDAlignment, SBDLAlignment, SidewalkAlignment

public interface AlignmentUtils<T>
A generic utility class with methods that are used across the microsim.alignment module.
  • Method Summary

    Modifier and Type
    Method
    Description
    default @NonNull List<T>
    extractAgentList(@NonNull Collection<T> agents, @Nullable org.apache.commons.collections4.Predicate<T> filter)
    Sorts out agents of type <T> according to the filter requirements.
    default void
    Validates provided input values.
  • Method Details

    • extractAgentList

      @NonNull default @NonNull List<T> extractAgentList(@NonNull @NonNull Collection<T> agents, @Nullable @Nullable org.apache.commons.collections4.Predicate<T> filter)
      Sorts out agents of type <T> according to the filter requirements.
      Parameters:
      agents - An unsorted collection of agents.
      filter - One predicate to filter them all or null if there is no need to filter the agents.
      Returns:
      a filtered list of agents, or the same collection transformed to a list when the filter is null; always not null.
      Throws:
      NullPointerException - when the agents collection is null.
    • validateProbabilityValue

      default void validateProbabilityValue(double value)
      Validates provided input values.
      Parameters:
      value - A probability value.
      Throws:
      IllegalArgumentException - if the value is out of [0, 1] range.