Class DistractionFactory

java.lang.Object
org.opentrafficsim.road.gtu.perception.mental.sdm.DistractionFactory

public class DistractionFactory extends Object
Utility to create a list of default distractions as derived by the research of Manuel Lindorfer.

Copyright (c) 2013-2026 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 Details

    • DistractionFactory

      public DistractionFactory(nl.tudelft.simulation.jstats.streams.StreamInterface stream)
      Constructor.
      Parameters:
      stream - random number stream
  • Method Details

    • addDistraction

      public DistractionFactory addDistraction(DefaultDistraction defaultDistraction, double taskDemand)
      Adds a default distraction.
      Parameters:
      defaultDistraction - default distraction
      taskDemand - task demand
      Returns:
      this factory for method chaining
    • addDistraction

      public DistractionFactory addDistraction(String id, String description, org.djunits.value.vdouble.scalar.Frequency frequency, double exposure, org.djunits.value.vdouble.scalar.Duration averageDuration, org.djunits.value.vdouble.scalar.Duration stdDuration, double taskDemand)
      Helper method to create a distraction.
      Parameters:
      id - id
      description - description
      frequency - frequency per exposed driver
      exposure - exposure (value in range [0...1])
      averageDuration - average duration
      stdDuration - standard deviation of duration
      taskDemand - task demand
      Returns:
      this factory for method chaining
    • build

      public List<Distraction> build()
      Returns the list of distractions.
      Returns:
      list of distractions