Class AbstractIndicator<T extends org.djunits.value.vdouble.scalar.base.DoubleScalar<?,?>>

java.lang.Object
org.opentrafficsim.kpi.sampling.indicator.AbstractIndicator<T>
Type Parameters:
T - class of the value
Direct Known Subclasses:
MeanDensity, MeanIntensity, MeanSpeed, MeanTravelTimePerDistance, MeanTripLength, TotalDelay, TotalDelayReference, TotalNumberOfStops, TotalTravelDistance, TotalTravelTime

public abstract class AbstractIndicator<T extends org.djunits.value.vdouble.scalar.base.DoubleScalar<?,?>> extends Object
Abstract indicator which stores the last calculated value and returns it in getValue() for an equal query, start time and end time.

Copyright (c) 2013-2024 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 Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract <G extends GtuData>
    T
    calculate(Query<G,?> query, org.djunits.value.vdouble.scalar.Time startTime, org.djunits.value.vdouble.scalar.Time endTime, List<TrajectoryGroup<G>> trajectoryGroups)
    Calculate value for given trajectory group.
    final <G extends GtuData>
    T
    getValue(Query<G,?> query, org.djunits.value.vdouble.scalar.Time endTime, List<TrajectoryGroup<G>> trajectoryGroups)
    Get value for given query over time interval, returning earlier calculated value if possible.
    final <G extends GtuData>
    T
    getValue(Query<G,?> query, org.djunits.value.vdouble.scalar.Time startTime, org.djunits.value.vdouble.scalar.Time endTime, List<TrajectoryGroup<G>> trajectoryGroups)
    Get value for given query over time interval, returning earlier calculated value if possible.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AbstractIndicator

      public AbstractIndicator()
  • Method Details

    • getValue

      public final <G extends GtuData> T getValue(Query<G,?> query, org.djunits.value.vdouble.scalar.Time endTime, List<TrajectoryGroup<G>> trajectoryGroups)
      Get value for given query over time interval, returning earlier calculated value if possible. This method uses Time.ZERO as start time.
      Type Parameters:
      G - gtu data type
      Parameters:
      query - Query<G, ?>; query
      endTime - Time; start time of interval to calculate indicator over
      trajectoryGroups - List<TrajectoryGroup<G>>; group of trajectories to calculate the indicator for
      Returns:
      value for given query
    • getValue

      public final <G extends GtuData> T getValue(Query<G,?> query, org.djunits.value.vdouble.scalar.Time startTime, org.djunits.value.vdouble.scalar.Time endTime, List<TrajectoryGroup<G>> trajectoryGroups)
      Get value for given query over time interval, returning earlier calculated value if possible.
      Type Parameters:
      G - gtu data type
      Parameters:
      query - Query<G, ?>; query
      startTime - Time; start time of interval to calculate indicator over
      endTime - Time; start time of interval to calculate indicator over
      trajectoryGroups - List<TrajectoryGroup<G>>; group of trajectories to calculate the indicator for
      Returns:
      value for given query
    • calculate

      protected abstract <G extends GtuData> T calculate(Query<G,?> query, org.djunits.value.vdouble.scalar.Time startTime, org.djunits.value.vdouble.scalar.Time endTime, List<TrajectoryGroup<G>> trajectoryGroups)
      Calculate value for given trajectory group.
      Type Parameters:
      G - gtu data type
      Parameters:
      query - Query<G, ?>; query
      startTime - Time; start time of interval to calculate indicator over
      endTime - Time; start time of interval to calculate indicator over
      trajectoryGroups - List<TrajectoryGroup<G>>; group of trajectories to calculate the indicator for
      Returns:
      value for given trajectory group