Class ExtendedDataTypeDuration<G extends GtuDataInterface>
java.lang.Object
org.opentrafficsim.kpi.sampling.data.ExtendedDataType<T,O,float[],G>
org.opentrafficsim.kpi.sampling.data.ExtendedDataTypeFloat<DurationUnit,FloatDuration,FloatDurationVector,G>
org.opentrafficsim.kpi.sampling.data.ExtendedDataTypeDuration<G>
- Type Parameters:
G- gtu data type
- All Implemented Interfaces:
Identifiable
public abstract class ExtendedDataTypeDuration<G extends GtuDataInterface> extends ExtendedDataTypeFloat<DurationUnit,FloatDuration,FloatDurationVector,G>
Extended data type for duration values.
Copyright (c) 2013-2019 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 21 mrt. 2017
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Constructor Summary
Constructors Constructor Description ExtendedDataTypeDuration(String id)Constructor setting the id. -
Method Summary
Modifier and Type Method Description protected FloatDurationVectorconvert(float[] storage)Convert float array to typed array.protected FloatDurationconvertValue(float value)Convert float to typed value.FloatDurationinterpolate(FloatDuration value0, FloatDuration value1, double f)Interpolate value between two measured values.Methods inherited from class org.opentrafficsim.kpi.sampling.data.ExtendedDataTypeFloat
convert, formatValue, getOutputValue, getStorageValue, initializeStorage, setValueMethods inherited from class org.opentrafficsim.kpi.sampling.data.ExtendedDataType
equals, getId, getValue, hashCode
-
Constructor Details
-
ExtendedDataTypeDuration
Constructor setting the id.- Parameters:
id- String; id
-
-
Method Details
-
convertValue
Convert float to typed value.- Specified by:
convertValuein classExtendedDataTypeFloat<DurationUnit,FloatDuration,FloatDurationVector,G extends GtuDataInterface>- Parameters:
value- float; float value- Returns:
- typed value
-
convert
Convert float array to typed array.- Specified by:
convertin classExtendedDataTypeFloat<DurationUnit,FloatDuration,FloatDurationVector,G extends GtuDataInterface>- Parameters:
storage- float[]; float array storage- Returns:
- typed array
- Throws:
ValueRuntimeException- when float array cannot be converted
-
interpolate
Interpolate value between two measured values. The default implementation takes a linear interpolation over time forDoubleScalar,FloatScalar,DoubleandFloat, or the closest value in time otherwise.- Overrides:
interpolatein classExtendedDataType<FloatDuration,FloatDurationVector,float[],G extends GtuDataInterface>- Parameters:
value0- T; first valuevalue1- T; second valuef- double; interpolation fraction- Returns:
- interpolated value
-