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

public interface LaneBasedObject extends LocatedObject
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
  • 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

      default Length getLength()
      Returns the length of the object. The default value is zero.
      Returns:
      length of the object
    • getLocation

      DirectedPoint2d getLocation()
      Specified by:
      getLocation in interface nl.tudelft.simulation.dsol.animation.Locatable
      Specified by:
      getLocation in interface OtsShape
    • getLine

      default PolyLine2d 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

      default OtsSimulatorInterface getSimulator()
      Returns the simulator.
      Returns:
      simulator
    • makeLine

      static PolyLine2d makeLine(Lane lane, 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 - the lane for which to make a perpendicular geometry
      longitudinalPosition - the position on the lane
      Returns:
      lateral line at position
    • makeLine

      static PolyLine2d makeLine(Lane lane, 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 - the lane for which to make a perpendicular geometry
      longitudinalPosition - the position on the lane
      relativeWidth - lane width to use
      Returns:
      lateral line at position