Interface LaneBasedObject
- All Superinterfaces:
EventProducer,Identifiable,nl.tudelft.simulation.dsol.animation.Locatable,LocatedObject,OtsShape
- All Known Implementing Classes:
AbstractLaneBasedObject,BusStop,Conflict,Conflict.ConflictEnd,LaneBasedGtu,LaneDetector,LocalDistraction,LoopDetector,ReportingDetector,RoadSideDistraction,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_POSITIONFields inherited from interface org.opentrafficsim.base.geometry.OtsShape
DEFAULT_POLYGON_SEGMENTS, WORLD_MARGIN_LINE -
Method Summary
Modifier and TypeMethodDescriptiongetLane()Returns the lane.default LengthReturns the length of the object.default PolyLine2dgetLine()Returns the line that represent the location of this object on the lane.Returns the longitudinal position.default OtsSimulatorInterfaceReturns the simulator.static PolyLine2dMake a geometry perpendicular to the center line of the lane with a length 90% of the width of the lane.static PolyLine2dMake 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
getZMethods inherited from interface org.opentrafficsim.core.object.LocatedObject
getFullId, getHeightMethods inherited from interface org.opentrafficsim.base.geometry.OtsShape
contains, contains, getAbsoluteBounds, getAbsoluteContour, getAbsoluteContour, getDirZ, getRelativeBounds, getRelativeContour, signedDistance, signedDistance
-
Method Details
-
getLane
Lane getLane()Returns the lane.- Returns:
- lane
-
getLongitudinalPosition
Length getLongitudinalPosition()Returns the longitudinal position.- Returns:
- position (between 0.0 and the length of the lane)
-
getLength
Returns the length of the object. The default value is zero.- Returns:
- length of the object
-
getLocation
DirectedPoint2d getLocation()- Specified by:
getLocationin interfacenl.tudelft.simulation.dsol.animation.Locatable- Specified by:
getLocationin interfaceOtsShape
-
getLine
Returns the line that represent the location of this object on the lane.- Returns:
- the line that represent the location of this object on the lane
-
getSimulator
Returns the simulator.- Returns:
- simulator
-
makeLine
Make a geometry perpendicular to the center line of the lane with a length 90% of the width of the lane.- Parameters:
lane- the lane for which to make a perpendicular geometrylongitudinalPosition- the position on the lane- Returns:
- lateral line at position
-
makeLine
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- the lane for which to make a perpendicular geometrylongitudinalPosition- the position on the lanerelativeWidth- lane width to use- Returns:
- lateral line at position
-