Class FilterDataType<T,G extends GtuData>

java.lang.Object
org.opentrafficsim.kpi.sampling.DataType<T,G>
org.opentrafficsim.kpi.sampling.filter.FilterDataType<T,G>
Type Parameters:
T - class of meta data
G - GTU data type
All Implemented Interfaces:
Identifiable
Direct Known Subclasses:
FilterDataCrossSections, FilterDataDestination, FilterDataGtuType, FilterDataOrigin, FilterDataRoute

public abstract class FilterDataType<T,G extends GtuData> extends DataType<T,G>
Abstract class for defining a type of filter data.

Copyright (c) 2013-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
  • Constructor Details

    • FilterDataType

      public FilterDataType(String id, String description, Class<T> type)
      Constructor.
      Parameters:
      id - id
      description - description
      type - type class
  • Method Details

    • accept

      public void accept(TrajectoryAcceptList trajectoryAcceptList, Set<T> querySet)
      Determines for a set of trajectory's from a single GTU, which may be accepted according to this filter data type. As a single GTU may have several trajectories for a single TrajectoryGroup object, the specified TrajectoryGroup's may have duplicates. As the trajectory's are from a single GTU, the filter data is equal for all. Implementations of this method may for instance:
      1. Determine only from the first Trajectorys' filter data that all may be accepted.
      2. Determine for the separate Trajectory's whether they are acceptable.
      3. The same as 2, but refuse all if any is refused.
      4. The same as 2, but accept all if any is accepted.
      5. etc.
      The default implementation is that of 1, checking that the filter data value is in the provided query set.
      Parameters:
      trajectoryAcceptList - containing Trajectory's and TrajectoryGroup's pertaining to a single GTU, all assumed not accepted
      querySet - set of values in the query for this metadata type
    • toString

      public String toString()
      Overrides:
      toString in class Object