Record Class LanePathInfo

java.lang.Object
java.lang.Record
org.opentrafficsim.road.gtu.lane.tactical.LanePathInfo
Record Components:
path - OtsLine2d; the path it the GTU keeps driving in the same lane, and follows the route if possible in the same lane. The path stops when the lane or a continuation lane does not lead in the direction of the route provided by the strategical planner.
laneList - List<Lane>; the current lane on which the reference point of the GTU is registered (if the GTU is registered on multiple lanes with the reference point, one lane is chosen where the reference point has a fractional lane position between 0.0 and 1.0), and consecutive lanes that follow the route if possible in the same lane. The list of lanes stops when a continuation lane does not lead in the direction of the route provided by the strategical planner.
referencePosition - Length; the start point on the first lane in the laneList. When this is a point that represents a GTU position, it should represent the reference point of the GTU.
All Implemented Interfaces:
Serializable

public record LanePathInfo(OtsLine2d path, List<Lane> laneList, org.djunits.value.vdouble.scalar.Length referencePosition) extends Record implements Serializable
This class provides the following information for an operational plan:
  • the lanes to follow, with the direction to drive on them
  • the starting point on the first lane
  • the path to follow when staying on the same lane

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

Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
See Also:
  • Constructor Details

    • LanePathInfo

      public LanePathInfo(OtsLine2d path, List<Lane> laneList, org.djunits.value.vdouble.scalar.Length referencePosition)
      Creates an instance of a LanePathInfo record class.
      Parameters:
      path - the value for the path record component
      laneList - the value for the laneList record component
      referencePosition - the value for the referencePosition record component
  • Method Details

    • getReferenceLane

      public final Lane getReferenceLane()
      The reference lane is the widest lane on which the reference point of the GTU is fully registered.
      Returns:
      the reference lane on which the GTU is registered, or null if the GTU is not registered on any lane.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • path

      public OtsLine2d path()
      Returns the value of the path record component.
      Returns:
      the value of the path record component
    • laneList

      public List<Lane> laneList()
      Returns the value of the laneList record component.
      Returns:
      the value of the laneList record component
    • referencePosition

      public org.djunits.value.vdouble.scalar.Length referencePosition()
      Returns the value of the referencePosition record component.
      Returns:
      the value of the referencePosition record component