Class LaneDirectionRecord
- java.lang.Object
-
- org.opentrafficsim.road.gtu.lane.perception.LaneDirectionRecord
-
- All Implemented Interfaces:
LaneRecord<LaneDirectionRecord>
public class LaneDirectionRecord extends Object implements LaneRecord<LaneDirectionRecord>
A light-weight wrapper for LaneRecord search tools (PerceptionIterator). This is suitable for situations where parts of the network not in the LaneStructure need to be perceived, such as conflicting lanes at intersection conflicts. Searches can only be simple upstream or downstream searches, without lateral movement and without regard of a route. This class should not be used whenever the LaneStructure can be used, as this class builds up a new tree each time step.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
-
-
Constructor Summary
Constructors Constructor Description LaneDirectionRecord(Lane lane, GTUDirectionality dir, Length startDistance, GTUType gtuType)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GTUDirectionality
getDirection()
Returns the direction of travel.Lane
getLane()
Returns the lane.Length
getLength()
Returns the length of the lane.List<LaneDirectionRecord>
getNext()
Returns a list of next lanes.List<LaneDirectionRecord>
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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opentrafficsim.road.gtu.lane.perception.LaneRecord
getDistanceToPosition, isDownstreamBranch
-
-
-
-
Constructor Detail
-
LaneDirectionRecord
public LaneDirectionRecord(Lane lane, GTUDirectionality dir, Length startDistance, GTUType gtuType)
Constructor.- Parameters:
lane
- Lane; lanedir
- GTUDirectionality; direction of travelstartDistance
- Length; distance to startgtuType
- GTUType; GTU type
-
-
Method Detail
-
getNext
public List<LaneDirectionRecord> getNext()
Returns a list of next lanes. Callers of this method do not have to mind GTUDirectionality, this is taken care of.- Specified by:
getNext
in interfaceLaneRecord<LaneDirectionRecord>
- Returns:
- List; list of next lanes
-
getPrev
public List<LaneDirectionRecord> getPrev()
Returns a list of previous lanes. Callers of this method do not have to mind GTUDirectionality, this is taken care of.- Specified by:
getPrev
in interfaceLaneRecord<LaneDirectionRecord>
- Returns:
- List; list of previous lanes
-
getStartDistance
public Length getStartDistance()
Returns the distance from a reference to the start of this lane, negative for upstream distance.- Specified by:
getStartDistance
in interfaceLaneRecord<LaneDirectionRecord>
- Returns:
- Length; the distance from a reference to the start of this lane, negative for upstream distance
-
getLength
public Length getLength()
Returns the length of the lane.- Specified by:
getLength
in interfaceLaneRecord<LaneDirectionRecord>
- Returns:
- Length; length of the lane.
-
getDirection
public GTUDirectionality getDirection()
Returns the direction of travel.- Specified by:
getDirection
in interfaceLaneRecord<LaneDirectionRecord>
- Returns:
- GTUDirectionality; direction of travel
-
getLane
public Lane getLane()
Returns the lane.- Specified by:
getLane
in interfaceLaneRecord<LaneDirectionRecord>
- Returns:
- Lane lane;
-
-