Package microsim.alignment
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 TypeMethodDescriptionextractAgentList(@NonNull Collection<T> agents, @Nullable org.apache.commons.collections4.Predicate<T> filter) Sorts outagentsof type<T>according to the filter requirements.default voidvalidateProbabilityValue(double value) 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 outagentsof type<T>according to the filter requirements.- Parameters:
agents- An unsorted collection of agents.filter- One predicate to filter them all ornullif 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 notnull. - Throws:
NullPointerException- when theagentscollection 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.
-