Enum DefaultDistraction

  • All Implemented Interfaces:
    Serializable, Comparable<DefaultDistraction>

    public enum DefaultDistraction
    extends Enum<DefaultDistraction>
    Set of default distractions as derived by the research of Manuel Lindorfer. These only describe the statistics. Actual Distractions are linked to the simulation. DistractionFactory can be used to create those.

    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 29 jun. 2018
    Author:
    Alexander Verbraeck, Peter Knoppers, Wouter Schakel
    • Method Detail

      • values

        public static DefaultDistraction[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DefaultDistraction c : DefaultDistraction.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DefaultDistraction valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        NullPointerException - if the argument is null
      • getId

        public String getId()
        Returns the id.
        Returns:
        String; id
      • getDescription

        public String getDescription()
        Returns the description.
        Returns:
        String; description
      • getFrequency

        public Frequency getFrequency()
        Returns the frequency per exposed driver.
        Returns:
        Frequency; frequency per exposed driver
      • getExposure

        public double getExposure()
        Returns the exposure.
        Returns:
        double; exposure
      • getAverageDuration

        public Duration getAverageDuration()
        Returns the average duration.
        Returns:
        Duration; average duration
      • getStdDuration

        public Duration getStdDuration()
        Returns the standard deviation of duration.
        Returns:
        Duration; standard deviation of duration
      • getFromId

        public static DefaultDistraction getFromId​(String id)
        Returns a default distraction from the id.
        Parameters:
        id - String; id
        Returns:
        DefaultDistraction; default distraction from id