Class SpeedSign

    • Constructor Detail

      • SpeedSign

        public SpeedSign​(String id,
                         Lane lane,
                         LongitudinalDirectionality direction,
                         Length longitudinalPosition,
                         OTSSimulatorInterface simulator,
                         Speed speed,
                         GTUType gtuType,
                         Duration startTimeOfDay,
                         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
        direction - LongitudinalDirectionality; driving direction for which the new SpeedSign applies
        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
      • SpeedSign

        public SpeedSign​(String id,
                         Lane lane,
                         LongitudinalDirectionality direction,
                         Length longitudinalPosition,
                         OTSSimulatorInterface simulator,
                         Speed speed,
                         GTUType gtuType)
                  throws NetworkException
        Speed sign active all day.
        Parameters:
        id - String; id
        lane - Lane; lane
        direction - LongitudinalDirectionality; direction
        longitudinalPosition - Length; longitudinal position
        simulator - OTSSimulatorInterface; simulator
        speed - Speed; speed
        gtuType - GTUType; GTU type
        Throws:
        NetworkException - when the position on the lane is out of bounds
      • SpeedSign

        public SpeedSign​(String id,
                         Lane lane,
                         LongitudinalDirectionality direction,
                         Length longitudinalPosition,
                         OTSSimulatorInterface simulator,
                         Speed speed,
                         Duration startTimeOfDay,
                         Duration endTimeOfDay)
                  throws NetworkException
        Speed sign for all GTU types.
        Parameters:
        id - String; id
        lane - Lane; lane
        direction - LongitudinalDirectionality; direction
        longitudinalPosition - Length; longitudinal position
        simulator - OTSSimulatorInterface; simulator
        speed - Speed; speed
        startTimeOfDay - Duration; start time-of-day
        endTimeOfDay - Duration; end time-of-day
        Throws:
        NetworkException - when the position on the lane is out of bounds
      • SpeedSign

        public SpeedSign​(String id,
                         Lane lane,
                         LongitudinalDirectionality direction,
                         Length longitudinalPosition,
                         OTSSimulatorInterface simulator,
                         Speed speed)
                  throws NetworkException
        Speed sign active all day for all GTU types.
        Parameters:
        id - String; id
        lane - Lane; lane
        direction - LongitudinalDirectionality; direction
        longitudinalPosition - Length; longitudinal position
        simulator - OTSSimulatorInterface; simulator
        speed - Speed; speed
        Throws:
        NetworkException - when the position on the lane is out of bounds
    • Method Detail

      • isActive

        public final boolean isActive​(GTUType gtuTypeIn,
                                      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 Speed getSpeed()
        Returns the speed.
        Returns:
        the speed
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object