public class DirectNeighborsPerception extends LaneBasedAbstractPerceptionCategory implements NeighborsPerception
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 |
LOOKBACK
Look back parameter type.
|
MAX_RED_DECELERATION, MAX_YELLOW_DECELERATION
Constructor and Description |
---|
DirectNeighborsPerception(LanePerception perception,
HeadwayGtuType headwayGtuType) |
Modifier and Type | Method and Description |
---|---|
boolean |
computeGtuAlongside(LateralDirectionality lat)
Computes whether there is a GTU alongside.
|
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.
|
String |
toString() |
void |
updateAll() |
computeIfAbsent, computeIfAbsent, computeIfAbsent
getGtu, getObjectOrNull, getPerception, getTimestamp
protected static final ParameterTypeLength LOOKAHEAD
protected static final ParameterTypeLength LOOKBACK
public DirectNeighborsPerception(LanePerception perception, HeadwayGtuType headwayGtuType)
perception
- LanePerception; perceptionheadwayGtuType
- HeadwayGtuType; type of headway gtu to generatepublic final void updateAll() throws GTUException, NetworkException, ParameterException
updateAll
in interface PerceptionCategory<LaneBasedGTU,LanePerception>
GTUException
NetworkException
ParameterException
public final 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 NeighborsPerception
lat
- LateralDirectionality; LEFT or RIGHTParameterException
- if parameter is not definedNullPointerException
- if lat
is null
IllegalArgumentException
- if lat
is NONE
public final 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 NeighborsPerception
lat
- LateralDirectionality; LEFT or RIGHTParameterException
- if parameter is not definedNullPointerException
- if lat
is null
IllegalArgumentException
- if lat
is NONE
public final boolean isGtuAlongside(LateralDirectionality lat) throws ParameterException, NullPointerException, IllegalArgumentException
isGtuAlongside
in interface NeighborsPerception
lat
- LateralDirectionality; LEFT or RIGHTParameterException
- if parameter is not definedNullPointerException
- if lat
is null
IllegalArgumentException
- if lat
is NONE
public boolean computeGtuAlongside(LateralDirectionality lat)
lat
- LateralDirectionality; lateral directionalitypublic final PerceptionCollectable<HeadwayGTU,LaneBasedGTU> getLeaders(RelativeLane lane)
getLeaders
in interface NeighborsPerception
lane
- RelativeLane; relative lateral lanepublic final PerceptionCollectable<HeadwayGTU,LaneBasedGTU> getFollowers(RelativeLane lane)
getFollowers
in interface NeighborsPerception
lane
- RelativeLane; relative lateral laneCopyright © 2014–2019 Delft University of Technology. All rights reserved.