

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
public interface Lane
This is a base class for all lanes. Creates an ID system for lanes such that all lanes will have a different integer ID. Also handles traffic generation methods, and other things that are the same no matter the implementation of the Lane.
Method Summary  

boolean 
contains(Point2D pos)
Whether or not the provided point can be considered "in" this Lane. 
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. 
Point2D 
getEndPoint()
Get the ending point of the Lane. 
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. 
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. 
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. 
double 
getLength()
Get the length of this Lane. 
Lane 
getNextLane()
Get the Lane into which this Lane leads, or null if none. 
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. 
Shape 
getShape()
Get a Shape describing this Lane, including its width. 
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. 
Point2D 
getStartPoint()
Get the starting point of the Lane. 
double 
getTerminalHeading()
Get the heading of this Lane at its ending point. 
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. 
Point2D 
intersectionPoint(Line2D l)
The point at which the the given Line intersects the center of this Lane. 
Shape 
leftBorder()
Get a Shape representing the left border of this Lane. 
Point2D 
leftIntersectionPoint(Line2D l)
The point at which the the given Line intersects the left border of this Lane. 
double 
nearestDistance(Point2D pos)
Get the distance from a point to the center of the Lane. 
Point2D 
nearestPoint(Point2D p)
Get the point in the center of the Lane nearest to the provided point. 
double 
normalizedDistance(double distance)
Get the normalized distance at the distance from the starting point. 
double 
normalizedDistanceAlongLane(Point2D pos)
Get the normalized distance to the point in the center of the lane nearest the provided point. 
double 
remainingDistanceAlongLane(Point2D pos)
Get the amount of distance left in this Lane from the point on the Lane nearest to the given point. 
Shape 
rightBorder()
Get a Shape representing the right border of this Lane. 
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. 
Method Detail 

int getId()
void setId(int id)
id
 the ID number of this lanedouble getSpeedLimit()
LaneIM getLaneIM()
boolean hasNextLane()
Lane getNextLane()
null
if none.
null
if nonevoid setNextLane(Lane nextLane)
nextLane
 the Lane into which this Lane leadsboolean hasPrevLane()
Lane getPrevLane()
null
if none.
null
if nonevoid setPrevLane(Lane prevLane)
prevLane
 the Lane which leads into this Laneboolean hasLeftNeighbor()
Lane getLeftNeighbor()
null
if none
existsvoid setLeftNeighbor(Lane ln)
ln
 the Lane to set as this Lane's left neighborboolean hasRightNeighbor()
Lane getRightNeighbor()
null
if none
existsvoid setRightNeighbor(Lane ln)
ln
 the Lane to set as this Lane's right neighbordouble getLength()
Point2D getStartPoint()
Point2D getEndPoint()
Point2D getPointAtNormalizedDistance(double normalizedDistance)
normalizedDistance
 the normalized distance (between 0 and 1) from
the start of the Lane
Point2D nearestPoint(Point2D p)
p
 the point to which the nearest point in the center of the Lane
should be found
double nearestDistance(Point2D pos)
pos
 the point from which to find the distance to the Lane
Point2D getLeadPoint(Point2D pos, double leadDist)
pos
 the position from which to calculate the nearest point in
the LaneleadDist
 the lead distance further down the Lane, in meters
leadDist
further down the Lane from
the closest point in the Lane to pos
double distanceAlongLane(Point2D pos)
pos
 the point to which to find the distance along the Lane
double remainingDistanceAlongLane(Point2D pos)
pos
 the point nearest which to find the distance to the end of the
Lane
double normalizedDistanceAlongLane(Point2D pos)
pos
 the point near to which to find the normalized distance
double normalizedDistance(double distance)
distance
 the distance along the center of the lane.
double getInitialHeading()
double getTerminalHeading()
double getHeadingAtNormalizedDistance(double normalizedDistance)
normalizedDistance
 the normalized distance (between 0 and 1) from
the start of the Lane
Point2D intersectionPoint(Line2D l)
l
 the Line with which to find the intersection
null
if it doesn't intersectdouble getWidth()
Shape getShape()
Shape getShape(double startFraction, double endFraction)
startFraction
 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 represents
IllegalArgumentException
 if startFraction
or
endFraction
are not between
0 and 1boolean contains(Point2D pos)
pos
 the point to check
Shape leftBorder()
Shape rightBorder()
Point2D leftIntersectionPoint(Line2D l)
l
 the Line with which to find the intersection
null
if it doesn't intersectPoint2D rightIntersectionPoint(Line2D l)
l
 the Line with which to find the intersection
null
if it doesn't intersect


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 