All Implemented Interfaces:
nl.tudelft.simulation.dsol.animation.Locatable, Identifiable, EventProducer, OtsShape, LocatedObject, LaneBasedObject

public class SpeedSign extends AbstractLaneBasedObject
Speed sign.

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
  • Constructor Details

    • SpeedSign

      public SpeedSign(String id, Lane lane, Length longitudinalPosition, Speed speed, GtuType gtuType, Duration startTimeOfDay, Duration endTimeOfDay) throws NetworkException
      Construct a new SpeedSign.
      Parameters:
      id - the id of the new SpeedSign
      lane - Lane on/over which the SpeedSign is positioned
      longitudinalPosition - the longitudinal position along the lane of the new SpeedSign
      speed - the speed limit shown by the new SpeedSign
      gtuType - GTU type that should obey the speed sign
      startTimeOfDay - start time-of-day
      endTimeOfDay - end time-of-day
      Throws:
      NetworkException - when the position on the lane is out of bounds
  • Method Details

    • isActive

      public final boolean isActive(GtuType gtuTypeIn, Duration time)
      Return whether this speed limit is currently active.
      Parameters:
      gtuTypeIn - GTU type
      time - current time-of-day
      Returns:
      whether this speed limit is currently active
    • getSpeed

      public final Speed getSpeed()
      Returns the speed.
      Returns:
      the speed
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public final String toString()
      Overrides:
      toString in class AbstractLaneBasedObject