Class Shoulder

java.lang.Object
org.djutils.event.LocalEventProducer
All Implemented Interfaces:
Serializable, Remote, nl.tudelft.simulation.dsol.animation.Locatable, org.djutils.base.Identifiable, org.djutils.event.EventProducer, org.opentrafficsim.base.geometry.OtsLocatable, org.opentrafficsim.base.HierarchicallyTyped<LaneType,Lane>, Drawable, SpatialObject

public class Shoulder extends Lane
This class is mostly the same as a Lane. But as a shoulder it can be recognized by algorithms and models to be responded to differently.

Copyright (c) 2024-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Wouter Schakel
See Also:
  • Constructor Details

    • Shoulder

      public Shoulder(CrossSectionLink link, String id, OtsLine2d centerLine, org.djutils.draw.line.Polygon2d contour, List<CrossSectionSlice> crossSectionSlices, LaneType laneType) throws NetworkException
      Constructor specifying geometry.
      Parameters:
      link - CrossSectionLink; link.
      id - String; the id of this lane within the link; should be unique within the link.
      centerLine - OtsLine2d; center line.
      contour - Polygon2d; contour shape.
      crossSectionSlices - List<CrossSectionSlice>; cross-section slices.
      laneType - LaneType; lane type.
      Throws:
      NetworkException - when no cross-section slice is defined.
  • Method Details

    • getAdjacentLane

      public Lane getAdjacentLane(LateralDirectionality laneChangeDirection, GtuType gtuType)
      Returns one adjacent lane.
      Overrides:
      getAdjacentLane in class Lane
      Parameters:
      laneChangeDirection - LateralDirectionality; lane change direction
      gtuType - GtuType; GTU type.
      Returns:
      Lane; adjacent lane, null if none
    • getZ

      public double getZ()
      Retrieve the Z offset (used to determine what covers what when drawing).
      Specified by:
      getZ in interface nl.tudelft.simulation.dsol.animation.Locatable
      Overrides:
      getZ in class CrossSectionElement
      Returns:
      double; the Z-offset for drawing (what's on top, what's underneath).
    • getSpeedLimit

      public org.djunits.value.vdouble.scalar.Speed getSpeedLimit(GtuType gtuType) throws NetworkException
      Get the speed limit of this lane, which can differ per GTU type. E.g., cars might be allowed to drive 120 km/h and trucks 90 km/h.
      Overrides:
      getSpeedLimit in class Lane
      Parameters:
      gtuType - GtuType; the GTU type to provide the speed limit for
      Returns:
      the speedLimit.
      Throws:
      NetworkException - on network inconsistency