Class Distraction
java.lang.Object
org.opentrafficsim.road.gtu.lane.perception.mental.sdm.Distraction
public class Distraction
extends java.lang.Object
Task as seen by the Stochastic Distraction Model.
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 28 jun. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Constructor Summary
Constructors Constructor Description Distraction(java.lang.String id, java.lang.String description, Frequency frequency, double exposure, Duration averageDuration, Duration stdDuration, StreamInterface stream, TaskSupplier taskSupplier)
Constructor. -
Method Summary
Modifier and Type Method Description java.lang.String
getDescription()
Returns the description.java.lang.String
getId()
Returns the id.Task
getTask(LaneBasedGTU gtu)
Returns a task for the given GTU.Duration
nextDuration()
Returns the next duration of this secondary task.boolean
nextExposure()
Returns the next exposure.Duration
nextInterArrival()
Returns the next inter-arrival time of this secondary task.java.lang.String
toString()
-
Constructor Details
-
Distraction
public Distraction(java.lang.String id, java.lang.String description, Frequency frequency, double exposure, Duration averageDuration, Duration stdDuration, StreamInterface stream, TaskSupplier taskSupplier)Constructor.- Parameters:
id
- String; iddescription
- String; descriptionfrequency
- Frequency; frequency per exposed driverexposure
- double; exposure (value in range [0...1])averageDuration
- Duration; average durationstdDuration
- Duration; standard deviation of durationstream
- StreamInterface; random number streamtaskSupplier
- TaskSupplier; task supplier
-
-
Method Details
-
getId
public final java.lang.String getId()Returns the id.- Returns:
- String; id
-
getDescription
public final java.lang.String getDescription()Returns the description.- Returns:
- String; description
-
nextExposure
public final boolean nextExposure()Returns the next exposure.- Returns:
- boolean; next exposure
-
nextInterArrival
Returns the next inter-arrival time of this secondary task.- Returns:
- Duration; next inter-arrival time of this secondary task
-
nextDuration
Returns the next duration of this secondary task.- Returns:
- Duration; next duration of this secondary task
-
getTask
Returns a task for the given GTU.- Parameters:
gtu
- LaneBasedGTU; gtu- Returns:
- Task; task for given GTU
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-