Class CategoricalLanePerception
java.lang.Object
org.opentrafficsim.core.gtu.perception.AbstractPerception<LaneBasedGtu>
org.opentrafficsim.road.gtu.lane.perception.CategoricalLanePerception
- All Implemented Interfaces:
Serializable
,Perception<LaneBasedGtu>
,LanePerception
public class CategoricalLanePerception
extends AbstractPerception<LaneBasedGtu>
implements LanePerception
The perception module of a GTU based on lanes. It is responsible for perceiving (sensing) the environment of the GTU, which
includes the locations of other GTUs. Perception is done at a certain time, and the perceived information might have a
limited validity. In that sense, Perception is stateful. Information can be requested as often as needed, but will only be
recalculated when asked explicitly. This abstract class provides the building blocks for lane-based perception.
Perception for lane-based GTUs involves information about GTUs in front of the owner GTU on the same lane (the 'leader' GTU), parallel vehicles (important if we want to change lanes), distance to other vehicles on parallel lanes, as well in front as to the back (important if we want to change lanes), and information about obstacles, traffic lights, speed signs, and ending lanes.
Perception for lane-based GTUs involves information about GTUs in front of the owner GTU on the same lane (the 'leader' GTU), parallel vehicles (important if we want to change lanes), distance to other vehicles on parallel lanes, as well in front as to the back (important if we want to change lanes), and information about obstacles, traffic lights, speed signs, and ending lanes.
This class allows PerceptionCategory
s that are either eager or lazy. All categories will have the updateAll
method invoked prior to an operational plan being determined. Categories may ignore this and instead evaluate results only
when the tactical planner requests them.
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreate a new LanePerception module without mental module.CategoricalLanePerception
(LaneBasedGtu gtu, Mental mental) Create a new LanePerception module with mental module. -
Method Summary
Modifier and TypeMethodDescriptionfinal LaneStructure
Return the lane structure.Returns the mental module of perception.void
perceive()
Methods inherited from class org.opentrafficsim.core.gtu.perception.AbstractPerception
addPerceptionCategory, contains, getGtu, getPerceptionCategory, getPerceptionCategoryOrNull, removePerceptionCategory, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opentrafficsim.core.gtu.perception.Perception
addPerceptionCategory, contains, getGtu, getPerceptionCategory, getPerceptionCategoryOrNull, removePerceptionCategory
-
Field Details
-
LOOKAHEAD
protected static final org.opentrafficsim.base.parameters.ParameterTypeLength LOOKAHEADLook ahead parameter type. -
LOOKBACK
protected static final org.opentrafficsim.base.parameters.ParameterTypeLength LOOKBACKLook back parameter type.
-
-
Constructor Details
-
CategoricalLanePerception
Create a new LanePerception module without mental module.- Parameters:
gtu
- LaneBasedGtu; GTU
-
CategoricalLanePerception
Create a new LanePerception module with mental module.- Parameters:
gtu
- LaneBasedGtu; GTUmental
- Mental; mental module
-
-
Method Details
-
getLaneStructure
public final LaneStructure getLaneStructure() throws org.opentrafficsim.base.parameters.ParameterExceptionReturn the lane structure.- Specified by:
getLaneStructure
in interfaceLanePerception
- Returns:
- LaneStructure; lane structure.
- Throws:
org.opentrafficsim.base.parameters.ParameterException
- on exception.
-
getMental
Returns the mental module of perception.- Specified by:
getMental
in interfaceLanePerception
- Returns:
- Mental; mental module of perception, may be
null
if not used
-
perceive
public void perceive() throws GtuException, NetworkException, org.opentrafficsim.base.parameters.ParameterException- Specified by:
perceive
in interfacePerception<LaneBasedGtu>
- Throws:
GtuException
NetworkException
org.opentrafficsim.base.parameters.ParameterException
-