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
-
Method Summary
Modifier and TypeMethodDescriptioncalculate
(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.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.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.
-
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 usesTime.ZERO
as start time.- Type Parameters:
G
- gtu data type- Parameters:
query
- Query<G, ?>; queryendTime
- Time; start time of interval to calculate indicator overtrajectoryGroups
- 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, ?>; querystartTime
- Time; start time of interval to calculate indicator overendTime
- Time; start time of interval to calculate indicator overtrajectoryGroups
- 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, ?>; querystartTime
- Time; start time of interval to calculate indicator overendTime
- Time; start time of interval to calculate indicator overtrajectoryGroups
- List<TrajectoryGroup<G>>; group of trajectories to calculate the indicator for- Returns:
- value for given trajectory group
-