Class LocalDistraction
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.LocalDistraction
- All Implemented Interfaces:
nl.tudelft.simulation.dsol.animation.Locatable,Identifiable,EventProducer,OtsShape,LocatedObject,LaneBasedObject
Local distraction.
Copyright (c) 2024-2025s Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Wouter Schakel
-
Field Summary
Fields inherited from interface org.djutils.event.EventProducer
FIRST_POSITION, LAST_POSITIONFields inherited from interface org.opentrafficsim.base.geometry.OtsShape
DEFAULT_POLYGON_SEGMENTS, WORLD_MARGIN_LINE -
Constructor Summary
ConstructorsConstructorDescriptionLocalDistraction(String id, LanePosition position, Length range, double distractionLevel, LateralDirectionality side) Constructor. -
Method Summary
Methods inherited from class org.opentrafficsim.road.network.lane.object.AbstractLaneBasedObject
getFullId, getLane, getLine, getLongitudinalPosition, init, toStringMethods inherited from class org.opentrafficsim.core.object.StaticObject
create, create, getAbsoluteContour, getHeight, getId, getLocation, getRelativeBounds, getRelativeContourMethods inherited from class org.djutils.event.LocalEventProducer
getEventListenerMapMethods 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, getLocation, getSimulatorMethods inherited from interface nl.tudelft.simulation.dsol.animation.Locatable
getZMethods inherited from interface org.opentrafficsim.core.object.LocatedObject
getHeightMethods inherited from interface org.opentrafficsim.base.geometry.OtsShape
contains, contains, getAbsoluteBounds, getAbsoluteContour, getAbsoluteContour, getDirZ, getRelativeBounds, getRelativeContour, signedDistance, signedDistance
-
Constructor Details
-
LocalDistraction
public LocalDistraction(String id, LanePosition position, Length range, double distractionLevel, LateralDirectionality side) throws NetworkException Constructor.- Parameters:
id- idposition- positionrange- range of the distraction (upstream of the location)distractionLevel- level of the distraction in the range [0...1)side- side if the distraction- Throws:
NetworkException- when the position is not correctIllegalArgumentException- when the range is not a positiveLength, or the level is not in range [0...1)NullPointerException- when side isnull
-
-
Method Details
-
getRange
Returns the range of the distraction, which applies upstream of the location.- Returns:
- range of the distraction
-
getDistractionLevel
public double getDistractionLevel()Returns the distraction level as normalized task demand.- Returns:
- distraction level
-
getSide
Returns the side of the distraction, relative to the driving direction.- Returns:
- side of the distraction
-