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-2020 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
Modifier and Type Method Description GTUDirectionalitygetDirection()Returns the direction of travel.LanegetLane()Returns the lane.LengthgetLength()Returns the length of the lane.List<LaneDirectionRecord>getNext()Returns a list of next lanes.List<LaneDirectionRecord>getPrev()Returns a list of previous lanes.LengthgetStartDistance()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, waitMethods inherited from interface org.opentrafficsim.road.gtu.lane.perception.LaneRecord
getDistanceToPosition, isDownstreamBranch
-
Constructor Details
-
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 Details
-
getNext
Returns a list of next lanes. Callers of this method do not have to mind GTUDirectionality, this is taken care of.- Specified by:
getNextin interfaceLaneRecord<LaneDirectionRecord>- Returns:
- List; list of next lanes
-
getPrev
Returns a list of previous lanes. Callers of this method do not have to mind GTUDirectionality, this is taken care of.- Specified by:
getPrevin interfaceLaneRecord<LaneDirectionRecord>- Returns:
- List; list of previous lanes
-
getStartDistance
Returns the distance from a reference to the start of this lane, negative for upstream distance.- Specified by:
getStartDistancein interfaceLaneRecord<LaneDirectionRecord>- Returns:
- Length; the distance from a reference to the start of this lane, negative for upstream distance
-
getLength
Returns the length of the lane.- Specified by:
getLengthin interfaceLaneRecord<LaneDirectionRecord>- Returns:
- Length; length of the lane.
-
getDirection
Returns the direction of travel.- Specified by:
getDirectionin interfaceLaneRecord<LaneDirectionRecord>- Returns:
- GTUDirectionality; direction of travel
-
getLane
Returns the lane.- Specified by:
getLanein interfaceLaneRecord<LaneDirectionRecord>- Returns:
- Lane lane;
-