public final class NeighborsUtil extends Object
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 | Class and Description |
|---|---|
static class |
NeighborsUtil.DistanceGTU
GTU at a distance, as preliminary info towards perceiving it.
|
| Modifier and Type | Method and Description |
|---|---|
static SortedSet<NeighborsUtil.DistanceGTU> |
getFirstDownstreamGTUs(LaneStructureRecord startRecord,
RelativePosition egoRelativePosition,
RelativePosition egoFrontPosition,
RelativePosition.TYPE otherRelativePosition,
Time now)
Returns a set of first leaders per branch, relative to given relative position.
|
static SortedSet<NeighborsUtil.DistanceGTU> |
getFirstUpstreamGTUs(LaneStructureRecord startRecord,
RelativePosition egoRelativePosition,
RelativePosition egoRearPosition,
RelativePosition.TYPE otherRelativePosition,
Time now)
Returns a set of first followers per branch, relative to given relative position.
|
static SortedSet<HeadwayGTU> |
perceive(SortedSet<NeighborsUtil.DistanceGTU> base,
HeadwayGtuType headwayGtuType,
LaneBasedGTU perceivingGtu,
boolean downstream)
Translation from a set of
DistanceGTU's, to a sorted set of HeadwayGTU's. |
public static SortedSet<NeighborsUtil.DistanceGTU> getFirstDownstreamGTUs(LaneStructureRecord startRecord, RelativePosition egoRelativePosition, RelativePosition egoFrontPosition, RelativePosition.TYPE otherRelativePosition, Time now) throws GTUException, ParameterException
startRecord - LaneStructureRecord; lane structure record to start the search fromegoRelativePosition - RelativePosition; position of GTU to start search fromegoFrontPosition - RelativePosition; front position of GTU to determine headwayotherRelativePosition - RelativePosition.TYPE; position of other GTU that has to be downstreamnow - Time; current timeGTUException - if the GTU was not initializedParameterException - if a parameter was not present or out of boundspublic static SortedSet<NeighborsUtil.DistanceGTU> getFirstUpstreamGTUs(LaneStructureRecord startRecord, RelativePosition egoRelativePosition, RelativePosition egoRearPosition, RelativePosition.TYPE otherRelativePosition, Time now) throws GTUException, ParameterException
startRecord - LaneStructureRecord; lane structure record to start the search fromegoRelativePosition - RelativePosition; position of GTU to start search fromegoRearPosition - RelativePosition; rear position of GTU to determine headwayotherRelativePosition - RelativePosition.TYPE; type of position of other GTU that has to be upstreamnow - Time; current timeGTUException - if the GTU was not initializedParameterException - if a parameter was not present or out of boundspublic static SortedSet<HeadwayGTU> perceive(SortedSet<NeighborsUtil.DistanceGTU> base, HeadwayGtuType headwayGtuType, LaneBasedGTU perceivingGtu, boolean downstream)
DistanceGTU's, to a sorted set of HeadwayGTU's. This bridges the gap between a
raw network search, and the perceived result.base - SortedSet<DistanceGTU>; base set of GTU's at distanceheadwayGtuType - HeadwayGtuType; headway type for perceived GTU'sperceivingGtu - LaneBasedGTU; perceiving GTUdownstream - boolean; whether the GTU's are downstreamCopyright © 2014–2019 Delft University of Technology. All rights reserved.