public class InfrastructureLaneChangeInfo extends Object implements Comparable<InfrastructureLaneChangeInfo>, Serializable
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier | Constructor and Description |
---|---|
protected |
InfrastructureLaneChangeInfo(int requiredNumberOfLaneChanges,
boolean deadEnd)
Constructor for subclasses.
|
|
InfrastructureLaneChangeInfo(int requiredNumberOfLaneChanges,
LaneStructureRecord record,
RelativePosition relativePosition,
boolean deadEnd,
LateralDirectionality lat)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(InfrastructureLaneChangeInfo infrastructureLaneChangeInfo) |
static InfrastructureLaneChangeInfo |
fromInaccessibleLane(boolean deadEnd)
Returns an instance for the case the entire lane is inaccessible.
|
LateralDirectionality |
getLateralDirectionality()
Returns the lateral directionality of the required lane changes.
|
Length |
getRemainingDistance() |
int |
getRequiredNumberOfLaneChanges() |
boolean |
isDeadEnd() |
InfrastructureLaneChangeInfo |
left(LaneStructureRecord rec,
RelativePosition rel,
boolean dead)
Returns lane change info for one lane towards the left.
|
InfrastructureLaneChangeInfo |
right(LaneStructureRecord rec,
RelativePosition rel,
boolean dead)
Returns lane change info for one lane towards the right.
|
void |
setDeadEnd(boolean deadEnd)
Sets whether this reason to change lane is due to a dead-end.
|
String |
toString() |
protected InfrastructureLaneChangeInfo(int requiredNumberOfLaneChanges, boolean deadEnd)
requiredNumberOfLaneChanges
- int; required number of lane changesdeadEnd
- boolean; whether the need to change lane comes from a dead-endpublic InfrastructureLaneChangeInfo(int requiredNumberOfLaneChanges, LaneStructureRecord record, RelativePosition relativePosition, boolean deadEnd, LateralDirectionality lat)
requiredNumberOfLaneChanges
- int; required number of lane changesrecord
- LaneStructureRecord; record who's end defines the remaining distancerelativePosition
- RelativePosition; critical relative position (i.e. nose when driving forward)deadEnd
- boolean; whether the need to change lane comes from a dead-endlat
- LateralDirectionality; lateral directionality of required lane changesIllegalArgumentException
- if required number of lane changes or remaining distance is negativeNullPointerException
- if remaining distance is nullpublic final int getRequiredNumberOfLaneChanges()
public Length getRemainingDistance()
public final boolean isDeadEnd()
public final void setDeadEnd(boolean deadEnd)
deadEnd
- boolean; whether the need to change lane comes from a dead-endpublic final LateralDirectionality getLateralDirectionality()
public final int compareTo(InfrastructureLaneChangeInfo infrastructureLaneChangeInfo)
compareTo
in interface Comparable<InfrastructureLaneChangeInfo>
public final InfrastructureLaneChangeInfo left(LaneStructureRecord rec, RelativePosition rel, boolean dead)
rec
- LaneStructureRecord; record who's end defines the remaining distancerel
- RelativePosition; critical relative position (i.e. nose when driving forward)dead
- boolean; whether the need to change lane comes from a dead-endpublic final InfrastructureLaneChangeInfo right(LaneStructureRecord rec, RelativePosition rel, boolean dead)
rec
- LaneStructureRecord; record who's end defines the remaining distancerel
- RelativePosition; critical relative position (i.e. nose when driving forward)dead
- boolean; whether the need to change lane comes from a dead-endpublic static InfrastructureLaneChangeInfo fromInaccessibleLane(boolean deadEnd)
deadEnd
- boolean; dead endCopyright © 2014–2019 Delft University of Technology. All rights reserved.