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 org.opentrafficsim.base.parameters.ParameterTypeLength
LOOKAHEAD
Look 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.boolean
isAlongsideConflictLeft()
Returns whether there is a conflict alongside to the left.boolean
isAlongsideConflictRight()
Returns whether there is a conflict alongside to the right.String
toString()
void
updateAll()
-
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
-
-
-
-
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:
getTrafficLights
in 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:
getConflicts
in 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:
isAlongsideConflictLeft
in 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:
isAlongsideConflictRight
in interfaceIntersectionPerception
- Returns:
- whether there is a conflict alongside to the right
-
updateAll
public void updateAll() throws GTUException, NetworkException, org.opentrafficsim.base.parameters.ParameterException
- Specified by:
updateAll
in interfacePerceptionCategory<LaneBasedGTU,LanePerception>
- Throws:
GTUException
NetworkException
org.opentrafficsim.base.parameters.ParameterException
-
-