Package org.opentrafficsim.core.network
Class LinkLocation
java.lang.Object
org.opentrafficsim.core.network.LinkLocation
- All Implemented Interfaces:
Serializable
public class LinkLocation extends Object implements Serializable
"1D" implementation. Mapping on the design line (often the center line) of a road.
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2019-11-14 14:36:06 +0100 (Thu, 14 Nov 2019) $, @version $Revision: 5717 $, by $Author: averbraeck $,
initial version Oct 22, 2014
- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description LinkLocation(Link link, double fractionalLongitudinalPosition)LinkLocation(Link link, Length position) -
Method Summary
Modifier and Type Method Description Lengthdistance(LinkLocation loc)Returns the distance to another LinkLocation.doublegetFractionalLongitudinalPosition()LinkgetLink()LengthgetLongitudinalPosition()StringtoString()
-
Constructor Details
-
LinkLocation
- Parameters:
link- Link; The link of the location of a point relative to the GTU.fractionalLongitudinalPosition- double; The fractional position (between 0.0 and 1.0) of the reference point on the link.
-
LinkLocation
- Parameters:
link- Link; The link of the location of a point relative to the GTU.position- Length; The position as a length of the reference point on the link.
-
-
Method Details
-
getLink
- Returns:
- lane.
-
getFractionalLongitudinalPosition
public final double getFractionalLongitudinalPosition()- Returns:
- fractionalLongitudinalPosition.
-
getLongitudinalPosition
- Returns:
- position as a length as a traveled length on this link.
-
distance
Returns the distance to another LinkLocation. If the other location is in front of us, the distance is positive. If it is behind us, it is negative.- Parameters:
loc- LinkLocation; the link location to find the distance to.- Returns:
- the distance to another LinkLocation.
-
toString
-