Class Distraction.TrapezoidProfile
java.lang.Object
org.opentrafficsim.road.network.lane.object.Distraction.TrapezoidProfile
- All Implemented Interfaces:
Distraction.DistractionProfile
- Enclosing class:
- Distraction
public static class Distraction.TrapezoidProfile
extends Object
implements Distraction.DistractionProfile
Distraction profile with trapezoid shape. The constant part is from the location of the distraction downstream.
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
ConstructorDescriptionTrapezoidProfile
(double maxDistraction, org.djunits.value.vdouble.scalar.Length dMin, org.djunits.value.vdouble.scalar.Length dMed, org.djunits.value.vdouble.scalar.Length dMax) -
Method Summary
Modifier and TypeMethodDescriptiongetDistraction
(org.djunits.value.vdouble.scalar.Length distance) Returns the level of distraction at the given distance.
-
Constructor Details
-
TrapezoidProfile
public TrapezoidProfile(double maxDistraction, org.djunits.value.vdouble.scalar.Length dMin, org.djunits.value.vdouble.scalar.Length dMed, org.djunits.value.vdouble.scalar.Length dMax) - Parameters:
maxDistraction
- double; maximum distraction (task-demand)dMin
- Length; distance before distraction where distraction starts to have effect (<0)dMed
- Length; distance beyond distraction where distraction has maximum effect (>0)dMax
- Length; distance beyond distraction where distraction no longer has effect (>dMed)
-
-
Method Details
-
getDistraction
Returns the level of distraction at the given distance.- Specified by:
getDistraction
in interfaceDistraction.DistractionProfile
- Parameters:
distance
- Distance to distraction; negative when approaching- Returns:
- Double; level of distraction (task-demand), or
null
if the distraction is no longer important
-