java.lang.Object
org.opentrafficsim.road.gtu.perception.structure.LaneRecord
All Implemented Interfaces:
LaneRecordInterface<LaneRecord>

public class LaneRecord extends Object implements LaneRecordInterface<LaneRecord>
Record of a lane within the lane structure.

Copyright (c) 2024-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Wouter Schakel
  • Constructor Details

    • LaneRecord

      public LaneRecord(Lane lane, RelativeLane relativeLane, org.djunits.value.vdouble.scalar.Length startDistance, org.djunits.value.vdouble.scalar.Length mergeDistance)
      Constructor.
      Parameters:
      lane - lane.
      relativeLane - relative lane.
      startDistance - start distance.
      mergeDistance - merge distance, i.e. the distance after which this road merges with the road the GTU is at.
  • Method Details

    • getLane

      public Lane getLane()
      Returns the lane.
      Specified by:
      getLane in interface LaneRecordInterface<LaneRecord>
      Returns:
      lane.
    • getRelativeLane

      public RelativeLane getRelativeLane()
      Returns the relative lane.
      Returns:
      relative lane.
    • getStartDistance

      public org.djunits.value.vdouble.scalar.Length getStartDistance()
      Returns the start distance. This value is negative for anything upstream of the reference point of the GTU.
      Specified by:
      getStartDistance in interface LaneRecordInterface<LaneRecord>
      Returns:
      start distance.
    • getEndDistance

      public org.djunits.value.vdouble.scalar.Length getEndDistance()
      Returns the end distance. This value is negative for anything upstream of the reference point of the GTU.
      Returns:
      end distance.
    • getMergeDistance

      public org.djunits.value.vdouble.scalar.Length getMergeDistance()
      Description copied from interface: LaneRecordInterface
      Returns the merge distance, i.e. the ego-distance after which this road merges with the road of this record. Returns zero if this is not the other road upstream of a merge.
      Specified by:
      getMergeDistance in interface LaneRecordInterface<LaneRecord>
      Returns:
      merge distance.
    • addNext

      public void addNext(LaneRecord downstream)
      Add downstream lane.
      Parameters:
      downstream - downstream lane.
    • getNext

      public Set<LaneRecord> getNext()
      Description copied from interface: LaneRecordInterface
      Returns a list of next lanes.
      Specified by:
      getNext in interface LaneRecordInterface<LaneRecord>
      Returns:
      list of next lanes
    • addPrev

      public void addPrev(LaneRecord upstream)
      Add downstream lane.
      Parameters:
      upstream - downstream lane.
    • getPrev

      public Set<LaneRecord> getPrev()
      Description copied from interface: LaneRecordInterface
      Returns a list of previous lanes.
      Specified by:
      getPrev in interface LaneRecordInterface<LaneRecord>
      Returns:
      list of previous lanes
    • addLateral

      public void addLateral(LaneRecord lateral)
      Add lateral lane.
      Parameters:
      lateral - downstream lane.
    • lateral

      public Set<LaneRecord> lateral()
      Description copied from interface: LaneRecordInterface
      Get lateral lanes.
      Specified by:
      lateral in interface LaneRecordInterface<LaneRecord>
      Returns:
      lateral lanes.
    • isOnRoute

      public boolean isOnRoute(Route route)
      Returns whether the record is on the route.
      Parameters:
      route - route.
      Returns:
      whether the record is on the route
    • isDownstreamBranch

      public boolean isDownstreamBranch()
      Description copied from interface: LaneRecordInterface
      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 returns true.
      Specified by:
      isDownstreamBranch in interface LaneRecordInterface<LaneRecord>
      Returns:
      whether the record is part of the downstream branch
    • toString

      public String toString()
      Overrides:
      toString in class Object