public abstract class AbstractLane extends Object implements Lane
| Constructor and Description |
|---|
AbstractLane(double speedLimit)
Create a new Lane.
|
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
contains(Point2D pos)
Whether or not the provided point can be considered "in" this Lane.
|
abstract double |
distanceAlongLane(Point2D pos)
Get the distance along the Lane from the start of the Lane to the Point
in the center of the Lane nearest the given Point.
|
abstract Point2D |
getEndPoint()
Get the ending point of the Lane.
|
abstract double |
getHeadingAtNormalizedDistance(double normalizedDistance)
Get the heading of the Lane at a particular normalized distance from the
start of the Lane.
|
int |
getId()
Get the unique ID number of this Lane.
|
abstract double |
getInitialHeading()
Get the heading of this Lane at its starting point.
|
LaneIM |
getLaneIM()
Get the LaneIM object that helps to locate the intersection managers on
a lane.
|
abstract Point2D |
getLeadPoint(Point2D pos,
double leadDist)
Get a point further down the Lane from the nearest point to the given
position.
|
Lane |
getLeftNeighbor()
Get the left neighbor of this Lane.
|
abstract double |
getLength()
Get the length of this Lane.
|
Lane |
getNextLane()
Get the Lane into which this Lane leads, or
null if none. |
abstract Point2D |
getPointAtNormalizedDistance(double normalizedDistance)
Get a point in the center of the lane at a particular normalized distance
from the start of the Lane.
|
Lane |
getPrevLane()
Get the Lane which leads into this Lane, or
null if none. |
Lane |
getRightNeighbor()
Get the right neighbor of this Lane.
|
abstract Shape |
getShape()
Get a Shape describing this Lane, including its width.
|
abstract Shape |
getShape(double startFraction,
double endFraction)
Get a Shape describing an interval of this lane, using normalized
distances.
|
double |
getSpeedLimit()
Get the speed limit of this Lane, in meters per second.
|
abstract Point2D |
getStartPoint()
Get the starting point of the Lane.
|
abstract double |
getTerminalHeading()
Get the heading of this Lane at its ending point.
|
abstract double |
getWidth()
Get the width of this Lane, in meters.
|
boolean |
hasLeftNeighbor()
Whether the Lane has another Lane immediately to its left travelling in
the same direction.
|
boolean |
hasNextLane()
Whether or not this Lane flows into another Lane.
|
boolean |
hasPrevLane()
Whether or not another Lane flows into this Lane.
|
boolean |
hasRightNeighbor()
Whether the Lane has another Lane immediately to its right travelling in
the same direction.
|
abstract Point2D |
intersectionPoint(Line2D l)
The point at which the the given Line intersects the center of this Lane.
|
abstract Shape |
leftBorder()
Get a Shape representing the left border of this Lane.
|
abstract Point2D |
leftIntersectionPoint(Line2D l)
The point at which the the given Line intersects the left border of this
Lane.
|
abstract double |
nearestDistance(Point2D pos)
Get the distance from a point to the center of the Lane.
|
abstract Point2D |
nearestPoint(Point2D p)
Get the point in the center of the Lane nearest to the provided point.
|
abstract double |
normalizedDistanceAlongLane(Point2D pos)
Get the normalized distance to the point in the center of the lane
nearest the provided point.
|
abstract double |
remainingDistanceAlongLane(Point2D pos)
Get the amount of distance left in this Lane from the point on the Lane
nearest to the given point.
|
abstract Shape |
rightBorder()
Get a Shape representing the right border of this Lane.
|
abstract Point2D |
rightIntersectionPoint(Line2D l)
The point at which the the given Line intersects the right border of this
Lane.
|
void |
setId(int id)
Set the unique ID number of this Lane.
|
void |
setLeftNeighbor(Lane ln)
Register another Lane as a left neighbor to this Lane.
|
void |
setNextLane(Lane nextLane)
Set the Lane into which this Lane leads.
|
void |
setPrevLane(Lane prevLane)
Set the Lane which leads into this Lane.
|
void |
setRightNeighbor(Lane ln)
Register another Lane as a right neighbor to this Lane.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnormalizedDistancepublic int getId()
public void setId(int id)
public double getSpeedLimit()
getSpeedLimit in interface Lanepublic LaneIM getLaneIM()
public boolean hasNextLane()
hasNextLane in interface Lanepublic Lane getNextLane()
null if none.getNextLane in interface Lanenull if nonepublic void setNextLane(Lane nextLane)
setNextLane in interface LanenextLane - the Lane into which this Lane leadspublic boolean hasPrevLane()
hasPrevLane in interface Lanepublic Lane getPrevLane()
null if none.getPrevLane in interface Lanenull if nonepublic void setPrevLane(Lane prevLane)
setPrevLane in interface LaneprevLane - the Lane which leads into this Lanepublic boolean hasLeftNeighbor()
hasLeftNeighbor in interface Lanepublic Lane getLeftNeighbor()
getLeftNeighbor in interface Lanenull if none
existspublic void setLeftNeighbor(Lane ln)
setLeftNeighbor in interface Laneln - the Lane to set as this Lane's left neighborpublic boolean hasRightNeighbor()
hasRightNeighbor in interface Lanepublic Lane getRightNeighbor()
getRightNeighbor in interface Lanenull if none
existspublic void setRightNeighbor(Lane ln)
setRightNeighbor in interface Laneln - the Lane to set as this Lane's right neighborpublic abstract double getLength()
public abstract Point2D getStartPoint()
getStartPoint in interface Lanepublic abstract Point2D getEndPoint()
getEndPoint in interface Lanepublic abstract Point2D getPointAtNormalizedDistance(double normalizedDistance)
getPointAtNormalizedDistance in interface LanenormalizedDistance - the normalized distance (between 0 and 1) from
the start of the Lanepublic abstract Point2D nearestPoint(Point2D p)
nearestPoint in interface Lanep - the point to which the nearest point in the center of the Lane
should be foundpublic abstract double nearestDistance(Point2D pos)
nearestDistance in interface Lanepos - the point from which to find the distance to the Lanepublic abstract Point2D getLeadPoint(Point2D pos, double leadDist)
getLeadPoint in interface Lanepos - the position from which to calculate the nearest point in
the LaneleadDist - the lead distance further down the Lane, in metersleadDist further down the Lane from
the closest point in the Lane to pospublic abstract double distanceAlongLane(Point2D pos)
distanceAlongLane in interface Lanepos - the point to which to find the distance along the Lanepublic abstract double remainingDistanceAlongLane(Point2D pos)
remainingDistanceAlongLane in interface Lanepos - the point nearest which to find the distance to the end of the
Lanepublic abstract double normalizedDistanceAlongLane(Point2D pos)
normalizedDistanceAlongLane in interface Lanepos - the point near to which to find the normalized distancepublic abstract double getInitialHeading()
getInitialHeading in interface Lanepublic abstract double getTerminalHeading()
getTerminalHeading in interface Lanepublic abstract double getHeadingAtNormalizedDistance(double normalizedDistance)
getHeadingAtNormalizedDistance in interface LanenormalizedDistance - the normalized distance (between 0 and 1) from
the start of the Lanepublic abstract Point2D intersectionPoint(Line2D l)
intersectionPoint in interface Lanel - the Line with which to find the intersectionnull if it doesn't intersectpublic abstract double getWidth()
public abstract Shape getShape()
public abstract Shape getShape(double startFraction, double endFraction)
getShape in interface LanestartFraction - the normalized distance from the start of the lane
to the start of the segment which the Shape
representsendFraction - the normalized distance from the start of the lane
to the end of the segment which the Shape representspublic abstract boolean contains(Point2D pos)
public abstract Shape leftBorder()
leftBorder in interface Lanepublic abstract Shape rightBorder()
rightBorder in interface Lanepublic abstract Point2D leftIntersectionPoint(Line2D l)
leftIntersectionPoint in interface Lanel - the Line with which to find the intersectionnull if it doesn't intersectpublic abstract Point2D rightIntersectionPoint(Line2D l)
rightIntersectionPoint in interface Lanel - the Line with which to find the intersectionnull if it doesn't intersectCopyright © 2013. All rights reserved.