Class LaneRecord
java.lang.Object
org.opentrafficsim.road.gtu.perception.structure.LaneRecord
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionLaneRecord(Lane lane, RelativeLane relativeLane, org.djunits.value.vdouble.scalar.Length startDistance, org.djunits.value.vdouble.scalar.Length mergeDistance) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLateral(LaneRecord lateral) Add lateral lane.voidaddNext(LaneRecord downstream) Add downstream lane.voidaddPrev(LaneRecord upstream) Add downstream lane.org.djunits.value.vdouble.scalar.LengthReturns the end distance.getLane()Returns the lane.org.djunits.value.vdouble.scalar.LengthReturns the merge distance, i.e. the ego-distance after which this road merges with the road of this record.getNext()Returns a list of next lanes.getPrev()Returns a list of previous lanes.Returns the relative lane.org.djunits.value.vdouble.scalar.LengthReturns the start distance.booleanReturns whether the record is part of the downstream branch.booleanReturns whether the record is on the route.lateral()Get lateral lanes.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opentrafficsim.road.gtu.perception.structure.LaneRecordInterface
getDistanceToPosition, getLength
-
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
Returns the lane.- Specified by:
getLanein interfaceLaneRecordInterface<LaneRecord>- Returns:
- lane.
-
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:
getStartDistancein interfaceLaneRecordInterface<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:LaneRecordInterfaceReturns 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:
getMergeDistancein interfaceLaneRecordInterface<LaneRecord>- Returns:
- merge distance.
-
addNext
Add downstream lane.- Parameters:
downstream- downstream lane.
-
getNext
Description copied from interface:LaneRecordInterfaceReturns a list of next lanes.- Specified by:
getNextin interfaceLaneRecordInterface<LaneRecord>- Returns:
- list of next lanes
-
addPrev
Add downstream lane.- Parameters:
upstream- downstream lane.
-
getPrev
Description copied from interface:LaneRecordInterfaceReturns a list of previous lanes.- Specified by:
getPrevin interfaceLaneRecordInterface<LaneRecord>- Returns:
- list of previous lanes
-
addLateral
Add lateral lane.- Parameters:
lateral- downstream lane.
-
lateral
Description copied from interface:LaneRecordInterfaceGet lateral lanes.- Specified by:
lateralin interfaceLaneRecordInterface<LaneRecord>- Returns:
- lateral lanes.
-
isOnRoute
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:LaneRecordInterfaceReturns 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 returnstrue.- Specified by:
isDownstreamBranchin interfaceLaneRecordInterface<LaneRecord>- Returns:
- whether the record is part of the downstream branch
-
toString
-