Class DirectedLanePosition
- java.lang.Object
-
- org.opentrafficsim.road.network.lane.DirectedLanePosition
-
- All Implemented Interfaces:
Serializable
public class DirectedLanePosition extends Object implements Serializable
Store one position, direction and lane of a GTU.Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
$LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version Nov 11, 2015
BSD-style license. See OpenTrafficSim License.- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DirectedLanePosition(Lane lane, Length position, GTUDirectionality gtuDirection)
Construct a new DirectedLanePosition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
GTUDirectionality
getGtuDirection()
Retrieve the gtuDirection.Lane
getLane()
Retrieve the lane.LaneDirection
getLaneDirection()
Returns the lane direction in the direction of this lane direction.LinkDirection
getLinkDirection()
Returns the link direction in the direction of this lane direction.DirectedPoint
getLocation()
Retrieve the location and direction of the GTU on the lane.Length
getPosition()
Retrieve the position on the lane.int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
DirectedLanePosition
public DirectedLanePosition(Lane lane, Length position, GTUDirectionality gtuDirection) throws GTUException
Construct a new DirectedLanePosition.- Parameters:
lane
- Lane; the lane for the positionposition
- Length; the position on the lane, relative to the cross section link (design line)gtuDirection
- GTUDirectionality; the direction the vehicle is driving to -- either in the direction of the design line, or against it- Throws:
GTUException
- when preconditions fail
-
-
Method Detail
-
getLane
public final Lane getLane()
Retrieve the lane.- Returns:
- Lane; the lane for the position
-
getPosition
public final Length getPosition()
Retrieve the position on the lane.- Returns:
- Length; the position on the lane, relative to the cross section link (design line)
-
getGtuDirection
public final GTUDirectionality getGtuDirection()
Retrieve the gtuDirection.- Returns:
- GTUDirectionality; gtuDirection the direction the vehicle is driving to -- either in the direction of the design line, or against it
-
getLocation
public final DirectedPoint getLocation()
Retrieve the location and direction of the GTU on the lane.- Returns:
- DirectedPoint; the location and direction of the GTU on the lane
-
getLaneDirection
public final LaneDirection getLaneDirection()
Returns the lane direction in the direction of this lane direction.- Returns:
- lane direction in the direction of this lane direction
-
getLinkDirection
public final LinkDirection getLinkDirection()
Returns the link direction in the direction of this lane direction.- Returns:
- link direction in the direction of this lane direction
-
-