Enum Class FundamentalDiagram.Quantity

java.lang.Object
java.lang.Enum<FundamentalDiagram.Quantity>
org.opentrafficsim.draw.graphs.FundamentalDiagram.Quantity
All Implemented Interfaces:
Serializable, Comparable<FundamentalDiagram.Quantity>, Constable
Enclosing class:
FundamentalDiagram

public static enum FundamentalDiagram.Quantity extends Enum<FundamentalDiagram.Quantity>
Quantity enum defining density, flow and speed.

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
  • Enum Constant Details

  • Method Details

    • values

      public static FundamentalDiagram.Quantity[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static FundamentalDiagram.Quantity valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • label

      public abstract String label()
      Returns an axis label of the quantity.
      Returns:
      String; axis label of the quantity
    • format

      public abstract String format(double value)
      Formats a value for status display.
      Parameters:
      value - double; value
      Returns:
      String; formatted string including quantity
    • getValue

      public abstract double getValue(FundamentalDiagram.FdSource src, int series, int item)
      Get scaled value in presentation unit.
      Parameters:
      src - FdSource; the data source
      series - int; series number
      item - int; item number in series
      Returns:
      double; scaled value in presentation unit
    • computeOther

      public abstract double computeOther(FundamentalDiagram.Quantity pairing, double thisValue, double pairedValue)
      Compute the value of the 3rd quantity.
      Parameters:
      pairing - Quantity; quantity on other axis
      thisValue - double; value of this quantity
      pairedValue - double; value of the paired quantity on the other axis
      Returns:
      double; value of the 3rd quantity