public class HistoricalNeighborsPerception extends AbstractPerceptionCategory<LaneBasedGTU,LanePerception> implements NeighborsPerception, Serializable
Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
| Constructor and Description |
|---|
HistoricalNeighborsPerception(LanePerception perception,
HeadwayGtuType headwayGtuType) |
HistoricalNeighborsPerception(LanePerception perception,
int nFollowers,
int nLeaders,
HeadwayGtuType headwayGtuType) |
| Modifier and Type | Method and Description |
|---|---|
SortedSet<HeadwayGTU> |
getFirstFollowers(LateralDirectionality lat)
Set of followers on a lane, which is usually 0 or 1, but possibly more in case of an upstream merge with no intermediate
GTU.
|
SortedSet<HeadwayGTU> |
getFirstLeaders(LateralDirectionality lat)
Set of leaders on a lane, which is usually 0 or 1, but possibly more in case of a downstream split with no intermediate
GTU.
|
PerceptionCollectable<HeadwayGTU,LaneBasedGTU> |
getFollowers(RelativeLane lane)
Set of followers on a lane, including adjacent GTU's who's FRONT is back of the own vehicle FRONT.
|
PerceptionCollectable<HeadwayGTU,LaneBasedGTU> |
getLeaders(RelativeLane lane)
Set of leaders on a lane, including adjacent GTU's who's FRONT is ahead of the own vehicle FRONT.
|
boolean |
isGtuAlongside(LateralDirectionality lat)
Whether there is a GTU alongside, i.e.
|
void |
updateAll() |
void |
updateFirstFollowers(LateralDirectionality lat)
Update set of followers on a lane, which is usually 0 or 1, but possibly more in case of an upstream merge with no
intermediate GTU.
|
void |
updateFirstLeaders(LateralDirectionality lat)
Update set of leaders on a lane, which is usually 0 or 1, but possibly more in case of a downstream split with no
intermediate GTU.
|
void |
updateFollowers(RelativeLane lane)
Update set of followers on a lane, including adjacent GTU's who's FRONT is back of the own vehicle FRONT.
|
void |
updateGtuAlongside(LateralDirectionality lat)
Update whether there is a GTU alongside, i.e.
|
void |
updateLeaders(RelativeLane lane)
Update set of leaders on a lane, including adjacent GTU's who's FRONT is ahead of the own vehicle FRONT.
|
getGtu, getObjectOrNull, getPerception, getTimestamppublic HistoricalNeighborsPerception(LanePerception perception, HeadwayGtuType headwayGtuType)
public HistoricalNeighborsPerception(LanePerception perception, int nFollowers, int nLeaders, HeadwayGtuType headwayGtuType)
public void updateAll()
throws GTUException,
NetworkException,
ParameterException
updateAll in interface PerceptionCategory<LaneBasedGTU,LanePerception>GTUExceptionNetworkExceptionParameterExceptionpublic void updateFirstLeaders(LateralDirectionality lat) throws ParameterException, GTUException, NetworkException
updateFirstLeaders in interface NeighborsPerceptionlat - LEFT or RIGHTParameterException - if a parameter was not present or out of boundsGTUException - if the GTU was not initializedNetworkException - in case of a network exceptionpublic void updateFirstFollowers(LateralDirectionality lat) throws GTUException, ParameterException, NetworkException
updateFirstFollowers in interface NeighborsPerceptionlat - LEFT or RIGHTGTUException - if the GTU was not initializedParameterException - if a parameter was not present or out of boundsNetworkException - in case of a network exceptionpublic void updateGtuAlongside(LateralDirectionality lat) throws GTUException, ParameterException, NetworkException
updateGtuAlongside in interface NeighborsPerceptionlat - LEFT or RIGHTGTUException - if the GTU was not initializedParameterException - if parameter is not definedNetworkException - in case of a network exceptionpublic void updateLeaders(RelativeLane lane) throws ParameterException, GTUException, NetworkException
updateLeaders in interface NeighborsPerceptionlane - relative lateral laneParameterException - if a parameter was not present or out of boundsGTUException - if the GRU was not initializedNetworkException - in case of a network exceptionpublic void updateFollowers(RelativeLane lane) throws GTUException, NetworkException, ParameterException
updateFollowers in interface NeighborsPerceptionlane - relative lateral laneGTUException - if the GRU was not initializedNetworkException - in case of a network exceptionParameterException - if a parameter was not present or out of boundspublic SortedSet<HeadwayGTU> getFirstLeaders(LateralDirectionality lat) throws ParameterException, NullPointerException, IllegalArgumentException
| |
_________/B/_____
_ _?_ _ _~_ _C_ _
_ _A_ _ _ _ _ _ _
_________________
Only vehicles who's rear is beyond the own front are considered, no alongside vehicles.getFirstLeaders in interface NeighborsPerceptionlat - LEFT or RIGHTParameterException - if parameter is not definedNullPointerException - if lat is nullIllegalArgumentException - if lat is NONEpublic SortedSet<HeadwayGTU> getFirstFollowers(LateralDirectionality lat) throws ParameterException, NullPointerException, IllegalArgumentException
| |
|C|
________\ \______
_ _B_|_ _ _ _ _?_
_ _ _|_ _ _ _ _A_
_____|___________
Only vehicles who's front is before the own rear are considered, no alongside vehicles.getFirstFollowers in interface NeighborsPerceptionlat - LEFT or RIGHTParameterException - if parameter is not definedNullPointerException - if lat is nullIllegalArgumentException - if lat is NONEpublic boolean isGtuAlongside(LateralDirectionality lat) throws ParameterException, NullPointerException, IllegalArgumentException
isGtuAlongside in interface NeighborsPerceptionlat - LEFT or RIGHTParameterException - if parameter is not definedNullPointerException - if lat is nullIllegalArgumentException - if lat is NONEpublic PerceptionCollectable<HeadwayGTU,LaneBasedGTU> getLeaders(RelativeLane lane)
getLeaders in interface NeighborsPerceptionlane - relative lateral lanepublic PerceptionCollectable<HeadwayGTU,LaneBasedGTU> getFollowers(RelativeLane lane)
getFollowers in interface NeighborsPerceptionlane - relative lateral laneCopyright © 2014–2018 Delft University of Technology. All rights reserved.