Interface LaneRecord<R extends LaneRecord<R>>
-
- Type Parameters:
R
- lane record type
- All Known Subinterfaces:
LaneStructureRecord
- All Known Implementing Classes:
LaneDirectionRecord
,RollingLaneStructureRecord
public interface LaneRecord<R extends LaneRecord<R>>
Interface representing a lane for search algorithms, in particular PerceptionIterable.Copyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version 19 feb. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel\
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description GTUDirectionality
getDirection()
Returns the direction of travel.default Length
getDistanceToPosition(Length position)
Returns the distance from the reference to the given location.Lane
getLane()
Returns the lane.Length
getLength()
Returns the length of the lane.List<? extends R>
getNext()
Returns a list of next lanes.List<? extends R>
getPrev()
Returns a list of previous lanes.Length
getStartDistance()
Returns the distance from a reference to the start of this lane, negative for upstream distance.default boolean
isDownstreamBranch()
Returns whether the record is part of the downstream branch.
-
-
-
Method Detail
-
getNext
List<? extends R> getNext()
Returns a list of next lanes. Callers of this method do not have to mind GTUDirectionality, this is taken care of.- Returns:
- List; list of next lanes
-
getPrev
List<? extends R> getPrev()
Returns a list of previous lanes. Callers of this method do not have to mind GTUDirectionality, this is taken care of.- Returns:
- List; list of previous lanes
-
getStartDistance
Length getStartDistance()
Returns the distance from a reference to the start of this lane, negative for upstream distance.- Returns:
- Length; the distance from a reference to the start of this lane, negative for upstream distance
-
getLength
Length getLength()
Returns the length of the lane.- Returns:
- Length; length of the lane.
-
getDirection
GTUDirectionality getDirection()
Returns the direction of travel.- Returns:
- GTUDirectionality; direction of travel
-
getLane
Lane getLane()
Returns the lane.- Returns:
- Lane lane;
-
getDistanceToPosition
default Length getDistanceToPosition(Length position)
Returns the distance from the reference to the given location. Callers of this method do not have to mind GTUDirectionality, this is taken care of.- Parameters:
position
- Length; position on the lane- Returns:
- Length; distance from the reference to the given location
-
isDownstreamBranch
default boolean isDownstreamBranch()
Returns whether the record is part of the downstream branch. This means the GTU can potentially get here and the lane is not upstream or on the other branch upstream of a merge. Default implementation returnstrue
.- Returns:
- Boolean; whether the record is part of the downstream branch
-
-