public class DirectInfrastructurePerception extends LaneBasedAbstractPerceptionCategory implements InfrastructurePerception
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-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
MAX_RED_DECELERATION, MAX_YELLOW_DECELERATION
Constructor and Description |
---|
DirectInfrastructurePerception(LanePerception perception) |
Modifier and Type | Method and Description |
---|---|
SortedSet<RelativeLane> |
getCrossSection()
Returns a set of relative lanes representing the cross section.
|
SortedSet<InfrastructureLaneChangeInfo> |
getInfrastructureLaneChangeInfo(RelativeLane lane)
Returns infrastructure lane change info of a lane.
|
Length |
getLegalLaneChangePossibility(RelativeLane fromLane,
LateralDirectionality lat)
Returns the distance over which a lane change remains legally possible.
|
Length |
getPhysicalLaneChangePossibility(RelativeLane fromLane,
LateralDirectionality lat)
Returns the distance over which a lane change remains physically possible.
|
SpeedLimitProspect |
getSpeedLimitProspect(RelativeLane lane)
Returns the prospect for speed limits on a lane (dynamic speed limits may vary between lanes).
|
TimeStampedObject<SortedSet<RelativeLane>> |
getTimeStampedCrossSection()
Returns a time stamped set of relative lanes representing the cross section.
|
TimeStampedObject<SortedSet<InfrastructureLaneChangeInfo>> |
getTimeStampedInfrastructureLaneChangeInfo(RelativeLane lane)
Returns time stamped infrastructure lane change info of a lane.
|
TimeStampedObject<Length> |
getTimeStampedLegalLaneChangePossibility(RelativeLane fromLane,
LateralDirectionality lat)
Returns the time stamped distance over which a lane change remains legally possible.
|
TimeStampedObject<Length> |
getTimeStampedPhysicalLaneChangePossibility(RelativeLane fromLane,
LateralDirectionality lat)
Returns the time stamped distance over which a lane change remains physically possible.
|
TimeStampedObject<SpeedLimitProspect> |
getTimeStampedSpeedLimitProspect(RelativeLane lane)
Returns the time stamped prospect for speed limits on a lane (dynamic speed limits may vary between lanes).
|
String |
toString() |
void |
updateAll() |
void |
updateCrossSection()
Updates a set of relative lanes representing the cross section.
|
void |
updateInfrastructureLaneChangeInfo(RelativeLane lane)
Updates the infrastructural lane change info.
|
void |
updateLegalLaneChangePossibility(RelativeLane lane,
LateralDirectionality lat)
Updates the distance over which lane changes remains legally possible.
|
void |
updatePhysicalLaneChangePossibility(RelativeLane lane,
LateralDirectionality lat)
Updates the distance over which lane changes remains physically possible.
|
void |
updateSpeedLimitProspect(RelativeLane lane)
Updates the speed limit prospect.
|
computeIfAbsent, computeIfAbsent, computeIfAbsent
getGtu, getObjectOrNull, getPerception, getTimestamp
public DirectInfrastructurePerception(LanePerception perception)
perception
- LanePerception; perceptionpublic void updateAll() throws GTUException, ParameterException
updateAll
in interface PerceptionCategory<LaneBasedGTU,LanePerception>
updateAll
in interface InfrastructurePerception
GTUException
ParameterException
public final void updateInfrastructureLaneChangeInfo(RelativeLane lane) throws GTUException, ParameterException
updateInfrastructureLaneChangeInfo
in interface InfrastructurePerception
lane
- RelativeLane; relative lateral laneGTUException
- if the GTU was not initialized or if the lane is not in the cross sectionParameterException
- if a parameter is not definedpublic final void updateSpeedLimitProspect(RelativeLane lane) throws GTUException, ParameterException
updateSpeedLimitProspect
in interface InfrastructurePerception
lane
- RelativeLane; relative lateral laneGTUException
- if the GTU was not initialized or if the lane is not in the cross sectionParameterException
- if a parameter is not definedpublic final void updateLegalLaneChangePossibility(RelativeLane lane, LateralDirectionality lat) throws GTUException, ParameterException
updateLegalLaneChangePossibility
in interface InfrastructurePerception
lane
- RelativeLane; lane from which the lane change possibility is requestedlat
- LateralDirectionality; LEFT or RIGHT, null not allowedGTUException
- if the GTU was not initialized or if the lane is not in the cross sectionParameterException
- if a parameter is not definedpublic final void updatePhysicalLaneChangePossibility(RelativeLane lane, LateralDirectionality lat) throws GTUException, ParameterException
updatePhysicalLaneChangePossibility
in interface InfrastructurePerception
lane
- RelativeLane; lane from which the lane change possibility is requestedlat
- LateralDirectionality; LEFT or RIGHT, null not allowedGTUException
- if the GTU was not initialized or if the lane is not in the cross sectionParameterException
- if a parameter is not definedpublic final void updateCrossSection() throws GTUException, ParameterException
updateCrossSection
in interface InfrastructurePerception
GTUException
- if the GTU was not initializedParameterException
- if a parameter is not definedpublic final SortedSet<InfrastructureLaneChangeInfo> getInfrastructureLaneChangeInfo(RelativeLane lane)
_______ _ _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)
getInfrastructureLaneChangeInfo
in interface InfrastructurePerception
lane
- RelativeLane; relative lateral lanepublic final SpeedLimitProspect getSpeedLimitProspect(RelativeLane lane)
getSpeedLimitProspect
in interface InfrastructurePerception
lane
- RelativeLane; relative lateral lanepublic final Length getLegalLaneChangePossibility(RelativeLane fromLane, LateralDirectionality lat)
getLegalLaneChangePossibility
in interface InfrastructurePerception
fromLane
- RelativeLane; lane from which the lane change possibility is requestedlat
- LateralDirectionality; LEFT or RIGHT, null not allowedpublic final Length getPhysicalLaneChangePossibility(RelativeLane fromLane, LateralDirectionality lat)
getPhysicalLaneChangePossibility
in interface InfrastructurePerception
fromLane
- RelativeLane; lane from which the lane change possibility is requestedlat
- LateralDirectionality; LEFT or RIGHT, null not allowedpublic final SortedSet<RelativeLane> getCrossSection()
getCrossSection
in interface InfrastructurePerception
public final TimeStampedObject<SortedSet<InfrastructureLaneChangeInfo>> getTimeStampedInfrastructureLaneChangeInfo(RelativeLane lane)
_______ _ _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)
lane
- RelativeLane; relative lateral lanepublic final TimeStampedObject<SpeedLimitProspect> getTimeStampedSpeedLimitProspect(RelativeLane lane)
lane
- RelativeLane; relative lateral lanepublic final TimeStampedObject<Length> getTimeStampedLegalLaneChangePossibility(RelativeLane fromLane, LateralDirectionality lat)
fromLane
- RelativeLane; lane from which the lane change possibility is requestedlat
- LateralDirectionality; LEFT or RIGHT, null not allowedNullPointerException
- if lat == null
public final TimeStampedObject<Length> getTimeStampedPhysicalLaneChangePossibility(RelativeLane fromLane, LateralDirectionality lat)
fromLane
- RelativeLane; lane from which the lane change possibility is requestedlat
- LateralDirectionality; LEFT or RIGHT, null not allowedNullPointerException
- if lat == null
public final TimeStampedObject<SortedSet<RelativeLane>> getTimeStampedCrossSection()
Copyright © 2014–2019 Delft University of Technology. All rights reserved.