Package org.opentrafficsim.core.network
Class DirectedLinkPosition
- java.lang.Object
-
- org.opentrafficsim.core.network.LinkDirection
-
- org.opentrafficsim.core.network.DirectedLinkPosition
-
- All Implemented Interfaces:
Serializable
public class DirectedLinkPosition extends LinkDirection
A DirectedLinkPosition object packs a Link, a Direction and a position along that link. TODO document whether the position is measured from the start node of the link, or from the node that would be the entrance node when traveling in the direction.Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version 22 okt. 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DirectedLinkPosition(Link link, double fractionalLongitudinalPosition, GtuDirectionality direction)Construct a new DirectedLinkPosition.DirectedLinkPosition(Link link, Length position, GtuDirectionality direction)Construct a new DirectedLinkPosition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetFractionalLongitudinalPosition()Retrieve the fractional position along the link.LengthgetLongitudinalPosition()Retrieve the position along the link.StringtoString()-
Methods inherited from class org.opentrafficsim.core.network.LinkDirection
equals, getDirection, getId, getLength, getLink, getLinkType, getNodeFrom, getNodeTo, hashCode
-
-
-
-
Constructor Detail
-
DirectedLinkPosition
public DirectedLinkPosition(Link link, double fractionalLongitudinalPosition, GtuDirectionality direction)
Construct a new DirectedLinkPosition.- Parameters:
link- Link; the linkfractionalLongitudinalPosition- double; fractional position along the linkdirection- GtuDirectionality; the direction on the link, with or against the design line
-
DirectedLinkPosition
public DirectedLinkPosition(Link link, Length position, GtuDirectionality direction)
Construct a new DirectedLinkPosition.- Parameters:
link- Link; the linkposition- Length; positiondirection- GtuDirectionality; the direction on the link, with or against the design line
-
-
Method Detail
-
getFractionalLongitudinalPosition
public final double getFractionalLongitudinalPosition()
Retrieve the fractional position along the link.- Returns:
- double; the fractional position along the link
-
getLongitudinalPosition
public final Length getLongitudinalPosition()
Retrieve the position along the link.- Returns:
- Length; the traveled length on this link.
-
toString
public String toString()
- Overrides:
toStringin classLinkDirection
-
-