public class DirectDefaultSimplePerception extends LaneBasedAbstractPerceptionCategory implements DefaultSimplePerception
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.
Modifier and Type | Field and Description |
---|---|
protected static ParameterTypeLength |
LOOKAHEAD
Look ahead parameter type.
|
protected static ParameterTypeLength |
LOOKBACKOLD
Look back parameter type.
|
MAX_RED_DECELERATION, MAX_YELLOW_DECELERATION
Constructor and Description |
---|
DirectDefaultSimplePerception(LanePerception perception) |
Modifier and Type | Method and Description |
---|---|
Lane |
bestAccessibleAdjacentLane(Lane currentLane,
LateralDirectionality lateralDirection,
Length longitudinalPosition)
Determine whether there is a lane to the left or to the right of this lane, which is accessible from this lane, or null
if no lane could be found.
|
Map<Lane,Set<Lane>> |
getAccessibleAdjacentLanes(LateralDirectionality lateralDirection) |
Map<Lane,Set<Lane>> |
getAccessibleAdjacentLanesLeft() |
Map<Lane,Set<Lane>> |
getAccessibleAdjacentLanesRight() |
Headway |
getBackwardHeadway() |
Headway |
getForwardHeadwayGTU() |
Headway |
getForwardHeadwayObject() |
LanePathInfo |
getLanePathInfo()
Retrieve the last perceived lane path info.
|
Collection<Headway> |
getNeighboringHeadways(LateralDirectionality lateralDirection) |
Collection<Headway> |
getNeighboringHeadwaysLeft() |
Collection<Headway> |
getNeighboringHeadwaysRight() |
Collection<Headway> |
getParallelHeadways(LateralDirectionality lateralDirection) |
Collection<Headway> |
getParallelHeadwaysLeft() |
Collection<Headway> |
getParallelHeadwaysRight() |
Speed |
getSpeedLimit() |
TimeStampedObject<Map<Lane,Set<Lane>>> |
getTimeStampedAccessibleAdjacentLanes(LateralDirectionality lateralDirection) |
TimeStampedObject<Map<Lane,Set<Lane>>> |
getTimeStampedAccessibleAdjacentLanesLeft() |
TimeStampedObject<Map<Lane,Set<Lane>>> |
getTimeStampedAccessibleAdjacentLanesRight() |
TimeStampedObject<Headway> |
getTimeStampedBackwardHeadway() |
TimeStampedObject<Headway> |
getTimeStampedForwardHeadwayGTU() |
TimeStampedObject<Headway> |
getTimeStampedForwardHeadwayObject() |
TimeStampedObject<LanePathInfo> |
getTimeStampedLanePathInfo()
Retrieve the time stamped last perceived lane path info.
|
TimeStampedObject<Collection<Headway>> |
getTimeStampedNeighboringHeadways(LateralDirectionality lateralDirection) |
TimeStampedObject<Collection<Headway>> |
getTimeStampedNeighboringHeadwaysLeft() |
TimeStampedObject<Collection<Headway>> |
getTimeStampedNeighboringHeadwaysRight() |
TimeStampedObject<Collection<Headway>> |
getTimeStampedParallelHeadways(LateralDirectionality lateralDirection) |
TimeStampedObject<Collection<Headway>> |
getTimeStampedParallelHeadwaysLeft() |
TimeStampedObject<Collection<Headway>> |
getTimeStampedParallelHeadwaysRight() |
TimeStampedObject<Speed> |
getTimeStampedSpeedLimit() |
String |
toString() |
void |
updateAccessibleAdjacentLanesLeft()
Update the accessible adjacent lanes on the left.
|
void |
updateAccessibleAdjacentLanesRight()
Update the accessible adjacent lanes on the right.
|
void |
updateBackwardHeadway()
Update the backward headway and first object (e.g., a GTU) behind.
|
void |
updateForwardHeadwayGTU()
Update the forward headway and first object (a GTU) in front.
|
void |
updateForwardHeadwayObject()
Update the forward headway and first object (but not a GTU) in front.
|
void |
updateLanePathInfo() |
void |
updateNeighboringHeadways(LateralDirectionality lateralDirection)
Update the objects (e.g., GTUs) in parallel, in front and behind for the lane in the given direction, with their headway
relative to our GTU, and information about the status of the adjacent objects.
|
void |
updateNeighboringHeadwaysLeft()
Update the objects (e.g., GTUs) in parallel, in front and behind on the left neighboring lane, with their headway
relative to our GTU, and information about the status of the adjacent objects.
|
void |
updateNeighboringHeadwaysRight()
Update the objects (e.g., GTUs) in parallel, in front and behind on the right neighboring lane, with their headway
relative to our GTU, and information about the status of the adjacent objects.
|
void |
updateParallelHeadways(LateralDirectionality lateralDirection)
Update the parallel objects (e.g., GTUs) for the given direction, with information about their status and parallel
overlap with our GTU.
|
void |
updateParallelHeadwaysLeft()
Update the parallel objects (e.g., GTUs) on the left, with information about their status and parallel overlap with our
GTU.
|
void |
updateParallelHeadwaysRight()
Update the parallel objects (e.g., GTUs) on the right, with information about their status and parallel overlap with our
GTU.
|
void |
updateSpeedLimit()
Update speedLimit.
|
computeIfAbsent, computeIfAbsent, computeIfAbsent
getGtu, getObjectOrNull, getPerception, getTimestamp
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
updateAccessibleAdjacentLanes, updateAll
protected static final ParameterTypeLength LOOKAHEAD
protected static final ParameterTypeLength LOOKBACKOLD
public DirectDefaultSimplePerception(LanePerception perception)
perception
- LanePerception; perceptionpublic final void updateLanePathInfo() throws GTUException, NetworkException, ParameterException
updateLanePathInfo
in interface DefaultSimplePerception
GTUException
- when the GTU was not initialized yet.NetworkException
- when the speed limit for a GTU type cannot be retrieved from the network.ParameterException
- in case of not being able to retrieve parameter ParameterTypes.LOOKAHEADpublic final void updateForwardHeadwayGTU() throws GTUException, NetworkException, ParameterException
updateForwardHeadwayGTU
in interface DefaultSimplePerception
GTUException
- when the GTU was not yet initializedNetworkException
- in case of network exceptionParameterException
- if parameter is not defined or out of boundspublic final void updateForwardHeadwayObject() throws GTUException, NetworkException, ParameterException
updateForwardHeadwayObject
in interface DefaultSimplePerception
GTUException
- when the GTU was not yet initializedNetworkException
- in case of network exceptionParameterException
- if parameter is not defined or out of boundspublic final void updateBackwardHeadway() throws GTUException, ParameterException, NetworkException
updateBackwardHeadway
in interface DefaultSimplePerception
GTUException
- when the GTU was not yet initializedParameterException
- if parameter is not defined or out of boundsNetworkException
- in case of network exceptionpublic final void updateAccessibleAdjacentLanesLeft() throws GTUException
updateAccessibleAdjacentLanesLeft
in interface DefaultSimplePerception
GTUException
- when the GTU was not yet initializedpublic final void updateAccessibleAdjacentLanesRight() throws GTUException
updateAccessibleAdjacentLanesRight
in interface DefaultSimplePerception
GTUException
- when the GTU was not yet initializedpublic final void updateNeighboringHeadwaysLeft() throws GTUException, ParameterException, NetworkException
updateNeighboringHeadwaysLeft
in interface DefaultSimplePerception
GTUException
- when the GTU was not yet initializedParameterException
- if parameter is not defined or out of boundsNetworkException
- in case of network exceptionpublic final void updateNeighboringHeadwaysRight() throws GTUException, ParameterException, NetworkException
updateNeighboringHeadwaysRight
in interface DefaultSimplePerception
GTUException
- when the GTU was not yet initializedParameterException
- if parameter is not defined or out of boundsNetworkException
- in case of network exceptionpublic final void updateNeighboringHeadways(LateralDirectionality lateralDirection) throws GTUException, ParameterException, NetworkException
updateNeighboringHeadways
in interface DefaultSimplePerception
lateralDirection
- LateralDirectionality; the direction to update the parallel headway collection forGTUException
- when the GTU was not yet initializedParameterException
- if parameter is not defined or out of boundsNetworkException
- in case of network exceptionpublic final void updateParallelHeadwaysLeft() throws GTUException
updateParallelHeadwaysLeft
in interface DefaultSimplePerception
GTUException
- when the GTU was not yet initializedpublic final void updateParallelHeadwaysRight() throws GTUException
updateParallelHeadwaysRight
in interface DefaultSimplePerception
GTUException
- when the GTU was not yet initializedpublic final void updateParallelHeadways(LateralDirectionality lateralDirection) throws GTUException
updateParallelHeadways
in interface DefaultSimplePerception
lateralDirection
- LateralDirectionality; the direction to return the neighboring headway collection forGTUException
- when the GTU was not yet initializedpublic final void updateSpeedLimit() throws GTUException, NetworkException
updateSpeedLimit
in interface DefaultSimplePerception
GTUException
- when the GTU was not yet initializedNetworkException
- in case of network exceptionpublic final LanePathInfo getLanePathInfo()
getLanePathInfo
in interface DefaultSimplePerception
public final Headway getForwardHeadwayGTU()
getForwardHeadwayGTU
in interface DefaultSimplePerception
public final Headway getForwardHeadwayObject()
getForwardHeadwayObject
in interface DefaultSimplePerception
public final Headway getBackwardHeadway()
getBackwardHeadway
in interface DefaultSimplePerception
public final Map<Lane,Set<Lane>> getAccessibleAdjacentLanesLeft()
getAccessibleAdjacentLanesLeft
in interface DefaultSimplePerception
public final Map<Lane,Set<Lane>> getAccessibleAdjacentLanesRight()
getAccessibleAdjacentLanesRight
in interface DefaultSimplePerception
public final Map<Lane,Set<Lane>> getAccessibleAdjacentLanes(LateralDirectionality lateralDirection)
getAccessibleAdjacentLanes
in interface DefaultSimplePerception
lateralDirection
- LateralDirectionality; the direction to return the accessible adjacent lane map forpublic final Collection<Headway> getNeighboringHeadwaysLeft()
getNeighboringHeadwaysLeft
in interface DefaultSimplePerception
public final Collection<Headway> getNeighboringHeadwaysRight()
getNeighboringHeadwaysRight
in interface DefaultSimplePerception
public final Collection<Headway> getNeighboringHeadways(LateralDirectionality lateralDirection)
getNeighboringHeadways
in interface DefaultSimplePerception
lateralDirection
- LateralDirectionality; the direction to return the parallel headway collection forpublic final Collection<Headway> getParallelHeadwaysLeft()
getParallelHeadwaysLeft
in interface DefaultSimplePerception
public final Collection<Headway> getParallelHeadwaysRight()
getParallelHeadwaysRight
in interface DefaultSimplePerception
public final Collection<Headway> getParallelHeadways(LateralDirectionality lateralDirection)
getParallelHeadways
in interface DefaultSimplePerception
lateralDirection
- LateralDirectionality; the direction to return the neighboring headway collection forpublic final Speed getSpeedLimit()
getSpeedLimit
in interface DefaultSimplePerception
public final TimeStampedObject<Headway> getTimeStampedForwardHeadwayGTU()
public final TimeStampedObject<Headway> getTimeStampedForwardHeadwayObject()
public final TimeStampedObject<Headway> getTimeStampedBackwardHeadway()
public final TimeStampedObject<Map<Lane,Set<Lane>>> getTimeStampedAccessibleAdjacentLanesLeft()
public final TimeStampedObject<Map<Lane,Set<Lane>>> getTimeStampedAccessibleAdjacentLanesRight()
public final TimeStampedObject<Map<Lane,Set<Lane>>> getTimeStampedAccessibleAdjacentLanes(LateralDirectionality lateralDirection)
lateralDirection
- LateralDirectionality; the direction to return the accessible adjacent lanes forpublic final TimeStampedObject<Collection<Headway>> getTimeStampedNeighboringHeadwaysLeft()
public final TimeStampedObject<Collection<Headway>> getTimeStampedNeighboringHeadwaysRight()
public final TimeStampedObject<Collection<Headway>> getTimeStampedNeighboringHeadways(LateralDirectionality lateralDirection)
lateralDirection
- LateralDirectionality; the direction to return the neighboring headways forpublic final TimeStampedObject<Collection<Headway>> getTimeStampedParallelHeadwaysLeft()
public final TimeStampedObject<Collection<Headway>> getTimeStampedParallelHeadwaysRight()
public final TimeStampedObject<Collection<Headway>> getTimeStampedParallelHeadways(LateralDirectionality lateralDirection)
lateralDirection
- LateralDirectionality; the direction to return the parallel headways forpublic final TimeStampedObject<Speed> getTimeStampedSpeedLimit()
public final TimeStampedObject<LanePathInfo> getTimeStampedLanePathInfo()
public final Lane bestAccessibleAdjacentLane(Lane currentLane, LateralDirectionality lateralDirection, Length longitudinalPosition)
bestAccessibleAdjacentLane
in interface DefaultSimplePerception
currentLane
- Lane; the lane to look for the best accessible adjacent lanelateralDirection
- LateralDirectionality; the direction (LEFT, RIGHT) to look atlongitudinalPosition
- Length; the position of the GTU along currentLaneCopyright © 2014–2019 Delft University of Technology. All rights reserved.