Class ToledoPerception
java.lang.Object
org.opentrafficsim.core.gtu.perception.AbstractPerceptionCategory<LaneBasedGtu,LanePerception>
org.opentrafficsim.road.gtu.lane.perception.categories.LaneBasedAbstractPerceptionCategory
org.opentrafficsim.road.gtu.lane.tactical.toledo.ToledoPerception
- All Implemented Interfaces:
Serializable
,org.opentrafficsim.base.Type<AbstractPerceptionCategory<LaneBasedGtu,
,LanePerception>> PerceptionCategory<LaneBasedGtu,
,LanePerception> LaneBasedPerceptionCategory
public class ToledoPerception
extends LaneBasedAbstractPerceptionCategory
implements LaneBasedPerceptionCategory
Wrapper class around
InfrastructureCategory
that forwards all methods except for infrastructure lane change info.
These methods determine and return infrastructure information of type InfrastructureLaneChangeInfoToledo
, which
includes split number.
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
Fields inherited from class org.opentrafficsim.road.gtu.lane.perception.categories.LaneBasedAbstractPerceptionCategory
MAX_RED_DECELERATION, MAX_YELLOW_DECELERATION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal SortedSet<RelativeLane>
Returns a set of relative lanes representing the cross section.Returns infrastructure lane change info of a lane.final org.djunits.value.vdouble.scalar.Length
getLegalLaneChangePossibility
(RelativeLane fromLane, LateralDirectionality lat) Returns the distance over which a lane change remains legally possible.final org.djunits.value.vdouble.scalar.Length
getPhysicalLaneChangePossibility
(RelativeLane fromLane, LateralDirectionality lat) Returns the distance over which a lane change remains physically possible.final SpeedLimitProspect
Returns the prospect for speed limits on a lane (dynamic speed limits may vary between lanes).final org.opentrafficsim.base.TimeStampedObject<SortedSet<RelativeLane>>
Returns a time stamped set of relative lanes representing the cross section.final org.opentrafficsim.base.TimeStampedObject<SortedSet<InfrastructureLaneChangeInfoToledo>>
Returns time stamped infrastructure lane change info of a lane.final org.opentrafficsim.base.TimeStampedObject<org.djunits.value.vdouble.scalar.Length>
Returns the time stamped distance over which a lane change remains legally possible.final org.opentrafficsim.base.TimeStampedObject<org.djunits.value.vdouble.scalar.Length>
Returns the time stamped distance over which a lane change remains physically possible.final org.opentrafficsim.base.TimeStampedObject<SpeedLimitProspect>
Returns the time stamped prospect for speed limits on a lane (dynamic speed limits may vary between lanes).final String
toString()
final void
final void
Updates a set of relative lanes representing the cross section.void
Updates the infrastructural lane change info.final void
updateLegalLaneChangePossibility
(RelativeLane fromLane, LateralDirectionality lat) Updates the distance over which lane changes remains legally possible.final void
updatePhysicalLaneChangePossibility
(RelativeLane fromLane, LateralDirectionality lat) Updates the distance over which lane changes remains physically possible.final void
Updates the speed limit prospect.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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opentrafficsim.base.Type
isType
-
Constructor Details
-
ToledoPerception
- Parameters:
perception
- LanePerception; perception
-
-
Method Details
-
updateInfrastructureLaneChangeInfo
Updates the infrastructural lane change info.- Parameters:
lane
- RelativeLane; relative lateral lane- Throws:
GtuException
- when GTU is not initialized
-
getInfrastructureLaneChangeInfo
public final SortedSet<InfrastructureLaneChangeInfoToledo> getInfrastructureLaneChangeInfo(RelativeLane lane) Returns 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)
- Parameters:
lane
- RelativeLane; relative lateral lane- Returns:
- infrastructure lane change info of a lane
-
getTimeStampedInfrastructureLaneChangeInfo
public final org.opentrafficsim.base.TimeStampedObject<SortedSet<InfrastructureLaneChangeInfoToledo>> getTimeStampedInfrastructureLaneChangeInfo(RelativeLane lane) Returns time stamped 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)
- Parameters:
lane
- RelativeLane; relative lateral lane- Returns:
- time stamped infrastructure lane change info of a lane
-
updateSpeedLimitProspect
public final void updateSpeedLimitProspect(RelativeLane lane) throws GtuException, org.opentrafficsim.base.parameters.ParameterException Updates the speed limit prospect.- Parameters:
lane
- RelativeLane; relative lateral lane- Throws:
GtuException
- if the GTU was not initializedorg.opentrafficsim.base.parameters.ParameterException
- if a parameter is not defined
-
updateLegalLaneChangePossibility
public final void updateLegalLaneChangePossibility(RelativeLane fromLane, LateralDirectionality lat) throws GtuException, org.opentrafficsim.base.parameters.ParameterException Updates the distance over which lane changes remains legally possible.- Parameters:
fromLane
- RelativeLane; lane from which the lane change possibility is requestedlat
- LateralDirectionality; LEFT or RIGHT, null not allowed- Throws:
GtuException
- if the GTU was not initializedorg.opentrafficsim.base.parameters.ParameterException
- if a parameter is not defined
-
updatePhysicalLaneChangePossibility
public final void updatePhysicalLaneChangePossibility(RelativeLane fromLane, LateralDirectionality lat) throws GtuException, org.opentrafficsim.base.parameters.ParameterException Updates the distance over which lane changes remains physically possible.- Parameters:
fromLane
- RelativeLane; lane from which the lane change possibility is requestedlat
- LateralDirectionality; LEFT or RIGHT, null not allowed- Throws:
GtuException
- if the GTU was not initializedorg.opentrafficsim.base.parameters.ParameterException
- if a parameter is not defined
-
updateCrossSection
public final void updateCrossSection() throws GtuException, org.opentrafficsim.base.parameters.ParameterExceptionUpdates a set of relative lanes representing the cross section.- Throws:
GtuException
- if the GTU was not initializedorg.opentrafficsim.base.parameters.ParameterException
- if a parameter is not defined
-
getSpeedLimitProspect
Returns the prospect for speed limits on a lane (dynamic speed limits may vary between lanes).- Parameters:
lane
- RelativeLane; relative lateral lane- Returns:
- prospect for speed limits on a lane
-
getLegalLaneChangePossibility
public final org.djunits.value.vdouble.scalar.Length getLegalLaneChangePossibility(RelativeLane fromLane, LateralDirectionality lat) Returns the distance over which a lane change remains legally possible.- Parameters:
fromLane
- RelativeLane; lane from which the lane change possibility is requestedlat
- LateralDirectionality; LEFT or RIGHT, null not allowed- Returns:
- distance over which a lane change remains possible
- Throws:
NullPointerException
- iflat == null
-
getPhysicalLaneChangePossibility
public final org.djunits.value.vdouble.scalar.Length getPhysicalLaneChangePossibility(RelativeLane fromLane, LateralDirectionality lat) Returns the distance over which a lane change remains physically possible.- Parameters:
fromLane
- RelativeLane; lane from which the lane change possibility is requestedlat
- LateralDirectionality; LEFT or RIGHT, null not allowed- Returns:
- distance over which a lane change remains possible
- Throws:
NullPointerException
- iflat == null
-
getCrossSection
Returns a set of relative lanes representing the cross section. Lanes are sorted left to right.- Returns:
- set of relative lanes representing the cross section
-
getTimeStampedSpeedLimitProspect
public final org.opentrafficsim.base.TimeStampedObject<SpeedLimitProspect> getTimeStampedSpeedLimitProspect(RelativeLane lane) Returns the time stamped prospect for speed limits on a lane (dynamic speed limits may vary between lanes).- Parameters:
lane
- RelativeLane; relative lateral lane- Returns:
- time stamped prospect for speed limits on a lane
-
getTimeStampedLegalLaneChangePossibility
public final org.opentrafficsim.base.TimeStampedObject<org.djunits.value.vdouble.scalar.Length> getTimeStampedLegalLaneChangePossibility(RelativeLane fromLane, LateralDirectionality lat) Returns the time stamped distance over which a lane change remains legally possible.- Parameters:
fromLane
- RelativeLane; lane from which the lane change possibility is requestedlat
- LateralDirectionality; LEFT or RIGHT, null not allowed- Returns:
- time stamped distance over which a lane change remains possible
- Throws:
NullPointerException
- iflat == null
-
getTimeStampedPhysicalLaneChangePossibility
public final org.opentrafficsim.base.TimeStampedObject<org.djunits.value.vdouble.scalar.Length> getTimeStampedPhysicalLaneChangePossibility(RelativeLane fromLane, LateralDirectionality lat) Returns the time stamped distance over which a lane change remains physically possible.- Parameters:
fromLane
- RelativeLane; lane from which the lane change possibility is requestedlat
- LateralDirectionality; LEFT or RIGHT, null not allowed- Returns:
- time stamped distance over which a lane change remains possible
- Throws:
NullPointerException
- iflat == null
-
getTimeStampedCrossSection
public final org.opentrafficsim.base.TimeStampedObject<SortedSet<RelativeLane>> getTimeStampedCrossSection()Returns a time stamped set of relative lanes representing the cross section. Lanes are sorted left to right.- Returns:
- time stamped set of relative lanes representing the cross section
-
updateAll
public final 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
-
toString
-