|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectaim4.map.lane.LaneIM
public class LaneIM
The lane and intersection manager relationship.
Constructor Summary | |
---|---|
LaneIM(Lane lane)
Create a lane and intersection manager relationship object. |
Method Summary | |
---|---|
double |
distanceFromPrevIntersection(Point2D p)
Find the distance from a point, projected onto the Lane, to the previous intersection that a vehicle at that position on the Lane would have encountered. |
double |
distanceToFirstIntersection()
Get the distance from the start of this Lane to the first IntersectionManager that this Lane, or any Lane it leads into intersects. |
double |
distanceToNextIntersection(Point2D p)
Find the distance to the next IntersectionManager a vehicle at the given position will encounter. |
double |
distanceToNextIntersectionManager(IntersectionManager im)
Get the distance from the given IntersectionManager to the next one that that this Lane, or any Lane it leads into enters. |
IntersectionManager |
firstIntersectionManager()
Get the first IntersectionManager that this Lane, or any Lane it leads into enters. |
Lane |
laneToFirstIntersection()
Find the next Lane, including this one, that enters an intersection at any point. |
Lane |
laneToNextIntersection(Point2D p)
Find the next Lane, including this one, that will enter an intersection, starting at the point in this Lane nearest the provided point. |
IntersectionManager |
lastIntersectionManager()
Get the last IntersectionManager that this Lane, or any Lane that leads into it enters. |
IntersectionManager |
nextIntersectionManager(IntersectionManager im)
Get the IntersectionManager that this Lane, or any Lane it leads into enters, after the given IntersectionManager. |
IntersectionManager |
nextIntersectionManager(Point2D p)
Find the next IntersectionManager a vehicle at the given position will encounter. |
void |
registerIntersectionManager(IntersectionManager im)
Register an IntersectionManager with this Lane. |
double |
remainingDistanceFromLastIntersection()
Get the distance from the end of this Lane to the last IntersectionManager that this Lane, or any Lane that leads into it entered. |
double |
timeToNextIntersectionManager(IntersectionManager im,
double maxVelocity)
Get the approximate time from the given IntersectionManager to the next one that that this Lane, or any Lane it leads into enters, based on distances and speed limits. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LaneIM(Lane lane)
lane
- the lane.Method Detail |
---|
public void registerIntersectionManager(IntersectionManager im)
IntersectionManager
with this Lane. If the Lane does
not intersect the area controlled by the IntersectionManager, it has no
effect. Otherwise, the IntersectionManager is stored and returned under
certain circumstances by the nextIntersectionManager
method.
im
- the IntersectionManager to registerpublic IntersectionManager firstIntersectionManager()
public double distanceToFirstIntersection()
Double.MAX_VALUE
if no such IntersectionManager exists.
Double.MAX_VALUE
if no such
IntersectionManager existspublic Lane laneToFirstIntersection()
public IntersectionManager lastIntersectionManager()
public double remainingDistanceFromLastIntersection()
Double.MAX_VALUE
if no such IntersectionManager exists.
Double.MAX_VALUE
if no such
IntersectionManager existspublic IntersectionManager nextIntersectionManager(Point2D p)
p
- the location of the hypothetical vehicle
null
if nonepublic double distanceToNextIntersection(Point2D p)
p
- the current location of the vehicle
public Lane laneToNextIntersection(Point2D p)
p
- the current location of the vehicle
public double distanceFromPrevIntersection(Point2D p)
p
- the current location of the vehicle
public IntersectionManager nextIntersectionManager(IntersectionManager im)
im
- the IntersectionManager to which we would like the successor
public double distanceToNextIntersectionManager(IntersectionManager im)
im
- the IntersectionManager at which to start
public double timeToNextIntersectionManager(IntersectionManager im, double maxVelocity)
im
- the IntersectionManager at which to startmaxVelocity
- the maximum velocity of the vehicle
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |