Class DataSource


  • public final class DataSource
    extends java.lang.Object
    Data source for the EGTF. These are obtained using EGTF.getDataSource().

    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 24 okt. 2018
    Author:
    Wouter Schakel
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T extends java.lang.Number>
      DataStream<T>
      addStream​(Quantity<T,​?> quantity, T thetaCong, T thetaFree)
      Add a non-speed stream for the quantity to this data source.
      <T extends java.lang.Number>
      DataStream<T>
      addStreamSI​(Quantity<T,​?> quantity, double thetaCong, double thetaFree)
      Add a stream for the quantity to this data source.
      boolean equals​(java.lang.Object obj)
      java.lang.String getName()
      Returns the name.
      <T extends java.lang.Number>
      DataStream<T>
      getStream​(Quantity<T,​?> quantity)
      Get a stream for the quantity of this data source.
      int hashCode()
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the name.
        Returns:
        String; name
      • addStream

        public <T extends java.lang.Number> DataStream<T> addStream​(Quantity<T,​?> quantity,
                                                                    T thetaCong,
                                                                    T thetaFree)
        Add a non-speed stream for the quantity to this data source.
        Type Parameters:
        T - implicit data type
        Parameters:
        quantity - Quantity<T, ?>; quantity
        thetaCong - T; standard deviation of this quantity of measurements in congestion by this data source
        thetaFree - T; standard deviation of this quantity of measurements in free flow by this data source
        Returns:
        DataStream; the created data stream
        Throws:
        java.lang.IllegalArgumentException - if the quantity is speed
      • addStreamSI

        public <T extends java.lang.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, ?>; quantity
        thetaCong - double; standard deviation of this quantity of measurements in congestion by this data source in SI
        thetaFree - double; standard deviation of this quantity of measurements in free flow by this data source in SI
        Returns:
        DataStream; the created data stream
      • getStream

        public <T extends java.lang.Number> DataStream<T> getStream​(Quantity<T,​?> quantity)
        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()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object