Class Distraction
java.lang.Object
org.djutils.event.LocalEventProducer
org.opentrafficsim.core.object.StaticObject
org.opentrafficsim.road.network.lane.object.AbstractLaneBasedObject
org.opentrafficsim.road.network.lane.object.Distraction
- All Implemented Interfaces:
Serializable,Remote,nl.tudelft.simulation.dsol.animation.Locatable,org.djutils.base.Identifiable,org.djutils.event.EventProducer,org.opentrafficsim.base.geometry.OtsLocatable,Drawable,LocatedObject,LaneBasedObject
Distraction following a distance profile.
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
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDescribes the profile around the distraction.static classDistraction profile with trapezoid shape. -
Field Summary
Fields inherited from interface org.djutils.event.EventProducer
FIRST_POSITION, LAST_POSITION -
Constructor Summary
ConstructorsConstructorDescriptionDistraction(String id, Lane lane, org.djunits.value.vdouble.scalar.Length longitudinalPosition, OtsSimulatorInterface simulator, Distraction.DistractionProfile profile) -
Method Summary
Modifier and TypeMethodDescriptiongetDistraction(org.djunits.value.vdouble.scalar.Length distance) Returns the level of distraction at the given distance.Methods inherited from class org.opentrafficsim.road.network.lane.object.AbstractLaneBasedObject
getFullId, getLane, getLongitudinalPosition, init, toStringMethods inherited from class org.opentrafficsim.core.object.StaticObject
create, create, getBounds, getGeometry, getHeight, getId, getLocationMethods inherited from class org.djutils.event.LocalEventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventListenerMap, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventListenerMap, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListenerMethods inherited from interface org.djutils.base.Identifiable
getIdMethods inherited from interface org.opentrafficsim.road.network.lane.object.LaneBasedObject
getLength, getLocationMethods inherited from interface nl.tudelft.simulation.dsol.animation.Locatable
getDirZ, getZMethods inherited from interface org.opentrafficsim.core.object.LocatedObject
getGeometry, getHeightMethods inherited from interface org.opentrafficsim.base.geometry.OtsLocatable
getBounds
-
Constructor Details
-
Distraction
public Distraction(String id, Lane lane, org.djunits.value.vdouble.scalar.Length longitudinalPosition, OtsSimulatorInterface simulator, Distraction.DistractionProfile profile) throws NetworkException - Parameters:
id- String; idlane- Lane; lanelongitudinalPosition- Length; longitudinal positionsimulator- OtsSimulatorInterface; simulatorprofile- DistractionProfile; distraction profile- Throws:
NetworkException- on network exception
-
-
Method Details
-
getDistraction
Returns the level of distraction at the given distance.- Parameters:
distance- Distance to distraction; negative when approaching- Returns:
- Double; level of distraction (task-demand), or
nullif the distraction is no longer important
-