Class Distraction
java.lang.Object
org.opentrafficsim.road.gtu.lane.perception.mental.sdm.Distraction
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
ConstructorsConstructorDescriptionDistraction(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 TypeMethodDescriptionfinal StringReturns the description.final StringgetId()Returns the id.final TaskgetTask(LaneBasedGtu gtu) Returns a task for the given GTU.final org.djunits.value.vdouble.scalar.DurationReturns the next duration of this secondary task.final booleanReturns the next exposure.final org.djunits.value.vdouble.scalar.DurationReturns the next inter-arrival time of this secondary task.toString()
-
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- 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
Returns the id.- Returns:
- String; id
-
getDescription
Returns the description.- Returns:
- String; description
-
nextExposure
public final boolean nextExposure()Returns the next exposure.- Returns:
- boolean; next exposure
-
nextInterArrival
public final org.djunits.value.vdouble.scalar.Duration nextInterArrival()Returns the next inter-arrival time of this secondary task.- Returns:
- Duration; 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:
- 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
-