java.lang.Object
org.opentrafficsim.road.gtu.lane.perception.mental.sdm.Distraction

public class Distraction extends Object
Task as seen by the Stochastic Distraction Model.

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
  • Constructor Summary

    Constructors
    Constructor
    Description
    Distraction(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, nl.tudelft.simulation.jstats.streams.StreamInterface stream, TaskSupplier taskSupplier)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    final String
    Returns the description.
    final String
    Returns the id.
    final Task
    Returns a task for the given GTU.
    final org.djunits.value.vdouble.scalar.Duration
    Returns the next duration of this secondary task.
    final boolean
    Returns the next exposure.
    final org.djunits.value.vdouble.scalar.Duration
    Returns the next inter-arrival time of this secondary task.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Distraction

      public Distraction(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, nl.tudelft.simulation.jstats.streams.StreamInterface stream, TaskSupplier taskSupplier)
      Constructor.
      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
      stream - random number stream
      taskSupplier - task supplier
  • Method Details

    • getId

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

      public final String getDescription()
      Returns the description.
      Returns:
      description
    • nextExposure

      public final boolean nextExposure()
      Returns the next exposure.
      Returns:
      next exposure
    • nextInterArrival

      public final org.djunits.value.vdouble.scalar.Duration nextInterArrival()
      Returns the next inter-arrival time of this secondary task.
      Returns:
      next inter-arrival time of this secondary task
    • nextDuration

      public final org.djunits.value.vdouble.scalar.Duration nextDuration()
      Returns the next duration of this secondary task.
      Returns:
      next duration of this secondary task
    • getTask

      public final Task getTask(LaneBasedGtu gtu)
      Returns a task for the given GTU.
      Parameters:
      gtu - gtu
      Returns:
      task for given GTU
    • toString

      public String toString()
      Overrides:
      toString in class Object