Class AbstractLanePerception
- java.lang.Object
-
- org.opentrafficsim.core.gtu.perception.AbstractPerception<LaneBasedGTU>
-
- org.opentrafficsim.road.gtu.lane.perception.AbstractLanePerception
-
- All Implemented Interfaces:
Serializable,Perception<LaneBasedGTU>,LanePerception
- Direct Known Subclasses:
CategoricalLanePerception
public abstract class AbstractLanePerception 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.This class allows
PerceptionCategorys that are either eager or lazy. All categories will have theupdateAllmethod 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-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
$LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version Nov 15, 2015
BSD-style license. See OpenTrafficSim License.- 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.protected static ParameterTypeLengthLOOKBACKLook back parameter type.protected static ParameterTypeLengthPERCEPTIONPerception parameter type.
-
Constructor Summary
Constructors Constructor Description AbstractLanePerception(LaneBasedGTU gtu)Create a new LanePerception module without mental module.AbstractLanePerception(LaneBasedGTU gtu, Mental mental)Create a new LanePerception module with mental module.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LaneStructuregetLaneStructure()MentalgetMental()Returns the mental module of perception.voidperceive()-
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.road.gtu.lane.perception.LanePerception
getGtu
-
Methods inherited from interface org.opentrafficsim.core.gtu.perception.Perception
addPerceptionCategory, contains, getPerceptionCategory, getPerceptionCategoryOrNull, removePerceptionCategory
-
-
-
-
Field Detail
-
PERCEPTION
protected static final ParameterTypeLength PERCEPTION
Perception parameter type.
-
LOOKAHEAD
protected static final ParameterTypeLength LOOKAHEAD
Look ahead parameter type.
-
LOOKBACK
protected static final ParameterTypeLength LOOKBACK
Look back parameter type.
-
-
Constructor Detail
-
AbstractLanePerception
public AbstractLanePerception(LaneBasedGTU gtu)
Create a new LanePerception module without mental module.- Parameters:
gtu- LaneBasedGTU; GTU
-
AbstractLanePerception
public AbstractLanePerception(LaneBasedGTU gtu, Mental mental)
Create a new LanePerception module with mental module.- Parameters:
gtu- LaneBasedGTU; GTUmental- Mental; mental module
-
-
Method Detail
-
getLaneStructure
public final LaneStructure getLaneStructure() throws ParameterException
- Specified by:
getLaneStructurein interfaceLanePerception- Returns:
- lane structure to perform perception
- Throws:
ParameterException- if parameter is not defined
-
getMental
public Mental getMental()
Returns the mental module of perception.- Specified by:
getMentalin interfaceLanePerception- Returns:
- Mental; mental module of perception, may be
nullif not used
-
perceive
public void perceive() throws GTUException, NetworkException, ParameterException- Specified by:
perceivein interfacePerception<LaneBasedGTU>- Overrides:
perceivein classAbstractPerception<LaneBasedGTU>- Throws:
GTUExceptionNetworkExceptionParameterException
-
-