public class InfrastructureLaneChangeInfo extends Object implements Comparable<InfrastructureLaneChangeInfo>, Serializable
Copyright (c) 2013-2018 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
- required number of lane changesdeadEnd
- whether the need to change lane comes from a dead-endpublic InfrastructureLaneChangeInfo(int requiredNumberOfLaneChanges, LaneStructureRecord record, RelativePosition relativePosition, boolean deadEnd, LateralDirectionality lat)
requiredNumberOfLaneChanges
- required number of lane changesrecord
- record who's end defines the remaining distancerelativePosition
- critical relative position (i.e. nose when driving forward)deadEnd
- 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
- 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
- record who's end defines the remaining distancerel
- critical relative position (i.e. nose when driving forward)dead
- whether the need to change lane comes from a dead-endpublic final InfrastructureLaneChangeInfo right(LaneStructureRecord rec, RelativePosition rel, boolean dead)
rec
- record who's end defines the remaining distancerel
- critical relative position (i.e. nose when driving forward)dead
- whether the need to change lane comes from a dead-endpublic static InfrastructureLaneChangeInfo fromInaccessibleLane(boolean deadEnd)
deadEnd
- dead endCopyright © 2014–2018 Delft University of Technology. All rights reserved.