Class HeadwayTrafficLight
- java.lang.Object
-
- org.opentrafficsim.road.gtu.lane.perception.headway.AbstractHeadway
-
- org.opentrafficsim.road.gtu.lane.perception.headway.AbstractHeadwayCopy
-
- org.opentrafficsim.road.gtu.lane.perception.headway.AbstractHeadwayLaneBasedObject
-
- org.opentrafficsim.road.gtu.lane.perception.headway.HeadwayTrafficLight
-
- All Implemented Interfaces:
Serializable
,Comparable<Headway>
,Identifiable
,PerceivedObject
,Headway
,HeadwayLaneBasedObject
public class HeadwayTrafficLight extends AbstractHeadwayLaneBasedObject
Container for a reference to information about a (lane based) traffic light and a headway to the traffic light.Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision: 1368 $, $LastChangedDate: 2015-09-02 00:20:20 +0200 (Wed, 02 Sep 2015) $, by $Author: averbraeck $,
initial version 11 feb. 2015
- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.opentrafficsim.road.gtu.lane.perception.headway.Headway
Headway.ObjectType
-
-
Constructor Summary
Constructors Constructor Description HeadwayTrafficLight(TrafficLight trafficLight, Length distance)
Construct a new Headway information object, for a traffic light ahead of us (or behind us, although that does not seem very useful).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TrafficLightColor
getTrafficLightColor()
String
toString()
-
Methods inherited from class org.opentrafficsim.road.gtu.lane.perception.headway.AbstractHeadwayLaneBasedObject
getLane
-
Methods inherited from class org.opentrafficsim.road.gtu.lane.perception.headway.AbstractHeadwayCopy
equals, getAcceleration, getId, getLength, getObjectType, getSpeed, hashCode
-
Methods inherited from class org.opentrafficsim.road.gtu.lane.perception.headway.AbstractHeadway
getDistance, getOverlap, getOverlapFront, getOverlapRear, isAhead, isBehind, isParallel
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opentrafficsim.road.gtu.lane.perception.headway.Headway
compareTo, getAcceleration, getDistance, getId, getLength, getObjectType, getOverlap, getOverlapFront, getOverlapRear, getSpeed, isAhead, isBehind, isParallel
-
-
-
-
Constructor Detail
-
HeadwayTrafficLight
public HeadwayTrafficLight(TrafficLight trafficLight, Length distance) throws GTUException
Construct a new Headway information object, for a traffic light ahead of us (or behind us, although that does not seem very useful).- Parameters:
trafficLight
- TrafficLight; the traffic light object for further observation, can not be null.distance
- Length; the distance to the traffic light, distance cannot be null.- Throws:
GTUException
- when id is null, or parameters are inconsistent
-
-
Method Detail
-
getTrafficLightColor
public final TrafficLightColor getTrafficLightColor()
- Returns:
- the traffic light color.
-
toString
public final String toString()
- Overrides:
toString
in classAbstractHeadway
-
-