Class 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 Detail

      • DirectedLinkPosition

        public DirectedLinkPosition​(Link link,
                                    double fractionalLongitudinalPosition,
                                    GtuDirectionality direction)
        Construct a new DirectedLinkPosition.
        Parameters:
        link - Link; the link
        fractionalLongitudinalPosition - double; fractional position along the link
        direction - 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 link
        position - Length; position
        direction - 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.