public class RollingLaneStructureRecord extends Object implements LaneStructureRecord, 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 and Type | Class and Description |
|---|---|
static class |
RollingLaneStructureRecord.RecordLink
Link between records that defines the dependence of start position and hence how this is updated as the GTU moves.
|
| Constructor and Description |
|---|
RollingLaneStructureRecord(Lane lane,
org.opentrafficsim.core.gtu.GTUDirectionality direction,
org.djunits.value.vdouble.scalar.Length startDistance) |
RollingLaneStructureRecord(Lane lane,
org.opentrafficsim.core.gtu.GTUDirectionality direction,
RollingLaneStructureRecord startDistanceSource,
RollingLaneStructureRecord.RecordLink recordLink)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNext(RollingLaneStructureRecord next) |
void |
addPrev(RollingLaneStructureRecord prev) |
boolean |
allowsRoute(org.opentrafficsim.core.network.route.Route route,
org.opentrafficsim.core.gtu.GTUType gtuType)
Returns whether this lane allows the route to be followed.
|
boolean |
allowsRouteAtEnd(org.opentrafficsim.core.network.route.Route route,
org.opentrafficsim.core.gtu.GTUType gtuType)
Returns whether the end of this lane allows the route to be followed.
|
(package private) void |
changeStartDistanceSource(RollingLaneStructureRecord startDistanceSource,
RollingLaneStructureRecord.RecordLink recordLink)
Change the source of the distance.
|
void |
clearCutOffEnd()
Clears the cut-off at the end.
|
void |
clearCutOffStart()
Clears the cut-off at the start.
|
(package private) void |
clearNextList()
Clears the next list.
|
(package private) void |
clearPrevList()
Clears the prev list.
|
org.djunits.value.vdouble.scalar.Length |
getCutOffEnd()
Returns distance where the structure was cut-off.
|
org.djunits.value.vdouble.scalar.Length |
getCutOffStart()
Returns distance where the structure was cut-off.
|
org.opentrafficsim.core.gtu.GTUDirectionality |
getDirection()
Returns the direction of travel.
|
org.opentrafficsim.core.network.Node |
getFromNode()
Returns the the 'from' node of the link belonging to this lane, in the driving direction.
|
Lane |
getLane()
Returns the lane.
|
RollingLaneStructureRecord |
getLeft()
Returns the left LSR or null if not available.
|
org.djunits.value.vdouble.scalar.Length |
getLength()
Returns the length of the lane.
|
List<RollingLaneStructureRecord> |
getNext()
Returns a list of next lanes.
|
List<RollingLaneStructureRecord> |
getPrev()
Returns a list of previous lanes.
|
RollingLaneStructureRecord |
getRight()
Returns the right LSR or null if not available.
|
org.djunits.value.vdouble.scalar.Length |
getStartDistance()
Returns the distance from a reference to the start of this lane, negative for upstream distance.
|
(package private) RollingLaneStructureRecord |
getStartDistanceSource()
Returns the source of the start distance.
|
org.opentrafficsim.core.network.Node |
getToNode()
Returns the the 'to' node of the link belonging to this lane, in the driving direction.
|
boolean |
isCutOffEnd()
Returns whether this lane has no next records as the lane structure was cut-off.
|
boolean |
isCutOffStart()
Returns whether this lane has no previous records as the lane structure was cut-off.
|
boolean |
isDeadEnd()
Returns whether the record forms a dead-end.
|
boolean |
isDownstreamBranch()
Returns whether the record is part of the downstream branch.
|
boolean |
isLinkMerge() |
boolean |
isLinkSplit()
Deprecated.
|
boolean |
legalLeft()
Returns whether a left lane change is legal.
|
boolean |
legalRight()
Returns whether a right lane change is legal.
|
boolean |
physicalLeft()
Returns whether a left lane change is physically possible.
|
boolean |
physicalRight()
Returns whether a right lane change is physically possible.
|
void |
setCutOffEnd(org.djunits.value.vdouble.scalar.Length cutOffEnd)
Sets this record as being cut-off, i.e.
|
void |
setCutOffStart(org.djunits.value.vdouble.scalar.Length cutOffStart)
Sets this record as being cut-off, i.e.
|
void |
setLeft(RollingLaneStructureRecord leftRecord,
org.opentrafficsim.core.gtu.GTUType gtuType) |
void |
setRight(RollingLaneStructureRecord rightRecord,
org.opentrafficsim.core.gtu.GTUType gtuType) |
String |
toString() |
(package private) void |
updateStartDistance(double fractionalPosition,
RollingLaneStructure laneStructure)
Updates the start distance, including all records who's start distance depends on this value.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpossibleLeft, possibleRightgetDistanceToPositionpublic RollingLaneStructureRecord(Lane lane, org.opentrafficsim.core.gtu.GTUDirectionality direction, RollingLaneStructureRecord startDistanceSource, RollingLaneStructureRecord.RecordLink recordLink)
lane - Lane; lanedirection - GTUDirectionality; direction of travel for the GTUstartDistanceSource - LaneStructureRecord; record on which the start distance is basedrecordLink - RecordLink; link type to sourcepublic RollingLaneStructureRecord(Lane lane, org.opentrafficsim.core.gtu.GTUDirectionality direction, org.djunits.value.vdouble.scalar.Length startDistance)
lane - the lane of the LSRdirection - the direction on which we process this lanestartDistance - distance to start of the record, negative for backwardspublic org.djunits.value.vdouble.scalar.Length getLength()
getLength in interface LaneRecord<LaneStructureRecord>final void changeStartDistanceSource(RollingLaneStructureRecord startDistanceSource, RollingLaneStructureRecord.RecordLink recordLink)
startDistanceSource - LaneStructureRecord; record on which the start distance is basedrecordLink - RecordLink; link type to sourcefinal void updateStartDistance(double fractionalPosition,
RollingLaneStructure laneStructure)
fractionalPosition - double; fractional position at the current cross-sectionlaneStructure - LaneStructure; parent lane structurefinal RollingLaneStructureRecord getStartDistanceSource()
public final org.opentrafficsim.core.network.Node getFromNode()
getFromNode in interface LaneStructureRecordpublic final org.opentrafficsim.core.network.Node getToNode()
getToNode in interface LaneStructureRecord@Deprecated public final boolean isLinkSplit()
public final boolean isLinkMerge()
public final boolean allowsRoute(org.opentrafficsim.core.network.route.Route route,
org.opentrafficsim.core.gtu.GTUType gtuType)
throws org.opentrafficsim.core.network.NetworkException
allowsRoute in interface LaneStructureRecordroute - Route; the route to followgtuType - GTUType; gtu typeorg.opentrafficsim.core.network.NetworkException - if no destination nodepublic final boolean allowsRouteAtEnd(org.opentrafficsim.core.network.route.Route route,
org.opentrafficsim.core.gtu.GTUType gtuType)
throws org.opentrafficsim.core.network.NetworkException
allowsRouteAtEnd in interface LaneStructureRecordroute - Route; the route to followgtuType - GTUType; gtu typeorg.opentrafficsim.core.network.NetworkException - if no destination nodepublic final RollingLaneStructureRecord getLeft()
getLeft in interface LaneStructureRecordpublic final void setLeft(RollingLaneStructureRecord leftRecord, org.opentrafficsim.core.gtu.GTUType gtuType)
leftRecord - set the left LSR or null if not available. Left and right are relative to the driving direction.gtuType - GTU typepublic final boolean legalLeft()
legalLeft in interface LaneStructureRecordpublic final boolean physicalLeft()
physicalLeft in interface LaneStructureRecordpublic final RollingLaneStructureRecord getRight()
getRight in interface LaneStructureRecordpublic final void setRight(RollingLaneStructureRecord rightRecord, org.opentrafficsim.core.gtu.GTUType gtuType)
rightRecord - set the right LSR or null if not available. Left and right are relative to the driving
directiongtuType - GTU typepublic final boolean legalRight()
legalRight in interface LaneStructureRecordpublic final boolean physicalRight()
physicalRight in interface LaneStructureRecordpublic final List<RollingLaneStructureRecord> getNext()
getNext in interface LaneRecord<LaneStructureRecord>final void clearNextList()
public final void addNext(RollingLaneStructureRecord next) throws org.opentrafficsim.core.gtu.GTUException
next - a next LSRs to add. Next is relative to the driving direction, not to the design line direction.org.opentrafficsim.core.gtu.GTUException - if the records is cut-off at the endpublic final List<RollingLaneStructureRecord> getPrev()
getPrev in interface LaneRecord<LaneStructureRecord>final void clearPrevList()
public final void addPrev(RollingLaneStructureRecord prev) throws org.opentrafficsim.core.gtu.GTUException
prev - a previous LSRs to add. Previous is relative to the driving direction, not to the design line direction.org.opentrafficsim.core.gtu.GTUException - if the records is cut-off at the startpublic final void setCutOffEnd(org.djunits.value.vdouble.scalar.Length cutOffEnd)
throws org.opentrafficsim.core.gtu.GTUException
cutOffEnd - where this lane was cut-off (in the driving direction) resulting in no next lanesorg.opentrafficsim.core.gtu.GTUException - if there are next recordspublic final void setCutOffStart(org.djunits.value.vdouble.scalar.Length cutOffStart)
throws org.opentrafficsim.core.gtu.GTUException
cutOffStart - where this lane was cut-off (in the driving direction) resulting in no prev lanesorg.opentrafficsim.core.gtu.GTUException - if there are previous recordspublic final boolean isCutOffEnd()
isCutOffEnd in interface LaneStructureRecordpublic final boolean isCutOffStart()
isCutOffStart in interface LaneStructureRecordpublic final org.djunits.value.vdouble.scalar.Length getCutOffEnd()
public final org.djunits.value.vdouble.scalar.Length getCutOffStart()
public final void clearCutOffEnd()
public final void clearCutOffStart()
public final boolean isDeadEnd()
isDeadEnd in interface LaneStructureRecordpublic final Lane getLane()
getLane in interface LaneRecord<LaneStructureRecord>public final org.opentrafficsim.core.gtu.GTUDirectionality getDirection()
getDirection in interface LaneRecord<LaneStructureRecord>public final org.djunits.value.vdouble.scalar.Length getStartDistance()
getStartDistance in interface LaneRecord<LaneStructureRecord>public boolean isDownstreamBranch()
true.isDownstreamBranch in interface LaneRecord<LaneStructureRecord>Copyright © 2014–2018 Delft University of Technology. All rights reserved.