Package org.opentrafficsim.draw.egtf
Class DataSource
java.lang.Object
org.opentrafficsim.draw.egtf.DataSource
Data source for the EGTF. These are obtained using
EGTF.getDataSource()
.
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:
- Wouter Schakel
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T extends Number>
DataStream<T>Add a non-speed stream for the quantity to this data source.<T extends Number>
DataStream<T>addStreamSI
(Quantity<T, ?> quantity, double thetaCong, double thetaFree) Add a stream for the quantity to this data source.boolean
getName()
Returns the name.<T extends Number>
DataStream<T>Get a stream for the quantity of this data source.int
hashCode()
toString()
-
Constructor Details
-
DataSource
DataSource(String name) Constructor.- Parameters:
name
- String; unique name
-
-
Method Details
-
getName
Returns the name.- Returns:
- String; name
-
addStream
Add a non-speed stream for the quantity to this data source.- Type Parameters:
T
- implicit data type- Parameters:
quantity
- Quantity<T, ?>; quantitythetaCong
- T; standard deviation of this quantity of measurements in congestion by this data sourcethetaFree
- T; standard deviation of this quantity of measurements in free flow by this data source- Returns:
- DataStream; the created data stream
- Throws:
IllegalArgumentException
- if the quantity is speed
-
addStreamSI
public <T extends Number> DataStream<T> addStreamSI(Quantity<T, ?> quantity, double thetaCong, double thetaFree) Add a stream for the quantity to this data source.- Type Parameters:
T
- implicit data type- Parameters:
quantity
- Quantity<T, ?>; quantitythetaCong
- double; standard deviation of this quantity of measurements in congestion by this data source in SIthetaFree
- double; standard deviation of this quantity of measurements in free flow by this data source in SI- Returns:
- DataStream; the created data stream
-
getStream
Get a stream for the quantity of this data source. If no stream has been created, one will be created with 1.0 standard deviation.- Type Parameters:
T
- implicit data type- Parameters:
quantity
- Quantity<T, ?>; quantity- Returns:
- DataStream<T>; stream for the quantity of this data source
-
hashCode
public int hashCode() -
equals
-
toString
-