Class DirectInfrastructurePerception
java.lang.Object
org.opentrafficsim.core.gtu.perception.AbstractPerceptionCategory<LaneBasedGtu,LanePerception>
org.opentrafficsim.road.gtu.perception.categories.DirectInfrastructurePerception
- All Implemented Interfaces:
Type<AbstractPerceptionCategory<LaneBasedGtu,,LanePerception>> PerceptionCategory<LaneBasedGtu,,LanePerception> InfrastructurePerception,LaneBasedPerceptionCategory
public class DirectInfrastructurePerception
extends AbstractPerceptionCategory<LaneBasedGtu,LanePerception>
implements InfrastructurePerception
Perceives information concerning the infrastructure, including splits, lanes, speed limits and road markings. This category
is optimized by cooperating closely with the
LaneStructure and only updating internal information when the GTU is on
a new Lane. On the Lane information is defined relative to the start, and thus easily calculated at each
time.
Copyright (c) 2013-2026 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
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParameterTypeLengthRange of lane change info perception.static final ParameterTypeLengthRange of lane change possibility perception. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a set of relative lanes representing the cross section.Returns infrastructure lane change info of a lane.org.djunits.value.vdouble.scalar.LengthgetLegalLaneChangePossibility(RelativeLane fromLane, LateralDirectionality lat) Returns the distance over which a lane change remains legally possible.SortedMap<org.djunits.value.vdouble.scalar.Length,DirectedPoint2d> Relevant points in path from scanning.Returns infrastructure lane change info of a lane.org.djunits.value.vdouble.scalar.LengthgetPhysicalLaneChangePossibility(RelativeLane fromLane, LateralDirectionality lat) Returns the distance over which a lane change remains physically possible.Optional<DistancedObject<org.djunits.value.vdouble.scalar.Speed>>Returns speed bump information.getSpeedLimits(RelativeLane lane) Returns the current speed limits.final StringtoString()Methods inherited from class org.opentrafficsim.core.gtu.perception.AbstractPerceptionCategory
cacheAsString, computeIfAbsent, computeIfAbsent, computeIfAbsent, getGtu, getPerception, getTimestamp
-
Field Details
-
LANE_STRUCTURE
Range of lane change info perception. -
LOOKAHEAD
Range of lane change possibility perception.
-
-
Constructor Details
-
DirectInfrastructurePerception
Constructor.- Parameters:
perception- perception
-
-
Method Details
-
getLegalLaneChangeInfo
Description copied from interface:InfrastructurePerceptionReturns infrastructure lane change info of a lane. A set is returned as multiple points may force lane changes. Which point is considered most critical is a matter of driver interpretation and may change over time. This is shown below. Suppose vehicle A needs to take the off-ramp, and that behavior is that the minimum distance per required lane change determines how critical it is. First, 400m before the lane-drop, the off-ramp is critical. 300m downstream, the lane-drop is critical. Info is sorted by distance, closest first._______ _ _A_ _\_________ _ _ _ _ _ _ _ _ _ _________ _ _ ___ \_______ (-) Lane-drop: 1 lane change in 400m (400m per lane change) (--------) Off-ramp: 3 lane changes in 900m (300m per lane change, critical) (-) Lane-drop: 1 lane change in 100m (100m per lane change, critical) (--------) Off-ramp: 3 lane changes in 600m (200m per lane change)- Specified by:
getLegalLaneChangeInfoin interfaceInfrastructurePerception- Parameters:
lane- relative lateral lane- Returns:
- infrastructure lane change info of a lane
-
getPhysicalLaneChangeInfo
Description copied from interface:InfrastructurePerceptionReturns infrastructure lane change info of a lane. A set is returned as multiple points may force lane changes. Which point is considered most critical is a matter of driver interpretation and may change over time. This is shown below. Suppose vehicle A needs to take the off-ramp, and that behavior is that the minimum distance per required lane change determines how critical it is. First, 400m before the lane-drop, the off-ramp is critical. 300m downstream, the lane-drop is critical. Info is sorted by distance, closest first._______ _ _A_ _\_________ _ _ _ _ _ _ _ _ _ _________ _ _ ___ \_______ (-) Lane-drop: 1 lane change in 400m (400m per lane change) (--------) Off-ramp: 3 lane changes in 900m (300m per lane change, critical) (-) Lane-drop: 1 lane change in 100m (100m per lane change, critical) (--------) Off-ramp: 3 lane changes in 600m (200m per lane change)- Specified by:
getPhysicalLaneChangeInfoin interfaceInfrastructurePerception- Parameters:
lane- relative lateral lane- Returns:
- infrastructure lane change info of a lane
-
getSpeedLimits
Description copied from interface:InfrastructurePerceptionReturns the current speed limits.- Specified by:
getSpeedLimitsin interfaceInfrastructurePerception- Parameters:
lane- lane for the speed limits- Returns:
- current speed limits.
-
getLegalLaneChangePossibility
public org.djunits.value.vdouble.scalar.Length getLegalLaneChangePossibility(RelativeLane fromLane, LateralDirectionality lat) Description copied from interface:InfrastructurePerceptionReturns the distance over which a lane change remains legally possible. Negative values indicate the distance over which a lane change is legally not possible.- Specified by:
getLegalLaneChangePossibilityin interfaceInfrastructurePerception- Parameters:
fromLane- lane from which the lane change possibility is requestedlat- LEFT or RIGHT, null not allowed- Returns:
- distance over which a lane change remains possible
-
getPhysicalLaneChangePossibility
public org.djunits.value.vdouble.scalar.Length getPhysicalLaneChangePossibility(RelativeLane fromLane, LateralDirectionality lat) Description copied from interface:InfrastructurePerceptionReturns the distance over which a lane change remains physically possible. Negative values indicate the distance over which a lane change is physically not possible.- Specified by:
getPhysicalLaneChangePossibilityin interfaceInfrastructurePerception- Parameters:
fromLane- lane from which the lane change possibility is requestedlat- LEFT or RIGHT, null not allowed- Returns:
- distance over which a lane change remains possible
-
getCrossSection
Description copied from interface:InfrastructurePerceptionReturns a set of relative lanes representing the cross section. Lanes are sorted left to right.- Specified by:
getCrossSectionin interfaceInfrastructurePerception- Returns:
- set of relative lanes representing the cross section
-
getPathScan
Description copied from interface:InfrastructurePerceptionRelevant points in path from scanning.- Specified by:
getPathScanin interfaceInfrastructurePerception- Returns:
- relevant points in path from scanning
-
getSpeedBump
Description copied from interface:InfrastructurePerceptionReturns speed bump information.- Specified by:
getSpeedBumpin interfaceInfrastructurePerception- Returns:
- distance and speed of first downstream speed bump.
-
toString
-