Class ExtendedDataNumber<G extends GtuData>
java.lang.Object
org.opentrafficsim.kpi.sampling.DataType<T,G>
org.opentrafficsim.kpi.sampling.data.ExtendedDataType<Float,float[],float[],G>
org.opentrafficsim.kpi.sampling.data.ExtendedDataNumber<G>
- Type Parameters:
G
- GTU data type
- All Implemented Interfaces:
org.djutils.base.Identifiable
public abstract class ExtendedDataNumber<G extends GtuData>
extends ExtendedDataType<Float,float[],float[],G>
Class for unitless values.
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 -
Method Summary
Modifier and TypeMethodDescriptionfloat[]
convert
(float[] storage, int size) Convert storage type to output type.getOutputValue
(float[] output, int index) Returns a specific output value.getStorageValue
(float[] storage, int index) Returns a specific storage value.float[]
Returns an initial storage object.parseValue
(String string) Parses a stored string representation to original type.float[]
Returns an updated list/array/vector of the storage type, including a new value at given index.Methods inherited from class org.opentrafficsim.kpi.sampling.data.ExtendedDataType
getValue, interpolate, toString
-
Constructor Details
-
ExtendedDataNumber
Constructor.- Parameters:
id
- iddescription
- description
-
-
Method Details
-
setValue
Description copied from class:ExtendedDataType
Returns an updated list/array/vector of the storage type, including a new value at given index.- Specified by:
setValue
in classExtendedDataType<Float,
float[], float[], G extends GtuData> - Parameters:
storage
- storageindex
- index to store next valuevalue
- value to add- Returns:
- updated list/array/vector of the storage type, including a new value at given index
-
getOutputValue
Description copied from class:ExtendedDataType
Returns a specific output value. This is used to store extended data types as generic file, i.e. text file.- Specified by:
getOutputValue
in classExtendedDataType<Float,
float[], float[], G extends GtuData> - Parameters:
output
- outputindex
- index of value to return- Returns:
- the i'th output value o
-
getStorageValue
Description copied from class:ExtendedDataType
Returns a specific storage value. This is used to bypass conversion to the output type when trajectories are cut.- Specified by:
getStorageValue
in classExtendedDataType<Float,
float[], float[], G extends GtuData> - Parameters:
storage
- storageindex
- index of value to return- Returns:
- the i'th output value
-
initializeStorage
public float[] initializeStorage()Description copied from class:ExtendedDataType
Returns an initial storage object.- Specified by:
initializeStorage
in classExtendedDataType<Float,
float[], float[], G extends GtuData> - Returns:
- initial storage object
-
convert
public float[] convert(float[] storage, int size) Description copied from class:ExtendedDataType
Convert storage type to output type.- Specified by:
convert
in classExtendedDataType<Float,
float[], float[], G extends GtuData> - Parameters:
storage
- stored datasize
- size of trajectory- Returns:
- converted output
-
parseValue
Description copied from class:ExtendedDataType
Parses a stored string representation to original type.- Specified by:
parseValue
in classExtendedDataType<Float,
float[], float[], G extends GtuData> - Parameters:
string
- stored string representation- Returns:
- value in original type
-