Class DirectIntersectionPerception
- java.lang.Object
-
- org.opentrafficsim.base.Type<AbstractPerceptionCategory<G,P>>
-
- org.opentrafficsim.core.gtu.perception.AbstractPerceptionCategory<LaneBasedGTU,LanePerception>
-
- org.opentrafficsim.road.gtu.lane.perception.categories.LaneBasedAbstractPerceptionCategory
-
- org.opentrafficsim.road.gtu.lane.perception.categories.DirectIntersectionPerception
-
- All Implemented Interfaces:
Serializable,PerceptionCategory<LaneBasedGTU,LanePerception>,IntersectionPerception,LaneBasedPerceptionCategory
public class DirectIntersectionPerception extends LaneBasedAbstractPerceptionCategory implements IntersectionPerception
Perceives traffic lights and intersection conflicts.Copyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version Jul 22, 2016
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static ParameterTypeLengthLOOKAHEADLook ahead parameter type.-
Fields inherited from class org.opentrafficsim.road.gtu.lane.perception.categories.LaneBasedAbstractPerceptionCategory
MAX_RED_DECELERATION, MAX_YELLOW_DECELERATION
-
-
Constructor Summary
Constructors Constructor Description DirectIntersectionPerception(LanePerception perception, HeadwayGtuType headwayGtuType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PerceptionCollectable<HeadwayConflict,Conflict>getConflicts(RelativeLane lane)Returns a set of conflicts along the route.PerceptionCollectable<HeadwayTrafficLight,TrafficLight>getTrafficLights(RelativeLane lane)Returns a set of traffic lights along the route.booleanisAlongsideConflictLeft()Returns whether there is a conflict alongside to the left.booleanisAlongsideConflictRight()Returns whether there is a conflict alongside to the right.StringtoString()voidupdateAll()-
Methods inherited from class org.opentrafficsim.road.gtu.lane.perception.categories.LaneBasedAbstractPerceptionCategory
computeIfAbsent, computeIfAbsent, computeIfAbsent
-
Methods inherited from class org.opentrafficsim.core.gtu.perception.AbstractPerceptionCategory
getGtu, getObjectOrNull, getPerception, getTimestamp
-
-
-
-
Field Detail
-
LOOKAHEAD
protected static final ParameterTypeLength LOOKAHEAD
Look ahead parameter type.
-
-
Constructor Detail
-
DirectIntersectionPerception
public DirectIntersectionPerception(LanePerception perception, HeadwayGtuType headwayGtuType)
- Parameters:
perception- LanePerception; perceptionheadwayGtuType- HeadwayGtuType; type of headway gtu to generate
-
-
Method Detail
-
getTrafficLights
public final PerceptionCollectable<HeadwayTrafficLight,TrafficLight> getTrafficLights(RelativeLane lane)
Returns a set of traffic lights along the route. Traffic lights are sorted by headway value.- Specified by:
getTrafficLightsin interfaceIntersectionPerception- Parameters:
lane- RelativeLane; lane- Returns:
- set of traffic lights along the route
-
getConflicts
public final PerceptionCollectable<HeadwayConflict,Conflict> getConflicts(RelativeLane lane)
Returns a set of conflicts along the route. Conflicts are sorted by headway value.- Specified by:
getConflictsin interfaceIntersectionPerception- Parameters:
lane- RelativeLane; lane- Returns:
- set of conflicts along the route
-
isAlongsideConflictLeft
public final boolean isAlongsideConflictLeft()
Returns whether there is a conflict alongside to the left.- Specified by:
isAlongsideConflictLeftin interfaceIntersectionPerception- Returns:
- whether there is a conflict alongside to the left
-
isAlongsideConflictRight
public final boolean isAlongsideConflictRight()
Returns whether there is a conflict alongside to the right.- Specified by:
isAlongsideConflictRightin interfaceIntersectionPerception- Returns:
- whether there is a conflict alongside to the right
-
updateAll
public void updateAll() throws GTUException, NetworkException, ParameterException- Specified by:
updateAllin interfacePerceptionCategory<LaneBasedGTU,LanePerception>- Throws:
GTUExceptionNetworkExceptionParameterException
-
-