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
All Methods Instance Methods Concrete Methods 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, 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:
getNextin 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:
getPrevin 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:
getStartDistancein 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:
getLengthin interfaceLaneRecord<LaneDirectionRecord>- Returns:
- Length; length of the lane.
-
getDirection
public GtuDirectionality getDirection()
Returns the direction of travel.- Specified by:
getDirectionin interfaceLaneRecord<LaneDirectionRecord>- Returns:
- GTUDirectionality; direction of travel
-
getLane
public Lane getLane()
Returns the lane.- Specified by:
getLanein interfaceLaneRecord<LaneDirectionRecord>- Returns:
- Lane lane;
-
-