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 Summary
ConstructorDescriptionLanePathInfo
(OtsLine2d path, List<Lane> laneList, org.djunits.value.vdouble.scalar.Length referencePosition) Creates an instance of aLanePathInfo
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final Lane
The reference lane is the widest lane on which the reference point of the GTU is fully registered.final int
hashCode()
Returns a hash code value for this object.laneList()
Returns the value of thelaneList
record component.path()
Returns the value of thepath
record component.org.djunits.value.vdouble.scalar.Length
Returns the value of thereferencePosition
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
LanePathInfo
public LanePathInfo(OtsLine2d path, List<Lane> laneList, org.djunits.value.vdouble.scalar.Length referencePosition) Creates an instance of aLanePathInfo
record class.- Parameters:
path
- the value for thepath
record componentlaneList
- the value for thelaneList
record componentreferencePosition
- the value for thereferencePosition
record component
-
-
Method Details
-
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
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. -
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. -
equals
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 withObjects::equals(Object,Object)
. -
path
Returns the value of thepath
record component.- Returns:
- the value of the
path
record component
-
laneList
Returns the value of thelaneList
record component.- Returns:
- the value of the
laneList
record component
-
referencePosition
public org.djunits.value.vdouble.scalar.Length referencePosition()Returns the value of thereferencePosition
record component.- Returns:
- the value of the
referencePosition
record component
-