public class SpeedSign extends AbstractLaneBasedObject
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
listeners
FIRST_POSITION, LAST_POSITION
Constructor and Description |
---|
SpeedSign(String id,
Lane lane,
LongitudinalDirectionality direction,
Length longitudinalPosition,
SimulatorInterface.TimeDoubleUnit simulator,
Speed speed)
Speed sign active all day for all GTU types.
|
SpeedSign(String id,
Lane lane,
LongitudinalDirectionality direction,
Length longitudinalPosition,
SimulatorInterface.TimeDoubleUnit simulator,
Speed speed,
Duration startTimeOfDay,
Duration endTimeOfDay)
Speed sign for all GTU types.
|
SpeedSign(String id,
Lane lane,
LongitudinalDirectionality direction,
Length longitudinalPosition,
SimulatorInterface.TimeDoubleUnit simulator,
Speed speed,
GTUType gtuType)
Speed sign active all day.
|
SpeedSign(String id,
Lane lane,
LongitudinalDirectionality direction,
Length longitudinalPosition,
SimulatorInterface.TimeDoubleUnit simulator,
Speed speed,
GTUType gtuType,
Duration startTimeOfDay,
Duration endTimeOfDay)
Construct a new SpeedSign.
|
Modifier and Type | Method and Description |
---|---|
AbstractLaneBasedObject |
clone(CrossSectionElement newCSE,
SimulatorInterface.TimeDoubleUnit newSimulator)
Clone the LaneBasedObject for e.g., copying a network.
|
boolean |
equals(Object obj) |
Speed |
getSpeed()
Returns the speed.
|
int |
hashCode() |
boolean |
isActive(GTUType gtuTypeIn,
Duration time)
Return whether this speed limit is currently active.
|
String |
toString() |
clone, getDirection, getFullId, getLane, getLocation, getLongitudinalPosition
getBounds, getGeometry, getHeight, getId
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, removeAllListeners, removeAllListeners, removeListener
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getBounds, makeGeometry
getGeometry, getHeight
getId
addListener, addListener, addListener, addListener, removeListener
public SpeedSign(String id, Lane lane, LongitudinalDirectionality direction, Length longitudinalPosition, SimulatorInterface.TimeDoubleUnit simulator, Speed speed, GTUType gtuType, Duration startTimeOfDay, Duration endTimeOfDay) throws NetworkException
id
- String; the id of the new SpeedSignlane
- Lane; Lane on/over which the SpeedSign is positioneddirection
- LongitudinalDirectionality; driving direction for which the new SpeedSign applieslongitudinalPosition
- Length; the longitudinal position along the lane of the new SpeedSignsimulator
- SimulatorInterface.TimeDoubleUnit; the simulatorspeed
- Speed; the speed limit shown by the new SpeedSigngtuType
- GTUType; GTU type that should obey the speed signstartTimeOfDay
- Duration; start time-of-dayendTimeOfDay
- Duration; end time-of-dayNetworkException
- when the position on the lane is out of boundspublic SpeedSign(String id, Lane lane, LongitudinalDirectionality direction, Length longitudinalPosition, SimulatorInterface.TimeDoubleUnit simulator, Speed speed, GTUType gtuType) throws NetworkException
id
- String; idlane
- Lane; lanedirection
- LongitudinalDirectionality; directionlongitudinalPosition
- Length; longitudinal positionsimulator
- SimulatorInterface.TimeDoubleUnit; simulatorspeed
- Speed; speedgtuType
- GTUType; GTU typeNetworkException
- when the position on the lane is out of boundspublic SpeedSign(String id, Lane lane, LongitudinalDirectionality direction, Length longitudinalPosition, SimulatorInterface.TimeDoubleUnit simulator, Speed speed, Duration startTimeOfDay, Duration endTimeOfDay) throws NetworkException
id
- String; idlane
- Lane; lanedirection
- LongitudinalDirectionality; directionlongitudinalPosition
- Length; longitudinal positionsimulator
- SimulatorInterface.TimeDoubleUnit; simulatorspeed
- Speed; speedstartTimeOfDay
- Duration; start time-of-dayendTimeOfDay
- Duration; end time-of-dayNetworkException
- when the position on the lane is out of boundspublic SpeedSign(String id, Lane lane, LongitudinalDirectionality direction, Length longitudinalPosition, SimulatorInterface.TimeDoubleUnit simulator, Speed speed) throws NetworkException
id
- String; idlane
- Lane; lanedirection
- LongitudinalDirectionality; directionlongitudinalPosition
- Length; longitudinal positionsimulator
- SimulatorInterface.TimeDoubleUnit; simulatorspeed
- Speed; speedNetworkException
- when the position on the lane is out of boundspublic final boolean isActive(GTUType gtuTypeIn, Duration time)
gtuTypeIn
- GTUType; GTU typetime
- Duration; current time-of-daypublic final Speed getSpeed()
public final AbstractLaneBasedObject clone(CrossSectionElement newCSE, SimulatorInterface.TimeDoubleUnit newSimulator) throws NetworkException
clone
in class AbstractLaneBasedObject
newCSE
- CrossSectionElement; the new cross section element to which the clone belongsnewSimulator
- SimulatorInterface.TimeDoubleUnit; the new simulator for this networkNetworkException
- in case the cloning failspublic final String toString()
toString
in class AbstractLaneBasedObject
Copyright © 2014–2019 Delft University of Technology. All rights reserved.