public class InfrastructureLaneChangeInfo extends Object implements Comparable<InfrastructureLaneChangeInfo>, Serializable
Copyright (c) 2013-2017 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,
org.opentrafficsim.core.gtu.RelativePosition relativePosition,
boolean deadEnd,
org.opentrafficsim.core.network.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.
|
org.opentrafficsim.core.network.LateralDirectionality |
getLateralDirectionality()
Returns the lateral directionality of the required lane changes.
|
org.djunits.value.vdouble.scalar.Length |
getRemainingDistance() |
int |
getRequiredNumberOfLaneChanges() |
boolean |
isDeadEnd() |
InfrastructureLaneChangeInfo |
left(LaneStructureRecord rec,
org.opentrafficsim.core.gtu.RelativePosition rel,
boolean dead)
Returns lane change info for one lane towards the left.
|
InfrastructureLaneChangeInfo |
right(LaneStructureRecord rec,
org.opentrafficsim.core.gtu.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, org.opentrafficsim.core.gtu.RelativePosition relativePosition, boolean deadEnd, org.opentrafficsim.core.network.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 org.djunits.value.vdouble.scalar.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 org.opentrafficsim.core.network.LateralDirectionality getLateralDirectionality()
public final int compareTo(InfrastructureLaneChangeInfo infrastructureLaneChangeInfo)
compareTo
in interface Comparable<InfrastructureLaneChangeInfo>
public final InfrastructureLaneChangeInfo left(LaneStructureRecord rec, org.opentrafficsim.core.gtu.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, org.opentrafficsim.core.gtu.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.