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, Drawable, 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
See Also:
  • Field Summary

    Fields inherited from interface org.djutils.event.EventProducer

    FIRST_POSITION, LAST_POSITION
  • Constructor Summary

    Constructors
    Constructor
    Description
    SpeedSign(String id, Lane lane, org.djunits.value.vdouble.scalar.Length longitudinalPosition, OtsSimulatorInterface simulator, org.djunits.value.vdouble.scalar.Speed speed, GtuType gtuType, org.djunits.value.vdouble.scalar.Duration startTimeOfDay, org.djunits.value.vdouble.scalar.Duration endTimeOfDay)
    Construct a new SpeedSign.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    final org.djunits.value.vdouble.scalar.Speed
    Returns the speed.
    int
    final boolean
    isActive(GtuType gtuTypeIn, org.djunits.value.vdouble.scalar.Duration time)
    Return whether this speed limit is currently active.
    final String

    Methods inherited from class org.opentrafficsim.road.network.lane.object.AbstractLaneBasedObject

    getFullId, getLane, getLongitudinalPosition, init

    Methods inherited from class org.opentrafficsim.core.object.StaticObject

    create, create, getBounds, getGeometry, getHeight, getId, getLocation

    Methods inherited from class org.djutils.event.LocalEventProducer

    addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventListenerMap, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    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, removeListener

    Methods inherited from interface org.djutils.base.Identifiable

    getId

    Methods inherited from interface org.opentrafficsim.road.network.lane.object.LaneBasedObject

    getLength, getLocation

    Methods inherited from interface nl.tudelft.simulation.dsol.animation.Locatable

    getDirZ, getZ

    Methods inherited from interface org.opentrafficsim.core.object.LocatedObject

    getGeometry, getHeight

    Methods inherited from interface org.opentrafficsim.base.geometry.OtsLocatable

    getBounds
  • Constructor Details

    • SpeedSign

      public SpeedSign(String id, Lane lane, org.djunits.value.vdouble.scalar.Length longitudinalPosition, OtsSimulatorInterface simulator, org.djunits.value.vdouble.scalar.Speed speed, GtuType gtuType, org.djunits.value.vdouble.scalar.Duration startTimeOfDay, org.djunits.value.vdouble.scalar.Duration endTimeOfDay) throws NetworkException
      Construct a new SpeedSign.
      Parameters:
      id - String; the id of the new SpeedSign
      lane - Lane; Lane on/over which the SpeedSign is positioned
      longitudinalPosition - Length; the longitudinal position along the lane of the new SpeedSign
      simulator - OtsSimulatorInterface; the simulator
      speed - Speed; the speed limit shown by the new SpeedSign
      gtuType - GtuType; GTU type that should obey the speed sign
      startTimeOfDay - Duration; start time-of-day
      endTimeOfDay - Duration; 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, org.djunits.value.vdouble.scalar.Duration time)
      Return whether this speed limit is currently active.
      Parameters:
      gtuTypeIn - GtuType; GTU type
      time - Duration; current time-of-day
      Returns:
      whether this speed limit is currently active
    • getSpeed

      public final org.djunits.value.vdouble.scalar.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