Interface LaneBasedObject
- All Superinterfaces:
org.djutils.event.EventProducer,org.djutils.base.Identifiable,nl.tudelft.simulation.dsol.animation.Locatable,LocatedObject,org.opentrafficsim.base.geometry.OtsLocatable,Remote,Serializable
- All Known Implementing Classes:
AbstractLaneBasedObject,BusStop,Conflict,Conflict.ConflictEnd,Distraction,LaneDetector,LoopDetector,ReportingDetector,SinkDetector,SpeedSign,TrafficLight,TrafficLightDetector.StartEndDetector
Objects that can be encountered on a Lane like conflict areas, GTUs, traffic lights, stop lines, etc.
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
-
Field Summary
Fields inherited from interface org.djutils.event.EventProducer
FIRST_POSITION, LAST_POSITION -
Method Summary
Modifier and TypeMethodDescriptiongetLane()org.djutils.draw.point.OrientedPoint2dorg.djunits.value.vdouble.scalar.Lengthstatic org.djutils.draw.line.PolyLine2dmakeGeometry(Lane lane, org.djunits.value.vdouble.scalar.Length longitudinalPosition) Make a geometry perpendicular to the center line of the lane with a length 90% of the width of the lane.static org.djutils.draw.line.PolyLine2dmakeGeometry(Lane lane, org.djunits.value.vdouble.scalar.Length longitudinalPosition, double relativeWidth) Make a geometry perpendicular to the center line of the lane with a length of given fraction of the width of the lane.Methods 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 nl.tudelft.simulation.dsol.animation.Locatable
getDirZ, getZMethods inherited from interface org.opentrafficsim.core.object.LocatedObject
getFullId, getGeometry, getHeightMethods inherited from interface org.opentrafficsim.base.geometry.OtsLocatable
getBounds
-
Method Details
-
getLane
Lane getLane()- Returns:
- The lane for which this is a sensor.
-
getLongitudinalPosition
org.djunits.value.vdouble.scalar.Length getLongitudinalPosition()- Returns:
- the position (between 0.0 and the length of the Lane) of the sensor on the design line of the lane.
-
getLocation
org.djutils.draw.point.OrientedPoint2d getLocation()- Specified by:
getLocationin interfacenl.tudelft.simulation.dsol.animation.Locatable- Specified by:
getLocationin interfaceorg.opentrafficsim.base.geometry.OtsLocatable
-
makeGeometry
static org.djutils.draw.line.PolyLine2d makeGeometry(Lane lane, org.djunits.value.vdouble.scalar.Length longitudinalPosition) Make a geometry perpendicular to the center line of the lane with a length 90% of the width of the lane.- Parameters:
lane- Lane; the lane for which to make a perpendicular geometrylongitudinalPosition- Length; the position on the lane- Returns:
- an OtsLine2d that describes the line
-
makeGeometry
static org.djutils.draw.line.PolyLine2d makeGeometry(Lane lane, org.djunits.value.vdouble.scalar.Length longitudinalPosition, double relativeWidth) Make a geometry perpendicular to the center line of the lane with a length of given fraction of the width of the lane.- Parameters:
lane- Lane; the lane for which to make a perpendicular geometrylongitudinalPosition- Length; the position on the lanerelativeWidth- double; lane width to use- Returns:
- an OtsLine2d that describes the line
-