Class AbstractIndicator<T extends DoubleScalarInterface>
- 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
,TotalNumberOfStops
,TotalTravelDistance
,TotalTravelTime
public abstract class AbstractIndicator<T extends DoubleScalarInterface> extends Object
Abstract indicator which stores the last calculated value and returns it ingetValue()
for an equal query, start time and end time.Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version 1 okt. 2016
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Constructor Summary
Constructors Constructor Description AbstractIndicator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract <G extends GtuDataInterface>
Tcalculate(Query<G> query, Time startTime, Time endTime, List<TrajectoryGroup<G>> trajectoryGroups)
Calculate value for given trajectory group.<G extends GtuDataInterface>
TgetValue(Query<G> query, Time endTime, List<TrajectoryGroup<G>> trajectoryGroups)
Get value for given query over time interval, returning earlier calculated value if possible.<G extends GtuDataInterface>
TgetValue(Query<G> query, Time startTime, Time endTime, List<TrajectoryGroup<G>> trajectoryGroups)
Get value for given query over time interval, returning earlier calculated value if possible.
-
-
-
Method Detail
-
getValue
public final <G extends GtuDataInterface> T getValue(Query<G> query, 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 GtuDataInterface> T getValue(Query<G> query, Time startTime, 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 GtuDataInterface> T calculate(Query<G> query, Time startTime, 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
-
-